forked from cpisciotta/xcbeautify
-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (86 loc) · 2.98 KB
/
ci.yml
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: CI
on:
push:
branches:
- main
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
compile:
name: Compile (Swift ${{ matrix.version.swift_version }}) (${{ matrix.platform }})
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
platform:
- macos-latest
- ubuntu-latest
version:
- swift_version: "5.9"
xcode_version: "15.2"
- swift_version: "5.10"
xcode_version: "15.4"
- swift_version: "6.0"
xcode_version: "16_beta_5"
exclude:
# Add Swift 6.0 to ubuntu-latest when its available via swift-actions/setup-swift
- platform: ubuntu-latest
version:
swift_version: "6.0"
env:
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.version.xcode_version }}.app/Contents/Developer
steps:
- uses: actions/checkout@v4
- name: Install Swift and Tools
if: ${{ matrix.platform == 'ubuntu-latest' }}
uses: swift-actions/setup-swift@3aed395c5397f62deb91d8fe7af1418a9ae4d16f
with:
swift-version: ${{ matrix.version.swift_version }}
- run: swift --version
- run: swift build --disable-sandbox --configuration release -Xswiftc -warnings-as-errors
test:
name: Test (Swift ${{ matrix.version.swift_version }}) (${{ matrix.platform }})
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
platform:
- macos-latest
- ubuntu-latest
version:
- swift_version: "5.9"
xcode_version: "15.2"
- swift_version: "5.10"
xcode_version: "15.4"
- swift_version: "6.0"
xcode_version: "16_beta_5"
exclude:
# Add Swift 6.0 to ubuntu-latest when its available via swift-actions/setup-swift
- platform: ubuntu-latest
version:
swift_version: "6.0"
env:
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.version.xcode_version }}.app/Contents/Developer
steps:
- uses: actions/checkout@v4
- name: Load Swift Version
run: echo "SWIFT_VERSION=$(<.swift-version)" >> $GITHUB_ENV
- name: Install Swift and Tools
if: ${{ matrix.platform == 'ubuntu-latest' }}
uses: swift-actions/setup-swift@3aed395c5397f62deb91d8fe7af1418a9ae4d16f
with:
swift-version: ${{ matrix.version.swift_version }}
- run: swift --version
- run: swift test --enable-code-coverage
- name: Prepare Code Coverage
if: ${{ matrix.version.swift_version == env.SWIFT_VERSION}}
run: ./tools/export_coverage
- name: Upload coverage reports to Codecov
if: ${{ matrix.version.swift_version == env.SWIFT_VERSION}}
uses: codecov/codecov-action@v4
with:
files: info.lcov
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}