|
8 | 8 | branches: [ master ]
|
9 | 9 | paths-ignore: [ README.md ]
|
10 | 10 | workflow_dispatch:
|
11 |
| - |
| 11 | + |
12 | 12 | jobs:
|
13 |
| - macos: |
14 |
| - name: Build and test on macos-latest |
15 |
| - runs-on: macOS-latest |
| 13 | + build: |
| 14 | + name: Build ${{ matrix.swift }} on ${{ matrix.os }} |
| 15 | + runs-on: ${{ matrix.os }} |
| 16 | + strategy: |
| 17 | + matrix: |
| 18 | + os: [ubuntu-latest, macos-latest] |
| 19 | + swift: ["5.4", "5.5", "5.6"] |
16 | 20 | steps:
|
17 |
| - - uses: actions/checkout@v2 |
18 |
| - - name: Set code coverage path |
19 |
| - run: echo "codecov_path=$(swift test --show-codecov-path)" >> $GITHUB_ENV |
| 21 | + - uses: swift-actions/setup-swift@v1 |
| 22 | + with: |
| 23 | + swift-version: ${{ matrix.swift }} |
20 | 24 | - name: Test and publish code coverage to Code Climate
|
| 25 | + if: ${{os}} == "macos-latest" |
21 | 26 | uses: paulofaria/codeclimate-action@master
|
22 | 27 | env:
|
23 | 28 | CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
|
24 | 29 | with:
|
25 | 30 | downloadUrl: https://github.com/paulofaria/test-reporter/releases/download/0.9.0/test-reporter-0.9.0-darwin-amd64
|
26 |
| - coverageCommand: swift test --enable-test-discovery --enable-code-coverage |
| 31 | + coverageCommand: swift test --enable-code-coverage |
27 | 32 | coverageLocations: ${{ env.codecov_path }}:lcov-json
|
28 |
| - |
29 |
| - linux: |
30 |
| - name: Build and test on ${{ matrix.tag }}-${{ matrix.os }} |
31 |
| - runs-on: ubuntu-latest |
32 |
| - strategy: |
33 |
| - matrix: |
34 |
| - os: |
35 |
| - - focal |
36 |
| - - bionic |
37 |
| - tag: |
38 |
| - - swift:5.3 |
39 |
| - - swift:5.4 |
40 |
| - container: |
41 |
| - image: ${{ matrix.tag }}-${{ matrix.os }} |
42 |
| - steps: |
43 |
| - - name: Checkout |
44 |
| - uses: actions/checkout@v2 |
45 | 33 | - name: Test
|
46 |
| - run: swift test --enable-test-discovery --sanitize=thread |
| 34 | + if: ${{os}} != "macos-latest" |
| 35 | + run: swift test |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | +# macos: |
| 40 | +# name: Build and test on macos-latest |
| 41 | +# runs-on: macOS-latest |
| 42 | +# steps: |
| 43 | +# - uses: actions/checkout@v2 |
| 44 | +# - name: Set code coverage path |
| 45 | +# run: echo "codecov_path=$(swift test --show-codecov-path)" >> $GITHUB_ENV |
| 46 | +# - name: Test and publish code coverage to Code Climate |
| 47 | +# uses: paulofaria/codeclimate-action@master |
| 48 | +# env: |
| 49 | +# CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}} |
| 50 | +# with: |
| 51 | +# downloadUrl: https://github.com/paulofaria/test-reporter/releases/download/0.9.0/test-reporter-0.9.0-darwin-amd64 |
| 52 | +# coverageCommand: swift test --enable-test-discovery --enable-code-coverage |
| 53 | +# coverageLocations: ${{ env.codecov_path }}:lcov-json |
| 54 | + |
| 55 | +# linux: |
| 56 | +# name: Build and test on ${{ matrix.tag }}-${{ matrix.os }} |
| 57 | +# runs-on: ubuntu-latest |
| 58 | +# strategy: |
| 59 | +# matrix: |
| 60 | +# os: |
| 61 | +# - focal |
| 62 | +# - bionic |
| 63 | +# tag: |
| 64 | +# - swift:5.3 |
| 65 | +# - swift:5.4 |
| 66 | +# container: |
| 67 | +# image: ${{ matrix.tag }}-${{ matrix.os }} |
| 68 | +# steps: |
| 69 | +# - name: Checkout |
| 70 | +# uses: actions/checkout@v2 |
| 71 | +# - name: Test |
| 72 | +# run: swift test --enable-test-discovery --enable-code-coverage --sanitize=thread |
0 commit comments