11name : CI
2- on : pull_request
2+ on :
3+ pull_request :
4+ paths :
5+ - ' **/*.swift'
6+ - .github/workflows/ci.yml
7+ schedule :
8+ - cron : ' 3 3 * * 5' # 3:03 AM, every Friday
39jobs :
410 smoke :
511 runs-on : macos-latest
1016 - run : git diff --exit-code
1117
1218 apple :
13- runs-on : macos-latest
19+ runs-on : macos-10.15
1420 strategy :
1521 matrix :
1622 destination :
@@ -34,50 +40,46 @@ jobs:
3440 - uses : codecov/codecov-action@v1
3541
3642 linux-swift-4 :
37- name : linux (4.2)
38- runs-on : ubuntu-18.04
43+ name : linux (${{ matrix.swift }})
44+ runs-on : ubuntu-latest
45+ strategy :
46+ matrix :
47+ swift : ['4.2', '5.0']
48+ container :
49+ image : swift:${{ matrix.swift }}
3950 steps :
40- - uses : fwal/setup-swift@v1
41- with :
42- swift-version : 4.2
4351 - uses : actions/checkout@v2
44- - run : swift test --parallel
52+ - run : useradd -ms /bin/bash mxcl
53+ - run : chown -R mxcl .
54+ - run : su mxcl -c 'swift test --parallel'
4555
4656 linux :
47- runs-on : ubuntu-18.04
57+ runs-on : ubuntu-latest
4858 strategy :
4959 matrix :
5060 swift :
51- - ' 5.0'
5261 - ' 5.1'
5362 - ' 5.2'
5463 - ' 5.3'
64+ - ' 5.4'
65+ container :
66+ image : swift:${{ matrix.swift }}
5567 steps :
56- - uses : fwal/setup-swift@v1
57- with :
58- swift-version : ${{ matrix.swift }}
5968 - uses : actions/checkout@v2
60- - run : swift test --parallel --enable-code-coverage
61- - name : Generate Coverage Report
69+ - run : useradd -ms /bin/bash mxcl
70+ # ^^ we need to be a normal user and not root for the tests to be valid
71+ - run : chown -R mxcl .
72+ - run : su mxcl -c 'swift test --parallel --enable-code-coverage'
73+ - name : Generate `.lcov`
6274 run : |
63- sudo apt-get -qq update && sudo apt-get -qq install llvm-10
64- export b=$(swift build --show-bin-path) && llvm-cov-10 \
65- export -format lcov \
66- -instr-profile=$b/codecov/default.profdata \
67- --ignore-filename-regex='\.build/' \
68- $b/Path.swiftPackageTests.xctest \
75+ apt-get -qq update && apt-get -qq install curl
76+ b=$(swift build --show-bin-path)
77+ llvm-cov export \
78+ -format lcov \
79+ -instr-profile="$b"/codecov/default.profdata \
80+ --ignore-filename-regex='\.build|Tests' \
81+ "$b"/*.xctest \
6982 > info.lcov
7083 - uses : codecov/codecov-action@v1
7184 with :
7285 file : ./info.lcov
73-
74- # code coverage fails with 5.4 for some reason
75- linux-swift-5-4 :
76- name : linux (5.4)
77- runs-on : ubuntu-18.04
78- steps :
79- - uses : fwal/setup-swift@v1
80- with :
81- swift-version : 5.4
82- - uses : actions/checkout@v2
83- - run : swift test --parallel
0 commit comments