-
-
Notifications
You must be signed in to change notification settings - Fork 3
106 lines (99 loc) · 3.59 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: CI
on:
push:
branches:
- main
pull_request:
jobs:
xcodebuild-15:
name: Build with xcodebuild on Xcode 15
runs-on: macos-14
strategy:
matrix:
platforms: [
'generic/platform=ios',
'platform=macos',
'generic/platform=tvos',
'generic/platform=watchos',
'generic/platform=visionos'
]
fail-fast: false
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Select Xcode Version
run: sudo xcode-select --switch /Applications/Xcode_15.2.app/Contents/Developer
- name: Build Framework
run: xcrun xcodebuild -skipMacroValidation -skipPackagePluginValidation build -scheme SafeDI-Package -destination ${{ matrix.platforms }}
spm-package-integration-15:
name: Build Package Integration on Xcode 15
runs-on: macos-14
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Select Xcode Version
run: sudo xcode-select --switch /Applications/Xcode_15.2.app/Contents/Developer
- name: Build Package Integration
run: xcrun swift build -c release --package-path Examples/ExamplePackageIntegration
spm-project-integration-15:
name: Build Project Integration on Xcode 15
runs-on: macos-14
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Select Xcode Version
run: sudo xcode-select --switch /Applications/Xcode_15.2.app/Contents/Developer
- name: Build Project Integration
run: pushd Examples/ExampleProjectIntegration; xcrun xcodebuild build -skipPackagePluginValidation -skipMacroValidation -scheme ExampleProjectIntegration; popd
spm-15:
name: Build and Test on Xcode 15
runs-on: macos-14
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Select Xcode Version
run: sudo xcode-select --switch /Applications/Xcode_15.2.app/Contents/Developer
- name: Build and Test Framework
run: xcrun swift test -c release --enable-code-coverage -Xswiftc -enable-testing
- name: Prepare Coverage Reports
run: ./Scripts/prepare-coverage-reports.sh
- name: Upload Coverage Reports
if: success()
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
verbose: true
os: macos
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
linux:
name: Build and Test on Linux
runs-on: ubuntu-latest
container: swift:5.9
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Build and Test Framework
run: swift test -c release --enable-code-coverage -Xswiftc -enable-testing
- name: Setup repo root for Codecov
run: git config --global --add safe.directory "$GITHUB_WORKSPACE" # See https://github.com/codecov/feedback/issues/263
- name: Prepare Coverage Reports
run: |
llvm-cov export -format="lcov" .build/x86_64-unknown-linux-gnu/release/SafeDIPackageTests.xctest -instr-profile .build/x86_64-unknown-linux-gnu/release/codecov/default.profdata > coverage.lcov
- name: Upload Coverage Reports
if: success()
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
verbose: true
os: linux
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
readme-validation:
name: Check Markdown links
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Validate Markdown
uses: gaurav-nelson/github-action-markdown-link-check@v1