Skip to content

Commit

Permalink
New works-for-everything CI (#2365)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
gwynne committed May 26, 2020
1 parent 74bbf36 commit 1a04e4e
Showing 1 changed file with 44 additions and 20 deletions.
64 changes: 44 additions & 20 deletions .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

0 comments on commit 1a04e4e

Please sign in to comment.