Skip to content

Commit

Permalink
Bug/update ci Update CI to run with swift 5.5 only (#376)
Browse files Browse the repository at this point in the history
* Update test to use only 2 swift images

* Changed OS to not be a string

* change workflow to use manual testing

This commit is only for testing purposes

* Add comment to help with readability

* Change to try and run the test github action

* Remove getcidata and use only swift 5.5 for test

* Update to test

* reinstate on push branch action

* Turn json into string

* Create json seperately

* Reformat JSON

* Edit JSON

* Remove {} from JSON string

* Remove on push branch for testing
  • Loading branch information
BennyDeBock authored Feb 28, 2022
1 parent 7575fe2 commit 3526af2
Showing 1 changed file with 18 additions and 24 deletions.
42 changes: 18 additions & 24 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,12 @@
name: test
on: { pull_request: {} }

jobs:
getcidata:
runs-on: ubuntu-latest
outputs:
environments: ${{ steps.output.outputs.environments }}
steps:
- id: output
run: |
envblob="$(curl -fsSL https://raw.githubusercontent.com/vapor/ci/main/pr-environments.json | jq -cMj '.')"
echo "::set-output name=environments::${envblob}"

jobs:
test-new:
needs: getcidata
# Run the workflow on multiple machines
strategy:
fail-fast: false
# TODO: This produces 40 checks, that's too many
matrix:
fluentflags:
- --no-fluent
Expand All @@ -27,17 +17,13 @@ jobs:
leafflags:
- --leaf
- --no-leaf
env: ${{ fromJSON(needs.getcidata.outputs.environments) }}
runs-on: ${{ matrix.env.os }}
container: ${{ matrix.env.image }}
os: [ubuntu-latest]
image: ["swift:5.5-focal"]
runs-on: ${{ matrix.os }}
container: ${{ matrix.image }}
steps:
- name: Select toolchain
uses: maxim-lobanov/[email protected]
with:
xcode-version: ${{ matrix.env.toolchain }}
if: ${{ matrix.env.toolchain != '' }}
- name: Install SQLite if needed
if: ${{ contains(matrix.fluentflags, 'sqlite') && matrix.env.image != '' }}
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
Expand All @@ -52,12 +38,20 @@ jobs:
- name: Test new project
run: swift test --package-path /tmp/toolbox-test --enable-test-discovery

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.2-focal\", \"toolchain\":null},{\"os\":\"ubuntu-latest\", \"image\":\"swift:5.5-focal\", \"toolchain\":null},{\"os\":\"macos-11\", \"image\":null, \"toolchain\":\"latest\"}]"

test-toolbox:
needs: getcidata
needs: createJSON
strategy:
fail-fast: false
matrix:
env: ${{ fromJSON(needs.getcidata.outputs.environments) }}
env: ${{ fromJSON(needs.createJSON.outputs.environments) }}
runs-on: ${{ matrix.env.os }}
container: ${{ matrix.env.image }}
steps:
Expand Down

0 comments on commit 3526af2

Please sign in to comment.