-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (46 loc) · 1.17 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
name: Test
on:
workflow_call:
push:
branches: [ main ]
paths:
- '.github/workflows/test.yml'
- '**.swift'
- 'Package.resolved'
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
paths:
- '.github/workflows/test.yml'
- '**.swift'
- 'Package.resolved'
jobs:
test:
name: Run Tests
runs-on: macos-latest
if: github.event.pull_request.draft == false
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cache dependencies
uses: actions/cache@v4
with:
path: .build
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
restore-keys: |
${{ runner.os }}-spm-
- name: Build
run: swift build -v
- name: Run tests
# Need to use `--parallel` to generate the report: https://github.com/apple/swift-package-manager/issues/4752
run: swift test --xunit-output report.xml --parallel --num-workers=1
- name: Report
if: success() || failure()
uses: dorny/test-reporter@v1
with:
name: Report Results
path: report.xml
reporter: java-junit