mirror of
https://github.com/swift-server/RediStack.git
synced 2026-05-03 07:32:28 +00:00
89 lines
3.5 KiB
YAML
89 lines
3.5 KiB
YAML
name: Unit tests
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
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_6_1_enabled:
|
|
type: boolean
|
|
description: "Boolean to enable the Linux 6.1 Swift version matrix job. Defaults to true."
|
|
default: true
|
|
linux_6_1_arguments_override:
|
|
type: string
|
|
description: "The arguments passed to swift test in the Linux 6.1 Swift version matrix job."
|
|
default: ""
|
|
linux_6_2_enabled:
|
|
type: boolean
|
|
description: "Boolean to enable the Linux 6.2 Swift version matrix job. Defaults to true."
|
|
default: true
|
|
linux_6_2_arguments_override:
|
|
type: string
|
|
description: "The arguments passed to swift test in the Linux 6.2 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:6.0-jammy"
|
|
swift_version: "6.0"
|
|
enabled: ${{ inputs.linux_6_0_enabled }}
|
|
- image: "swift:6.1-jammy"
|
|
swift_version: "6.1"
|
|
enabled: ${{ inputs.linux_6_1_enabled }}
|
|
- image: "swift:6.2-jammy"
|
|
swift_version: "6.2"
|
|
enabled: ${{ inputs.linux_6_2_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@v6
|
|
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_6_0: "swift test ${{ inputs.linux_6_0_arguments_override }}"
|
|
COMMAND_OVERRIDE_6_1: "swift test ${{ inputs.linux_6_1_arguments_override }}"
|
|
COMMAND_OVERRIDE_6_2: "swift test ${{ inputs.linux_6_2_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
|