-
Notifications
You must be signed in to change notification settings - Fork 17
219 lines (198 loc) · 7.33 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
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
name: Self-test
on:
push:
pull_request:
jobs:
test:
name: Test
strategy:
fail-fast: false
matrix:
platform:
- platform_name: FreeBSD-x86_64
os: ubuntu-20.04
target: x86_64-unknown-freebsd
expect_file_re: "x86-64.+FreeBSD"
expect_cross: "--expect-cross"
expect_stripped: "--no-expect-stripped"
can_test: false
- platform_name: Linux-x86_64
os: ubuntu-20.04
target: x86_64-unknown-linux-musl
expect_file_re: "ELF.+x86-64"
expect_cross: "--no-expect-cross"
expect_stripped: "--expect-stripped"
can_test: true
- platform_name: Linux-aarch64
os: ubuntu-20.04
target: aarch64-unknown-linux-musl
expect_file_re: "aarch64"
expect_cross: "--expect-cross"
expect_stripped: "--no-expect-stripped"
can_test: true
- platform_name: Linux-aarch64-with-cross-v0.2.3
os: ubuntu-20.04
target: aarch64-unknown-linux-musl
cross-version: "v0.2.3"
expect_file_re: "aarch64"
expect_cross: "--expect-cross"
expect_cross_version: "0.2.3"
expect_stripped: "--no-expect-stripped"
can_test: true
- platform_name: Linux-aarch64-with-cross-19be834
os: ubuntu-20.04
target: aarch64-unknown-linux-musl
cross-version: "19be834"
expect_file_re: "aarch64"
expect_cross: "--expect-cross"
expect_cross_version: "19be834"
expect_stripped: "--no-expect-stripped"
can_test: true
- platform_name: Linux-arm
os: ubuntu-20.04
target: arm-unknown-linux-musleabi
expect_file_re: "32.+ARM"
expect_cross: "--expect-cross"
expect_stripped: "--no-expect-stripped"
can_test: true
- platform_name: Linux-i586
os: ubuntu-20.04
target: i586-unknown-linux-musl
expect_file_re: "ELF.+80386"
expect_cross: "--expect-cross"
expect_stripped: "--no-expect-stripped"
can_test: true
- platform_name: Linux-i686
os: ubuntu-20.04
target: i686-unknown-linux-musl
expect_file_re: "ELF.+80386"
expect_cross: "--expect-cross"
expect_stripped: "--no-expect-stripped"
can_test: true
- platform_name: Linux-powerpc
os: ubuntu-20.04
target: powerpc-unknown-linux-gnu
expect_file_re: "32.+PowerPC"
expect_cross: "--expect-cross"
expect_stripped: "--no-expect-stripped"
can_test: true
- platform_name: Linux-powerpc64
os: ubuntu-20.04
target: powerpc64-unknown-linux-gnu
expect_file_re: "64.+PowerPC"
expect_cross: "--expect-cross"
expect_stripped: "--no-expect-stripped"
can_test: true
- platform_name: Linux-powerpc64le
os: ubuntu-20.04
target: powerpc64le-unknown-linux-gnu
expect_file_re: "64.+PowerPC"
expect_cross: "--expect-cross"
expect_stripped: "--no-expect-stripped"
can_test: true
- platform_name: Linux-riscv64
os: ubuntu-20.04
target: riscv64gc-unknown-linux-gnu
expect_file_re: "64.+RISC-V"
expect_cross: "--expect-cross"
expect_stripped: "--no-expect-stripped"
can_test: true
- platform_name: Linux-s390x
os: ubuntu-20.04
target: s390x-unknown-linux-gnu
expect_file_re: "64.+S/390"
expect_cross: "--expect-cross"
expect_stripped: "--no-expect-stripped"
can_test: true
- platform_name: NetBSD-x86_64
os: ubuntu-20.04
target: x86_64-unknown-netbsd
expect_file_re: "x86-64.+NetBSD"
expect_cross: "--expect-cross"
expect_stripped: "--no-expect-stripped"
can_test: false
- platform_name: Windows-aarch64
os: windows-latest
target: aarch64-pc-windows-msvc
expect_file_re: "Aarch64.+Windows"
expect_cross: "--no-expect-cross"
expect_stripped: "--no-expect-stripped"
can_test: false
- platform_name: Windows-i686
os: windows-latest
target: i686-pc-windows-msvc
expect_file_re: "80386.+Windows"
expect_cross: "--no-expect-cross"
expect_stripped: "--expect-stripped"
can_test: true
- platform_name: Windows-x86_64
os: windows-latest
target: x86_64-pc-windows-msvc
expect_file_re: "x86-64.+Windows"
expect_stripped: "--expect-stripped"
can_test: true
- platform_name: macOS-x86_64
os: macOS-latest
target: x86_64-apple-darwin
expect_file_re: "Mach-O.+x86_64"
expect_cross: "--no-expect-cross"
expect_stripped: "--expect-stripped"
can_test: true
- platform_name: macOS-aarch64
os: macOS-latest
target: aarch64-apple-darwin
expect_file_re: "Mach-O.+arm64"
expect_cross: "--no-expect-cross"
expect_stripped: "--expect-stripped"
can_test: false
runs-on: ${{ matrix.platform.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Copy test project to root
shell: bash
run: |
cp -a test-project/* .
rm -fr test-project
- name: Run both commands
uses: ./
with:
command: both
cross-version: ${{ matrix.platform.cross-version }}
target: ${{ matrix.platform.target }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: ${{ matrix.platform.can_test }}
- name: Run test command
uses: ./
with:
command: test
cross-version: ${{ matrix.platform.cross-version }}
target: ${{ matrix.platform.target }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: ${{ matrix.platform.can_test }}
- name: Run build command
uses: ./
with:
command: build
cross-version: ${{ matrix.platform.cross-version }}
target: ${{ matrix.platform.target }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
strip: true
- name: Run build command for subdir
uses: ./
with:
command: build
cross-version: ${{ matrix.platform.cross-version }}
working-directory: subcrate
target: ${{ matrix.platform.target }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
strip: true
- name: Check binary and cross on ${{ matrix.platform.platform_name }}
shell: bash
run: |
tests/check-binary.pl \
--target "${{ matrix.platform.target }}" \
--expect-file-re "${{ matrix.platform.expect_file_re }}" \
--expect-cross-version "${{ matrix.platform.expect_cross_version }}" \
${{ matrix.platform.expect_cross }} \
${{ matrix.platform.expect_stripped }}