@@ -23,50 +23,64 @@ jobs:
23
23
- name : Run format linting
24
24
run : docker run --rm -v ${{ github.workspace }}:/repo ghcr.io/nicklockwood/swiftformat:latest /repo --lint
25
25
26
- # Disabled until https://github.com/paulofaria/test-reporter is updated to Swift 5.4
27
26
macos :
28
- name : Build and test on macOS
27
+ name : Test on macOS
29
28
runs-on : macOS-latest
30
29
steps :
31
- - uses : actions/checkout@v2
32
- - name : Set code coverage path
33
- run : echo "codecov_path=$(swift test --show-codecov-path)" >> $GITHUB_ENV
34
- - name : Test and publish code coverage to Code Climate
35
- uses : paulofaria/codeclimate-action@master
36
- env :
37
- CC_TEST_REPORTER_ID : ${{secrets.CC_TEST_REPORTER_ID}}
30
+ - uses : maxim-lobanov/setup-xcode@v1
38
31
with :
39
- downloadUrl : https://github.com/paulofaria/test-reporter/releases/download/0.9.0/test-reporter-0.9.0-darwin-amd64
40
- coverageCommand : swift test --enable-test-discovery --enable-code-coverage
41
- coverageLocations : ${{ env.codecov_path }}:lcov-json
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 :
41
+ - uses : swift-actions/setup-swift@v1
42
+ - uses : actions/checkout@v3
43
+ - name : 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)/GraphitiPackageTests.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
42
58
43
- # 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/
44
- ubuntu-old :
45
- name : Build ${{ matrix.swift }} on ${{ matrix.os }}
46
- 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
47
62
strategy :
48
63
matrix :
49
- os : [ubuntu-20.04]
50
- swift : ["5.4", "5.5", "5.6"]
64
+ swift : ["5.7"]
51
65
steps :
52
66
- uses : swift-actions/setup-swift@v1
53
67
with :
54
68
swift-version : ${{ matrix.swift }}
55
69
- uses : actions/checkout@v3
56
70
- name : Test
57
- run : swift test
71
+ run : swift test --parallel
58
72
59
- ubuntu-latest :
60
- name : Build ${{ matrix.swift }} on ${{ matrix.os }}
61
- runs-on : ${{ matrix.os }}
73
+ # Swift versions older than 5.7 don't have builds for ubuntu 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
62
77
strategy :
63
78
matrix :
64
- os : [ubuntu-latest]
65
- swift : ["5.7"]
79
+ swift : ["5.4", "5.5", "5.6"]
66
80
steps :
67
81
- uses : swift-actions/setup-swift@v1
68
82
with :
69
83
swift-version : ${{ matrix.swift }}
70
84
- uses : actions/checkout@v3
71
85
- name : Test
72
- run : swift test
86
+ run : swift test --parallel
0 commit comments