-
Notifications
You must be signed in to change notification settings - Fork 1
70 lines (66 loc) · 1.89 KB
/
Copy pathswift.yml
File metadata and controls
70 lines (66 loc) · 1.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: Swift
on: [push]
jobs:
macos:
name: macOS
runs-on: macos-26
strategy:
matrix:
config: ["debug", "release"]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Swift Version
run: swift --version
- name: Build
run: swift build -c ${{ matrix.config }}
- name: Test
run: swift test -c ${{ matrix.config }}
linux:
name: Linux (${{ matrix.container }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
container: ["swift:latest", "swiftlang/swift:nightly-noble"]
config: ["debug", "release"]
container: ${{ matrix.container }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Swift Version
run: swift --version
- name: Build
run: swift build -c ${{ matrix.config }}
- name: Test
run: swift test -c ${{ matrix.config }}
coverage:
name: Code Coverage
runs-on: macos-26
permissions:
contents: read
code-quality: write # required by actions/upload-code-coverage
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Swift Version
run: swift --version
- name: Export coverage and enforce threshold
run: Scripts/coverage.sh 70
- name: Upload coverage to GitHub Code Quality
uses: actions/upload-code-coverage@v1
with:
file: .build/coverage/coverage.xml
language: Swift
label: code-coverage/llvm-cov
# Code Quality was in public preview until 2026-07-20; keep this while
# the repo might not have the feature enabled, so a failed upload
# doesn't break CI. Remove once GA is enabled everywhere.
fail-on-error: false
- name: Upload coverage artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: code-coverage
path: .build/coverage/
if-no-files-found: error