Skip to content

Commit

Permalink
Cleanup CI workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
gwynne committed Jul 18, 2023
1 parent 4ca84bd commit 510022c
Showing 1 changed file with 38 additions and 38 deletions.
76 changes: 38 additions & 38 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
name: test
on: { pull_request: {} }
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
pull_request: { types: [opened, reopened, synchronize, ready_for_review] }
push: { branches: [ main ] }
env:
LOG_LEVEL: info
SWIFT_DETERMINISTIC_HASHING: 1


jobs:
test-new:
# Run the workflow on multiple machines
jobs:
integration-linux:
strategy:
fail-fast: false
matrix:
Expand All @@ -14,21 +20,14 @@ jobs:
- --fluent.db postgres
- --fluent.db sqlite
- --fluent.db mongo
leafflags:
- --leaf
- --no-leaf
os: [ubuntu-latest]
image: ["swift:5.8-focal"]
runs-on: ${{ matrix.os }}
container: ${{ matrix.image }}
leafflags: [--leaf, --no-leaf]
runs-on: ubuntu-latest
container: swift-5.8-jammy
steps:
- name: Install SQLite if needed
if: ${{ contains(matrix.fluentflags, 'sqlite') }}
run: apt-get -q update && apt-get -q install -y libsqlite3-dev
- name: Check out toolbox
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Build toolbox
run: swift build -c debug
run: swift build
- name: Execute new project command
run: |
swift run \
Expand All @@ -38,30 +37,31 @@ jobs:
- name: Test new project
run: swift test --package-path /tmp/toolbox-test

createJSON:
runs-on: ubuntu-latest
outputs:
environments: ${{ steps.output.outputs.environments }}
steps:
- id: output
run: echo "::set-output name=environments::[{\"os\":\"ubuntu-latest\", \"image\":\"swift:5.6-focal\", \"toolchain\":null},{\"os\":\"ubuntu-latest\", \"image\":\"swift:5.8-focal\", \"toolchain\":null},{\"os\":\"macos-13\", \"image\":null, \"toolchain\":\"latest\"}]"

test-toolbox:
needs: createJSON
integration-macos:
strategy:
fail-fast: false
matrix:
env: ${{ fromJSON(needs.createJSON.outputs.environments) }}
runs-on: ${{ matrix.env.os }}
container: ${{ matrix.env.image }}
fluentflags:
- --no-fluent
- --fluent.db mysql
- --fluent.db postgres
- --fluent.db sqlite
- --fluent.db mongo
leafflags: [--leaf, --no-leaf]
runs-on: macos-13
steps:
- name: Select toolchain
uses: maxim-lobanov/setup-xcode@v1.2.1
with:
xcode-version: ${{ matrix.env.toolchain }}
if: ${{ matrix.env.toolchain != '' }}
uses: maxim-lobanov/setup-xcode@v1
with: { xcode-version: latest-stable }
- name: Check out toolbox
uses: actions/checkout@v2
- name: Run tests with Thread Sanitizer
timeout-minutes: 20
run: swift test --sanitize=thread
uses: actions/checkout@v3
- name: Build toolbox
run: swift build
- name: Execute new project command
run: |
swift run \
vapor new toolbox-test \
--no-commit -o /tmp/toolbox-test \
${{ matrix.fluentflags }} ${{ matrix.leafflags }}
- name: Test new project
run: swift test --package-path /tmp/toolbox-test

0 comments on commit 510022c

Please sign in to comment.