mirror of
https://github.com/swift-server/RediStack.git
synced 2026-05-03 07:32:28 +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:
committed by
GitHub
parent
2df32390e2
commit
e7e1061170
@@ -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
|
||||
@@ -51,6 +51,11 @@ docker run -d -p 6379:6379 --name redis redis:5
|
||||
|
||||
Otherwise, install Redis directly on your machine from [Redis.io](https://redis.io/download).
|
||||
|
||||
### Run CI checks locally
|
||||
|
||||
You can run the GitHub Actions workflows locally using
|
||||
[act](https://github.com/nektos/act). For detailed steps on how to do this please see [https://github.com/swiftlang/github-workflows?tab=readme-ov-file#running-workflows-locally](https://github.com/swiftlang/github-workflows?tab=readme-ov-file#running-workflows-locally).
|
||||
|
||||
### Submitting a Pull Request
|
||||
|
||||
A great PR that is likely to be merged quickly is:
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
ARG swift_version=5.7
|
||||
ARG ubuntu_version=jammy
|
||||
ARG base_image=swift:$swift_version-$ubuntu_version
|
||||
FROM $base_image
|
||||
# needed to do again after FROM due to docker limitation
|
||||
ARG swift_version
|
||||
ARG ubuntu_version
|
||||
|
||||
# set as UTF-8
|
||||
RUN apt-get update && apt-get install -y locales locales-all
|
||||
ENV LC_ALL en_US.UTF-8
|
||||
ENV LANG en_US.UTF-8
|
||||
ENV LANGUAGE en_US.UTF-8
|
||||
|
||||
# dependencies
|
||||
RUN apt-get update && apt-get install -y wget
|
||||
RUN apt-get update && apt-get install -y lsof dnsutils netcat-openbsd net-tools libz-dev curl jq # used by integration tests
|
||||
|
||||
# tools
|
||||
RUN mkdir -p $HOME/.tools
|
||||
RUN echo 'export PATH="$HOME/.tools:$PATH"' >> $HOME/.profile
|
||||
|
||||
# swiftformat (until part of the toolchain)
|
||||
|
||||
ARG swiftformat_version=0.48.8
|
||||
RUN git clone --branch $swiftformat_version --depth 1 https://github.com/nicklockwood/SwiftFormat $HOME/.tools/swift-format
|
||||
RUN cd $HOME/.tools/swift-format && swift build -c release
|
||||
RUN ln -s $HOME/.tools/swift-format/.build/release/swiftformat $HOME/.tools/swiftformat
|
||||
@@ -1,20 +0,0 @@
|
||||
version: "3"
|
||||
|
||||
services:
|
||||
|
||||
runtime-setup:
|
||||
image: redistack:20.04-5.6
|
||||
build:
|
||||
args:
|
||||
ubuntu_version: "focal"
|
||||
swift_version: "5.6"
|
||||
|
||||
documentation-check:
|
||||
image: redistack:20.04-5.6
|
||||
|
||||
test:
|
||||
image: redistack:20.04-5.6
|
||||
environment: []
|
||||
|
||||
shell:
|
||||
image: redistack:20.04-5.6
|
||||
@@ -1,20 +0,0 @@
|
||||
version: "3"
|
||||
|
||||
services:
|
||||
|
||||
runtime-setup:
|
||||
image: redistack:22.04-5.10
|
||||
build:
|
||||
args:
|
||||
base_image: "swiftlang/swift:nightly-5.10-jammy"
|
||||
|
||||
documentation-check:
|
||||
image: redistack:22.04-5.10
|
||||
|
||||
test:
|
||||
image: redistack:22.04-5.10
|
||||
environment:
|
||||
- IMPORT_CHECK_ARG=--explicit-target-dependency-import-check error
|
||||
|
||||
shell:
|
||||
image: redistack:22.04-5.10
|
||||
@@ -1,20 +0,0 @@
|
||||
version: "3"
|
||||
|
||||
services:
|
||||
|
||||
runtime-setup:
|
||||
image: redistack:22.04-5.7
|
||||
build:
|
||||
args:
|
||||
ubuntu_version: "jammy"
|
||||
swift_version: "5.7"
|
||||
|
||||
documentation-check:
|
||||
image: redistack:22.04-5.7
|
||||
|
||||
test:
|
||||
image: redistack:22.04-5.7
|
||||
environment: []
|
||||
|
||||
shell:
|
||||
image: redistack:22.04-5.7
|
||||
@@ -1,21 +0,0 @@
|
||||
version: "3"
|
||||
|
||||
services:
|
||||
|
||||
runtime-setup:
|
||||
image: redistack:22.04-5.8
|
||||
build:
|
||||
args:
|
||||
ubuntu_version: "jammy"
|
||||
swift_version: "5.8"
|
||||
|
||||
documentation-check:
|
||||
image: redistack:22.04-5.8
|
||||
|
||||
test:
|
||||
image: redistack:22.04-5.8
|
||||
environment:
|
||||
- IMPORT_CHECK_ARG=--explicit-target-dependency-import-check error
|
||||
|
||||
shell:
|
||||
image: redistack:22.04-5.8
|
||||
@@ -1,21 +0,0 @@
|
||||
version: "3"
|
||||
|
||||
services:
|
||||
|
||||
runtime-setup:
|
||||
image: redistack:22.04-5.9
|
||||
build:
|
||||
args:
|
||||
ubuntu_version: "jammy"
|
||||
swift_version: "5.9"
|
||||
|
||||
documentation-check:
|
||||
image: redistack:22.04-5.9
|
||||
|
||||
test:
|
||||
image: redistack:22.04-5.9
|
||||
environment:
|
||||
- IMPORT_CHECK_ARG=--explicit-target-dependency-import-check error
|
||||
|
||||
shell:
|
||||
image: redistack:22.04-5.9
|
||||
@@ -1,20 +0,0 @@
|
||||
version: "3"
|
||||
|
||||
services:
|
||||
|
||||
runtime-setup:
|
||||
image: redistack:22.04-main
|
||||
build:
|
||||
args:
|
||||
base_image: "swiftlang/swift:nightly-main-jammy"
|
||||
|
||||
documentation-check:
|
||||
image: redistack:22.04-main
|
||||
|
||||
test:
|
||||
image: redistack:22.04-main
|
||||
environment:
|
||||
- IMPORT_CHECK_ARG=--explicit-target-dependency-import-check error
|
||||
|
||||
shell:
|
||||
image: redistack:22.04-main
|
||||
@@ -1,51 +0,0 @@
|
||||
# this file is not designed to be run directly
|
||||
# instead, use the docker-compose.<os>.<swift> files
|
||||
# eg docker-compose -f docker/docker-compose.yaml -f docker/docker-compose.1804.50.yaml run test
|
||||
version: "3"
|
||||
|
||||
services:
|
||||
|
||||
runtime-setup:
|
||||
image: redistack:default
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
|
||||
common: &common
|
||||
image: redistack:default
|
||||
depends_on: [runtime-setup]
|
||||
volumes:
|
||||
- ~/.ssh:/root/.ssh
|
||||
- ..:/code:z
|
||||
working_dir: /code
|
||||
cap_drop:
|
||||
- CAP_NET_RAW
|
||||
- CAP_NET_BIND_SERVICE
|
||||
|
||||
soundness:
|
||||
<<: *common
|
||||
command: /bin/bash -xcl "./scripts/soundness.sh"
|
||||
|
||||
documentation-check:
|
||||
<<: *common
|
||||
command: /bin/bash -xcl "./scripts/check-docs.sh"
|
||||
|
||||
test:
|
||||
<<: *common
|
||||
depends_on: [runtime-setup, redis]
|
||||
command: /bin/bash -xcl "swift test -Xswiftc -warnings-as-errors --enable-test-discovery $${SANITIZER_ARG-} $${IMPORT_CHECK_ARG-}"
|
||||
environment:
|
||||
- REDIS_URL=redis
|
||||
|
||||
# util
|
||||
|
||||
shell:
|
||||
<<: *common
|
||||
entrypoint: /bin/bash
|
||||
|
||||
docs:
|
||||
<<: *common
|
||||
command: /bin/bash -cl "./scripts/generate_docs.sh"
|
||||
|
||||
redis:
|
||||
image: redis:7
|
||||
@@ -1,53 +0,0 @@
|
||||
#!/bin/bash
|
||||
##===----------------------------------------------------------------------===##
|
||||
##
|
||||
## This source file is part of the RediStack open source project
|
||||
##
|
||||
## Copyright (c) 2019 RediStack project authors
|
||||
## Licensed under Apache License v2.0
|
||||
##
|
||||
## See LICENSE.txt for license information
|
||||
## See CONTRIBUTORS.txt for the list of RediStack project authors
|
||||
##
|
||||
## SPDX-License-Identifier: Apache-2.0
|
||||
##
|
||||
##===----------------------------------------------------------------------===##
|
||||
##===----------------------------------------------------------------------===##
|
||||
##
|
||||
## This source file is part of the SwiftNIO open source project
|
||||
##
|
||||
## Copyright (c) 2017-2019 Apple Inc. and the SwiftNIO project authors
|
||||
## Licensed under Apache License v2.0
|
||||
##
|
||||
## See LICENSE.txt for license information
|
||||
## See CONTRIBUTORS.txt for the list of SwiftNIO project authors
|
||||
##
|
||||
## SPDX-License-Identifier: Apache-2.0
|
||||
##
|
||||
##===----------------------------------------------------------------------===##
|
||||
|
||||
set -eu
|
||||
here="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
contributors=$( cd "$here"/.. && git shortlog -es | cut -f2 | sed 's/^/- /' )
|
||||
|
||||
cat > "$here/../CONTRIBUTORS.txt" <<- EOF
|
||||
For the purpose of tracking copyright, this is the list of individuals and
|
||||
organizations who have contributed source code to RediStack.
|
||||
|
||||
For employees of an organization/company where the copyright of work done
|
||||
by employees of that company is held by the company itself, only the company
|
||||
needs to be listed here.
|
||||
|
||||
## COPYRIGHT HOLDERS
|
||||
|
||||
- Apple Inc. (all contributors with '@apple.com')
|
||||
- Globant Inc. (all contributors with '@globant.com')
|
||||
|
||||
### Contributors
|
||||
|
||||
$contributors
|
||||
|
||||
**Updating this list**
|
||||
|
||||
Please do not edit this file manually. It is generated using \`./scripts/generate_contributors_list.sh\`. If a name is misspelled or appearing multiple times: add an entry in \`./.mailmap\`
|
||||
EOF
|
||||
Reference in New Issue
Block a user