mirror of
https://github.com/swift-server/RediStack.git
synced 2026-06-02 07:37:33 +00:00
Follow-up cleanup of GitHub Actions migration (#116)
* Motivation: Make use of more common GitHub Actions migration workflows and repository style changes. Modifications: * Unit tests workflows run redis in a separate services container to speed up unit tests * Introduce `main.yml` which runs workflows on each commit to main and periodically to catch any regressions in merges or from upstream. * Remove the docker files which are no longer used and contained outdated pipelines. * Add Cxx interoperability checks Result: More in common with other GitHub Actions adoptions. * disable strict concurrency
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
name: Main
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
schedule:
|
||||
- cron: "0 8,20 * * *"
|
||||
|
||||
jobs:
|
||||
unit-tests:
|
||||
name: Unit tests
|
||||
uses: ./.github/workflows/unit_tests.yml
|
||||
with:
|
||||
linux_5_9_arguments_override: "--explicit-target-dependency-import-check error"
|
||||
linux_5_10_arguments_override: "--explicit-target-dependency-import-check error"
|
||||
linux_6_0_arguments_override: "--explicit-target-dependency-import-check error"
|
||||
linux_nightly_6_0_arguments_override: "--explicit-target-dependency-import-check error"
|
||||
linux_nightly_main_arguments_override: "--explicit-target-dependency-import-check error"
|
||||
@@ -13,10 +13,14 @@ jobs:
|
||||
|
||||
unit-tests:
|
||||
name: Unit tests
|
||||
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main
|
||||
uses: ./.github/workflows/unit_tests.yml
|
||||
with:
|
||||
linux_exclude_swift_versions: "[{\"swift_version\": \"5.8\"}]"
|
||||
# since we don't have systemctl, we run the redis server manually in the background
|
||||
linux_pre_build_command: apt-get update -y && apt-get install redis -y
|
||||
linux_build_command: bash -c 'nohup redis-server & swift test'
|
||||
enable_windows_checks: false
|
||||
linux_5_9_arguments_override: "--explicit-target-dependency-import-check error"
|
||||
linux_5_10_arguments_override: "--explicit-target-dependency-import-check error"
|
||||
linux_6_0_arguments_override: "--explicit-target-dependency-import-check error"
|
||||
linux_nightly_6_0_arguments_override: "--explicit-target-dependency-import-check error"
|
||||
linux_nightly_main_arguments_override: "--explicit-target-dependency-import-check error"
|
||||
|
||||
cxx-interop:
|
||||
name: Cxx interop
|
||||
uses: apple/swift-nio/.github/workflows/cxx_interop.yml@main
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
name: Unit tests
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
linux_5_9_enabled:
|
||||
type: boolean
|
||||
description: "Boolean to enable the Linux 5.9 Swift version matrix job. Defaults to true."
|
||||
default: true
|
||||
linux_5_9_arguments_override:
|
||||
type: string
|
||||
description: "The arguments passed to swift test in the Linux 5.9 Swift version matrix job."
|
||||
default: ""
|
||||
linux_5_10_enabled:
|
||||
type: boolean
|
||||
description: "Boolean to enable the Linux 5.10 Swift version matrix job. Defaults to true."
|
||||
default: true
|
||||
linux_5_10_arguments_override:
|
||||
type: string
|
||||
description: "The arguments passed to swift test in the Linux 5.10 Swift version matrix job."
|
||||
default: ""
|
||||
linux_6_0_enabled:
|
||||
type: boolean
|
||||
description: "Boolean to enable the Linux 6.0 Swift version matrix job. Defaults to true."
|
||||
default: true
|
||||
linux_6_0_arguments_override:
|
||||
type: string
|
||||
description: "The arguments passed to swift test in the Linux 6.0 Swift version matrix job."
|
||||
default: ""
|
||||
linux_nightly_6_0_enabled:
|
||||
type: boolean
|
||||
description: "Boolean to enable the Linux nightly 6.0 Swift version matrix job. Defaults to true."
|
||||
default: true
|
||||
linux_nightly_6_0_arguments_override:
|
||||
type: string
|
||||
description: "The arguments passed to swift test in the Linux nightly 6.0 Swift version matrix job."
|
||||
default: ""
|
||||
linux_nightly_main_enabled:
|
||||
type: boolean
|
||||
description: "Boolean to enable the Linux nightly main Swift version matrix job. Defaults to true."
|
||||
default: true
|
||||
linux_nightly_main_arguments_override:
|
||||
type: string
|
||||
description: "The arguments passed to swift test in the Linux nightly main Swift version matrix job."
|
||||
default: ""
|
||||
|
||||
jobs:
|
||||
unit-tests:
|
||||
name: Linux (${{ matrix.swift.swift_version }})
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
# We are specifying only the major and minor of the docker images to automatically pick up the latest patch release
|
||||
swift:
|
||||
- image: "swift:5.9-jammy"
|
||||
swift_version: "5.9"
|
||||
enabled: ${{ inputs.linux_5_9_enabled }}
|
||||
- image: "swift:5.10-jammy"
|
||||
swift_version: "5.10"
|
||||
enabled: ${{ inputs.linux_5_10_enabled }}
|
||||
- image: "swift:6.0-jammy"
|
||||
swift_version: "6.0"
|
||||
enabled: ${{ inputs.linux_6_0_enabled }}
|
||||
- image: "swiftlang/swift:nightly-6.0-jammy"
|
||||
swift_version: "nightly-6.0"
|
||||
enabled: ${{ inputs.linux_nightly_6_0_enabled }}
|
||||
- image: "swiftlang/swift:nightly-main-jammy"
|
||||
swift_version: "nightly-main"
|
||||
enabled: ${{ inputs.linux_nightly_main_enabled }}
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
if: ${{ matrix.swift.enabled }}
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
persist-credentials: false
|
||||
submodules: true
|
||||
- name: Mark the workspace as safe
|
||||
if: ${{ matrix.swift.enabled }}
|
||||
# https://github.com/actions/checkout/issues/766
|
||||
run: git config --global --add safe.directory ${GITHUB_WORKSPACE}
|
||||
- name: Run matrix job
|
||||
if: ${{ matrix.swift.enabled }}
|
||||
env:
|
||||
SWIFT_VERSION: ${{ matrix.swift.swift_version }}
|
||||
COMMAND: "swift test"
|
||||
COMMAND_OVERRIDE_5_9: "swift test ${{ inputs.linux_5_9_arguments_override }}"
|
||||
COMMAND_OVERRIDE_5_10: "swift test ${{ inputs.linux_5_10_arguments_override }}"
|
||||
COMMAND_OVERRIDE_6_0: "swift test ${{ inputs.linux_6_0_arguments_override }}"
|
||||
COMMAND_OVERRIDE_NIGHTLY_6_0: "swift test ${{ inputs.linux_nightly_6_0_arguments_override }}"
|
||||
COMMAND_OVERRIDE_NIGHTLY_MAIN: "swift test ${{ inputs.linux_nightly_main_arguments_override }}"
|
||||
REDIS_URL: redis
|
||||
run: |
|
||||
apt-get -qq update && apt-get -qq -y install curl
|
||||
curl -s https://raw.githubusercontent.com/apple/swift-nio/main/scripts/check-matrix-job.sh | bash
|
||||
container:
|
||||
image: ${{ matrix.swift.image }}
|
||||
services:
|
||||
redis:
|
||||
image: redis:7
|
||||
Reference in New Issue
Block a user