Skip to content

Commit 3301ef5

Browse files
committed
Use setup-swift GH action
1 parent 06afb49 commit 3301ef5

File tree

1 file changed

+52
-26
lines changed

1 file changed

+52
-26
lines changed

.github/workflows/build.yml

Lines changed: 52 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,39 +8,65 @@ on:
88
branches: [ master ]
99
paths-ignore: [ README.md ]
1010
workflow_dispatch:
11-
11+
1212
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"]
1620
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 }}
2024
- name: Test and publish code coverage to Code Climate
25+
if: ${{os}} == "macos-latest"
2126
uses: paulofaria/codeclimate-action@master
2227
env:
2328
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
2429
with:
2530
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
2732
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
4533
- 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

Comments
 (0)