-
Notifications
You must be signed in to change notification settings - Fork 5
92 lines (76 loc) · 2.28 KB
/
test.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
name: Test
on:
push:
branches:
- master
pull_request:
jobs:
test-linux:
runs-on: ubuntu-latest
permissions:
contents: read
checks: write
steps:
- name: checkout
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- name: setup swift
uses: swift-actions/setup-swift@e1dca7c4a36344146bbc2803f0d538462477bb37 # v2.0.0
with:
swift-version: '5.10'
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: .build
key: linux-spm-${{ hashfiles('**/package.resolved') }}
restore-keys: |
spm-
- name: Run tests
run: |
swift test
test-macos:
runs-on: macos-latest
permissions:
contents: read
checks: write
strategy:
matrix:
os:
- macOS
- iOS
- watchOS
- tvOS
# XXX: visionOS is not installed on macos-latest...
# - visionOS
steps:
- name: checkout
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
with:
submodules: recursive
- name: setup swift
uses: swift-actions/setup-swift@e1dca7c4a36344146bbc2803f0d538462477bb37 # v2.0.0
with:
swift-version: '5.10'
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: .build
key: macos-spm-${{ hashfiles('**/package.resolved') }}
restore-keys: |
spm-
- name: Setup jq
uses: dcarbone/install-jq-action@8867ddb4788346d7c22b72ea2e2ffe4d514c7bcb # v2.1.0
- name: Run tests
run: |
make "test-${{ matrix.os }}"
- name: Upload Logs
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
if: always() && matrix.os != 'macos'
with:
name: "test-${{ matrix.os }}-logs"
path: |
Logs/**/*.log
build/reports/junit-*.xml
- name: Publish Test Report
uses: mikepenz/action-junit-report@9379f0ccddcab154835d4e2487555ee79614fe95 # v4.2.1
if: always() && matrix.os != 'macos'
with:
report_paths: |
build/reports/junit-*.xml