11
11
12
12
jobs :
13
13
formatlint :
14
- name : Lint for correct formatting
14
+ name : Format linting
15
15
runs-on : ubuntu-latest
16
16
steps :
17
17
- name : Checkout
@@ -24,41 +24,63 @@ jobs:
24
24
run : docker run --rm -v ${{ github.workspace }}:/repo ghcr.io/nicklockwood/swiftformat:latest /repo --lint
25
25
26
26
macos :
27
- name : Build and test on macos-latest
27
+ name : Test on macOS
28
28
runs-on : macos-latest
29
29
steps :
30
+ - uses : maxim-lobanov/setup-xcode@v1
31
+ with :
32
+ xcode-version : latest
33
+ - uses : actions/checkout@v3
34
+ - name : Build and test
35
+ run : swift test --parallel --enable-test-discovery
36
+
37
+ linux :
38
+ name : Test on Linux
39
+ runs-on : ubuntu-latest
40
+ steps :
30
41
- uses : swift-actions/setup-swift@v1
31
42
- uses : actions/checkout@v3
32
43
- name : Test
33
- run : swift test
44
+ run : swift test --parallel --enable-code-coverage
45
+ - name : Get test coverage html
46
+ run : |
47
+ llvm-cov show \
48
+ $(swift build --show-bin-path)/GraphQLPackageTests.xctest \
49
+ --instr-profile $(swift build --show-bin-path)/codecov/default.profdata \
50
+ --ignore-filename-regex="\.build|Tests" \
51
+ --format html \
52
+ --output-dir=.test-coverage
53
+ - name : Upload test coverage html
54
+ uses : actions/upload-artifact@v3
55
+ with :
56
+ name : test-coverage-report
57
+ path : .test-coverage
34
58
35
- # ubuntu-latest is ubuntu-22.04 currently. Swift versions older than 5.7 don't have builds for 22.04. https://www.swift.org/download/
36
- ubuntu-old :
37
- name : Build ${{ matrix.swift }} on ${{ matrix.os }}
38
- runs-on : ${{ matrix.os }}
59
+ backcompat-ubuntu-22_04 :
60
+ name : Test Swift ${{ matrix.swift }} on Ubuntu 22.04
61
+ runs-on : ubuntu-22.04
39
62
strategy :
40
63
matrix :
41
- os : [ubuntu-20.04]
42
- swift : ["5.5", "5.6"]
64
+ swift : ["5.7", "5.8"]
43
65
steps :
44
66
- uses : swift-actions/setup-swift@v1
45
67
with :
46
68
swift-version : ${{ matrix.swift }}
47
69
- uses : actions/checkout@v3
48
70
- name : Test
49
- run : swift test
71
+ run : swift test --parallel
50
72
51
- ubuntu-latest :
52
- name : Build ${{ matrix.swift }} on ${{ matrix.os }}
53
- runs-on : ${{ matrix.os }}
73
+ # Swift versions older than 5.7 don't have builds for 22.04. https://www.swift.org/download/
74
+ backcompat-ubuntu-20_04 :
75
+ name : Test Swift ${{ matrix.swift }} on Ubuntu 20.04
76
+ runs-on : ubuntu-20.04
54
77
strategy :
55
78
matrix :
56
- os : [ubuntu-latest]
57
- swift : ["5.7", "5.8", "5.9"]
79
+ swift : ["5.5", "5.6"]
58
80
steps :
59
81
- uses : swift-actions/setup-swift@v1
60
82
with :
61
83
swift-version : ${{ matrix.swift }}
62
84
- uses : actions/checkout@v3
63
85
- name : Test
64
- run : swift test
86
+ run : swift test --parallel
0 commit comments