-
-
Notifications
You must be signed in to change notification settings - Fork 4
134 lines (125 loc) · 5.04 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
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.3.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.3.app/Contents/Developer
- name: Build Package Integration
run: xcrun swift build --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.3.app/Contents/Developer
- name: Replace 'main' branch with the current branch
if: github.event.pull_request.head.repo.full_name == github.repository # Only do this if the branch is from our repo.
run: sed -i '' "s#branch = main;#branch = ${{ github.head_ref || github.ref_name }};#" "Examples/ExampleProjectIntegration/ExampleProjectIntegration.xcodeproj/project.pbxproj"
- name: Build Project Integration
run: pushd Examples/ExampleProjectIntegration; xcrun xcodebuild build -skipPackagePluginValidation -skipMacroValidation -scheme ExampleProjectIntegration; popd
spm-multi-project-integration-15:
name: Build Multi 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.3.app/Contents/Developer
- name: Replace 'main' branch with the current branch
if: github.event.pull_request.head.repo.full_name == github.repository # Only do this if the branch is from our repo.
run: sed -i '' "s#branch = main;#branch = ${{ github.head_ref || github.ref_name }};#" "Examples/ExampleMultiProjectIntegration/ExampleMultiProjectIntegration.xcodeproj/project.pbxproj"
- name: Build Project Integration
run: pushd Examples/ExampleMultiProjectIntegration; xcrun xcodebuild build -skipPackagePluginValidation -skipMacroValidation -scheme ExampleMultiProjectIntegration; 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.3.app/Contents/Developer
- name: Build and Test Framework
run: |
for i in {1..5}; do # Run tests a few times to ensure code-gen is stable.
xcrun swift test -c release --enable-code-coverage -Xswiftc -enable-testing
done
- 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.10
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: 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
lint-swift:
name: Lint Swift
runs-on: ubuntu-latest
container: swift:5.10
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Lint Swift
run: swift run --package-path CLI swiftformat --swiftversion 5.10 . --lint