-
Notifications
You must be signed in to change notification settings - Fork 4
83 lines (76 loc) · 2.42 KB
/
ci.yml
File metadata and controls
83 lines (76 loc) · 2.42 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
71
72
73
74
75
76
77
78
79
80
81
82
83
name: CI
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
lint:
runs-on: macos-26
timeout-minutes: 20
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Install Mint
run: brew install mint
- uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
with:
path: ~/.mint
key: mint-${{ hashFiles('Mintfile') }}
restore-keys: mint-
- name: Bootstrap tools
run: mint bootstrap
- name: SwiftFormat
run: mint run swiftformat --lint .
- name: SwiftLint
run: mint run swiftlint --strict
test-macos:
runs-on: macos-26
timeout-minutes: 30
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
with:
path: .build
key: macos-spm-${{ hashFiles('Package.resolved', 'Package.swift') }}
restore-keys: macos-spm-
- name: Run tests
run: swift test --parallel -Xswiftc -warnings-as-errors
docs:
runs-on: macos-26
timeout-minutes: 20
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
with:
path: .build
key: macos-docs-spm-${{ hashFiles('Package.resolved', 'Package.swift') }}
restore-keys: macos-docs-spm-
- name: Generate documentation
run: make docs
check:
if: always()
needs: [lint, test-macos, docs]
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Verify all jobs passed
run: |
if [[ "${{ needs.lint.result }}" != "success" || \
"${{ needs.test-macos.result }}" != "success" || \
"${{ needs.docs.result }}" != "success" ]]; then
echo "Required jobs failed:"
echo " lint: ${{ needs.lint.result }}"
echo " test-macos: ${{ needs.test-macos.result }}"
echo " docs: ${{ needs.docs.result }}"
exit 1
fi