-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (81 loc) · 2.5 KB
/
test.yml
File metadata and controls
94 lines (81 loc) · 2.5 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
# CI for swift-sdk (ARCP).
#
# Action pinning policy:
# - First-party actions (actions/*) are pinned to a major version tag.
# - Third-party actions are pinned to a full commit SHA with a version comment.
#
# Platforms: macOS only (Package.swift declares .macOS(.v14); no Linux platform).
# Swift matrix: 6.1 — floor declared by `// swift-tools-version: 6.1`. The full
# ecosystem (swift-nio, swift-log, swift-certificates, swift-crypto) now
# requires 6.1+, so the previous 6.0 entry no longer resolves.
name: test
on:
push:
branches: [main]
paths-ignore:
- "**.md"
- "docs/**"
- "LICENSE"
- ".gitignore"
- ".editorconfig"
pull_request:
branches: [main]
paths-ignore:
- "**.md"
- "docs/**"
- "LICENSE"
- ".gitignore"
- ".editorconfig"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions:
contents: read
jobs:
test:
name: swift ${{ matrix.swift }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest]
swift: ["6.1"]
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 1
- name: Set up Swift ${{ matrix.swift }}
# SwiftyLab/setup-swift v1.14.0
uses: SwiftyLab/setup-swift@38f54a76b70d989321de9dc7c840618c08cf56e9
with:
swift-version: ${{ matrix.swift }}
- name: Print Swift version
run: swift --version
- name: Cache .build
uses: actions/cache@v5
with:
path: .build
key: ${{ runner.os }}-swift-${{ matrix.swift }}-spm-${{ hashFiles('Package.resolved') }}
restore-keys: |
${{ runner.os }}-swift-${{ matrix.swift }}-spm-
- name: Resolve dependencies
run: swift package resolve
- name: Lint (swift-format)
run: swift run swift-format lint --recursive --strict Sources Tests
- name: Build
run: swift build --build-tests
- name: Test
run: swift test --skip-build
- name: Upload test artifacts on failure
if: failure()
uses: actions/upload-artifact@v7
with:
name: test-artifacts-swift-${{ matrix.swift }}-${{ matrix.os }}
path: |
.build/**/*.xctest
.build/**/*.log
.build/debug/codecov/**
if-no-files-found: ignore
retention-days: 7