Repository navigation
76 lines (70 loc) · 2.66 KB
/
Copy pathCI.yml
File metadata and controls
76 lines (70 loc) · 2.66 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
name: CI
on:
push:
branches:
- development
paths:
- '.github/workflows/CI.yml'
- '.swiftlint.yml'
- '**/*.swift'
pull_request:
paths:
- '.github/workflows/CI.yml'
- '.swiftlint.yml'
- '**/*.swift'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
SwiftLint:
runs-on: ubuntu-latest
container: ghcr.io/realm/swiftlint:0.62.1
steps:
- uses: actions/checkout@v5
- run: swiftlint lint --strict
Xcode:
name: Xcode ${{ matrix.xcode }}
strategy:
fail-fast: false
matrix:
include:
# Oldest supported toolchain and latest point release per Xcode generation.
- { runner: macos-15, xcode: '16.0' } # Swift 6.0
- { runner: macos-15, xcode: '16.4' } # Swift 6.1
- { runner: macos-26, xcode: '26.0.1' } # Swift 6.2
- { runner: macos-26, xcode: '26.6' } # Swift 6.3
- { runner: xcode-27, xcode: '27.0' } # Swift 6.4
runs-on: ${{ matrix.runner }}
env:
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app
steps:
- uses: actions/checkout@v5
- run: swift -version
- run: swift test -c release -Xswiftc -enable-testing
Linux:
name: Swift ${{ matrix.tag }} (${{ matrix.runner }})
strategy:
fail-fast: false
matrix:
tag: ['5.10', '6.0', '6.2', '6.3']
runner: [ubuntu-latest]
include:
- { tag: '6.3', runner: ubuntu-24.04-arm }
runs-on: ${{ matrix.runner }}
container:
image: swift:${{ matrix.tag }}
steps:
- uses: actions/checkout@v5
- run: swift -version
- run: swift test -c release -Xswiftc -enable-testing
Coverage:
runs-on: macos-26
env:
DEVELOPER_DIR: /Applications/Xcode_26.6.app
steps:
- uses: actions/checkout@v5
- run: swift test -c release -Xswiftc -enable-testing --enable-code-coverage
- run: find .build/release/codecov/ -name "*.profraw" -print0 | xargs -0 xcrun llvm-profdata merge -sparse -o .build/release/codecov/default.profdata
- run: xcrun llvm-cov export -summary-only -ignore-filename-regex 'ZIPFoundationTests|resource_bundle_accessor.swift|runner.swift|.*Deprecated.*$' .build/release/ZIPFoundationPackageTests.xctest/Contents/MacOS/ZIPFoundationPackageTests -instr-profile .build/release/codecov/default.profdata > .build/coverage.json
- run: (cat .build/coverage.json|jq '.data[0]["totals"]["lines"]["percent"]' | grep -Eq "100") && { exit 0; } || { echo 'Please make sure that the test suite covers all framework code paths.'; exit 1; }