-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (95 loc) · 3.01 KB
/
Copy pathci.yml
File metadata and controls
99 lines (95 loc) · 3.01 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# CI Matrix Policy
#
# Category A (tools-version 6.2 + macOS 26 min): macos-26 + Swift 6.2
# Category B (tools-version 6.2 + older macOS): macos-15 + 6.2, macos-26 + 6.2
# Category C (tools-version 6.3): macos-15 + 6.3, macos-26 + 6.3
# Linux: ubuntu + Swift 6.3
#
# This package is Category A, plus a Linux leg. Test names are raw
# identifiers (SE-0451), so a leg must be on Swift 6.2 or newer to run `swift test`;
# a leg on an older compiler is limited to `swift build -v`.
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
tests:
name: Build and Test
strategy:
fail-fast: false
matrix:
include:
- os: macos-26
swift: "6.2"
- os: macos-26
swift: "6.4"
- os: ubuntu-latest
swift: "6.3"
- os: ubuntu-latest
swift: "6.4"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
- uses: SwiftyLab/setup-swift@latest
with:
swift-version: ${{ matrix.swift }}
- name: Cache SwiftPM build products
uses: actions/cache@v6
with:
path: |
.build
~/.cache/org.swift.swiftpm
~/Library/Caches/org.swift.swiftpm
key: swiftpm-test-${{ matrix.os }}-swift${{ matrix.swift }}-${{ hashFiles('Package.resolved') }}
- name: Build
run: swift build -v
- name: Test
run: swift test -v
docs:
name: Build Documentation
runs-on: macos-26
steps:
- uses: actions/checkout@v6
- uses: SwiftyLab/setup-swift@latest
with:
swift-version: "6.2"
- name: Cache SwiftPM build products
uses: actions/cache@v6
with:
path: |
.build
~/.cache/org.swift.swiftpm
~/Library/Caches/org.swift.swiftpm
key: swiftpm-docs-macos-26-swift6.2-${{ hashFiles('Package.resolved') }}
- name: Build documentation
run: |
swift package \
--allow-writing-to-directory "$RUNNER_TEMP/docs" \
generate-documentation --target SwiftDOF --output-path "$RUNNER_TEMP/docs" \
--warnings-as-errors
lint:
name: Run SwiftLint
runs-on: ubuntu-latest
container: ghcr.io/realm/swiftlint:latest
steps:
- uses: actions/checkout@v6
- name: Run SwiftLint
run: swiftlint --strict
swift-format:
name: Run swift-format
runs-on: ubuntu-latest
container:
image: swift:latest
steps:
- uses: actions/checkout@v6
- name: Download .swift-format config
run: |
apt-get update && apt-get install -y wget
wget -O .swift-format https://gist.githubusercontent.com/RISCfuture/e0c21afb7bd80a88d128a42bf40d2ecd/raw/.swift-format
- name: Run swift-format lint
run: swift format lint --strict -r .