forked from rarestype/swift-json
-
Notifications
You must be signed in to change notification settings - Fork 0
148 lines (127 loc) · 4.75 KB
/
Tests.yml
File metadata and controls
148 lines (127 loc) · 4.75 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
name: Tests
permissions:
contents: write
pull-requests: write
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
changes:
runs-on: ubuntu-latest
name: Assess changes
steps:
- name: 💖 Checkout repository 💖
uses: actions/checkout@v6
- name: 💖 Decide checks 💖
uses: tj-actions/changed-files@v47
id: changes
with:
files_ignore: |
README.md
LICENSE
NOTICE
.mailmap
.gitignore
.github/FUNDING.yml
outputs:
code_changed: ${{ steps.changes.outputs.any_changed }}
Linux:
runs-on: ubuntu-24.04
name: Ubuntu 24.04
needs: changes
if: needs.changes.outputs.code_changed == 'true'
steps:
- name: 💖 Install Swift 💖
uses: rarestype/swift-install-action@v1
with:
swift-release: 6.3-RELEASE
- name: 💖 Checkout repository 💖
uses: actions/checkout@v6
- name: 💖 Run tests 💖
run: Scripts/TestAll
- name: 💖 Update badge 💖
uses: rarestype/rarestbadge@v1
if: always()
macOS:
runs-on: macos-26
needs: changes
if: needs.changes.outputs.code_changed == 'true'
steps:
- name: 💖 Checkout repository 💖
uses: actions/checkout@v6
- name: 💖 Select Xcode 26.4 💖
run: sudo xcode-select -s /Applications/Xcode_26.4.app/Contents/Developer
- name: 💖 Run tests 💖
run: Scripts/TestAll
- name: 💖 Update badge 💖
uses: rarestype/rarestbadge@v1
if: always()
macOS-devices:
strategy:
matrix:
destination: [iOS, tvOS, visionOS, watchOS]
needs: changes
if: needs.changes.outputs.code_changed == 'true'
name: ${{ matrix.destination }}
uses: rarestype/swift-device-action/.github/workflows/build.yml@v1
with:
xcode-scheme: 'swift-json-Package'
destination: ${{ matrix.destination }}
badge-namespace: ${{ github.workflow }}
benchmarks:
strategy:
matrix:
runner:
- id: ubuntu-24.04
arch: x86_64
- id: ubuntu-24.04-arm
arch: aarch64
runs-on: ${{ matrix.runner.id }}
name: Benchmark (${{ matrix.runner.arch }})
needs: changes
if: needs.changes.outputs.code_changed == 'true' && github.event_name == 'pull_request'
steps:
- name: 🩵 Install Swift 🩵
uses: rarestype/swift-install-action@v1
with:
swift-release: 6.3-RELEASE
- name: 🩵 Checkout repository 🩵
uses: actions/checkout@v6
- name: 🩵 Run benchmarks 🩵
run: Scripts/Benchmark
- name: 🩵 Upload benchmark timings 🩵
uses: actions/upload-artifact@v7
with:
name: timings-${{ matrix.runner.arch }}
path: '*.duration'
retention-days: 1
compression-level: 0
benchmarks-collate:
runs-on: ubuntu-latest
name: Benchmark
needs: benchmarks
steps:
- name: 🩵 Download benchmark timing (x86_64) 🩵
uses: actions/download-artifact@v8
- name: 🩵 Generate notes 🩵
run: |
ls -l .
summary=$(
echo "| architecture | subject | benchmark duration |"
echo "| ------------ | ------- | ------------------ |"
for arch in x86_64 aarch64; do
for id in "Swift.symbols.json"; do
timing="timings-${arch}/${id}.duration"
echo "| ${arch} | ${id} | $(cat "$timing") |"
done
done
)
echo "$summary" >> "$GITHUB_STEP_SUMMARY"
echo "$summary" >> "summary_benchmark.md"
- name: 🩵 Publish PR comment 🩵
uses: marocchino/sticky-pull-request-comment@v3
with:
header: benchmark-results
path: summary_benchmark.md