From 1a04e4e4f328aa4439c47b7fb9fe33c301721c55 Mon Sep 17 00:00:00 2001 From: Gwynne Raskind Date: Tue, 26 May 2020 12:18:58 -0500 Subject: [PATCH] New works-for-everything CI (#2365) * New works-for-everything CI This version of the test workflow can be pasted without changes into any repo whose tests don't have additional dependencies and don't need to separately test that they're still Vapor-compatible (such as console-kit). Improvements over existing CI: - Runs on pushes to master as well as PRs - Full coverage of all available Swift runner images for Linux - Uses latest Xcode without hardcoding on macOS - Nice names for each test step - Nice name for the workflow itself * Apply suggestions from code review --- .github/workflows/test.yml | 64 ++++++++++++++++++++++++++------------ 1 file changed, 44 insertions(+), 20 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5cac5ad364..2506985a3d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,25 +1,49 @@ -name: test +name: Test Matrix + on: -- pull_request + pull_request: + push: + branches: + - master + jobs: - vapor_macos: - runs-on: macos-latest - env: - DEVELOPER_DIR: /Applications/Xcode_11.4.1.app/Contents/Developer - steps: - - uses: actions/checkout@v2 - - run: xcrun swift test --enable-test-discovery --sanitize=thread - vapor_xenial: - container: - image: vapor/swift:5.2-xenial + + Linux: runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + image: + - swift:5.2-xenial + - swift:5.2-bionic + - swiftlang/swift:nightly-5.2-xenial + - swiftlang/swift:nightly-5.2-bionic + - swiftlang/swift:nightly-5.3-xenial + - swiftlang/swift:nightly-5.3-bionic + - swiftlang/swift:nightly-master-xenial + - swiftlang/swift:nightly-master-bionic + - swiftlang/swift:nightly-master-focal + include: + - image: swiftlang/swift:nightly-master-centos8 + depscmd: dnf install -y zlib-devel + - image: swiftlang/swift:nightly-master-amazonlinux2 + depscmd: yum install -y zlib-devel + container: ${{ matrix.image }} steps: - - uses: actions/checkout@v2 - - run: swift test --enable-test-discovery --sanitize=thread - vapor_bionic: - container: - image: vapor/swift:5.2-bionic - runs-on: ubuntu-latest + - name: Install dependencies if needed + run: ${{ matrix.depscmd }} + - name: Check out code + uses: actions/checkout@v2 + - name: Run tests with Thread Sanitizer + run: swift test --enable-test-discovery --sanitize=thread + + macOS: + runs-on: macos-latest steps: - - uses: actions/checkout@v2 - - run: swift test --enable-test-discovery --sanitize=thread + - name: Select latest available Xcode + uses: maxim-lobanov/setup-xcode@1.0 + with: { 'xcode-version': 'latest' } + - name: Check out code + uses: actions/checkout@v2 + - name: Run tests with Thread Sanitizer + run: swift test --enable-test-discovery --sanitize=thread