generated from reviewdog/action-template
-
Notifications
You must be signed in to change notification settings - Fork 11
278 lines (258 loc) · 7.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
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
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
---
name: Test
"on":
push:
branches:
- master
paths-ignore:
- 'LICENSE'
- 'README.*'
pull_request:
paths-ignore:
- 'LICENSE'
- 'README.*'
jobs:
test-go:
runs-on: ubuntu-latest
strategy:
matrix:
go:
- '1.23'
- '1.x'
defaults:
run:
working-directory: tools/replacetool
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- run: go build
- run: go test -cover ./...
test-script:
runs-on: ubuntu-latest
strategy:
matrix:
desc:
- 'test package'
- >
sample package1
sample package2
sample package3
- |
sample package1
sample package2
sample package3
- ''
steps:
- uses: actions/checkout@v4
- run: |
mkdir -p .debpkg/usr/bin
mkdir -p .debpkg/usr/lib/testbin
echo -e "echo hello" > .debpkg/usr/bin/testbin
echo -e "echo hello2" > .debpkg/usr/bin/testbin2
echo -e "a=1" > .debpkg/usr/lib/testbin/testbin.conf
chmod +x .debpkg/usr/bin/*
- uses: ./
with:
package: testbin
package_root: .debpkg
maintainer: jiro4989
version: 'v1.0.0'
arch: 'amd64'
desc: "${{ matrix.desc }}"
if: matrix.desc != ''
- uses: ./
with:
package: testbin
package_root: .debpkg
maintainer: jiro4989
version: 'v1.0.0'
arch: 'amd64'
if: matrix.desc == ''
- name: install deb package
run: sudo dpkg -i *.deb
- name: Print deb package information
run: dpkg -I ./*.deb
- name: check files
run: |
which testbin
testbin
which testbin2
testbin2
find /usr/lib/testbin/
cat /usr/lib/testbin/testbin.conf
- name: Print installed deb package size
run: >
dpkg-query -W -f='${Installed-Size}\t${Package}\n' |
sort -nr |
grep testbin
test-github-ref-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
mkdir -p .debpkg/usr/bin
mkdir -p .debpkg/usr/lib/testbin
echo -e "echo hello" > .debpkg/usr/bin/testbin
echo -e "echo hello2" > .debpkg/usr/bin/testbin2
echo -e "a=1" > .debpkg/usr/lib/testbin/testbin.conf
chmod +x .debpkg/usr/bin/*
- uses: ./
with:
package: testbin
package_root: .debpkg
maintainer: jiro4989
version: 'refs/tags/v1.0.0'
arch: 'amd64'
desc: 'test package'
id: build
- name: install deb package
run: sudo dpkg -i *.deb
- name: check files
run: |
which testbin
testbin
which testbin2
testbin2
find /usr/lib/testbin/
cat /usr/lib/testbin/testbin.conf
- name: Test file_name
run: test ${{ steps.build.outputs.file_name }} = 'testbin_1.0.0_amd64.deb'
test-nim-package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: jiro4989/setup-nim-action@v2
- run: |
git clone https://github.com/jiro4989/nimjson app
(
cd app
nimble build -Y
cp bin/nimjson ../
)
rm -rf app
mkdir -p .debpkg/usr/bin
mv nimjson .debpkg/usr/bin/
- uses: ./
with:
package: nimjson
package_root: .debpkg
maintainer: jiro4989
version: 'v1.0.0'
arch: 'amd64'
desc: 'test package'
- run: sudo dpkg -i *.deb
- run: which nimjson
- run: nimjson -h
- run: dpkg -s nimjson
test-postinst:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
mkdir -p .debpkg/usr/bin
mkdir -p .debpkg/usr/lib/testbin
echo -e "echo hello" > .debpkg/usr/bin/testbin
echo -e "echo hello2" > .debpkg/usr/bin/testbin2
echo -e "a=1" > .debpkg/usr/lib/testbin/testbin.conf
mkdir -p .debpkg/DEBIAN
cat << E > .debpkg/DEBIAN/postinst
#!/bin/bash
set -eu
echo postinst $@
E
chmod +x .debpkg/DEBIAN/postinst
chmod +x .debpkg/usr/bin/*
- uses: ./
with:
package: testbin
package_root: .debpkg
maintainer: jiro4989
version: 'v1.0.0'
arch: 'amd64'
desc: 'test package'
- name: install deb package
run: sudo dpkg -i *.deb
- name: check files
run: |
which testbin
testbin
which testbin2
testbin2
find /usr/lib/testbin/
cat /usr/lib/testbin/testbin.conf
test-depends:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: jiro4989/setup-nim-action@v2
- run: |
git clone https://github.com/jiro4989/nimjson app
(
cd app
nimble build -Y
cp bin/nimjson ../
)
rm -rf app
mkdir -p .debpkg/usr/bin
mv nimjson .debpkg/usr/bin/
- uses: ./
with:
package: nimjson
package_root: .debpkg
maintainer: jiro4989
version: 'v1.0.0'
depends: 'libc6 (>= 2.2.1), git'
arch: 'amd64'
desc: 'test package'
keep_ownership: true
homepage: 'https://github.com/jiro4989/build-deb-action'
section: 'unknown'
id: build
- name: Install deb package
run: sudo dpkg -i ${{ steps.build.outputs.file_name }}
- name: Print deb package information
run: dpkg -I ./*.deb
- name: Print installed command path
run: which nimjson
- name: Print command help message
run: nimjson -h
- name: Print installed deb package information
run: dpkg -s nimjson
- name: Print installed deb package size
run: >
dpkg-query -W -f='${Installed-Size}\t${Package}\n' |
sort -nr |
grep nimjson
test-debian:
runs-on: ubuntu-latest
strategy:
matrix:
image:
- 'ubuntu:22.04'
- 'ubuntu:24.04'
- 'debian:9'
- 'debian:stable'
compress_type:
- 'gzip'
- 'xz'
steps:
- uses: actions/checkout@v4
- run: |
mkdir -p .debpkg/usr/bin
mkdir -p .debpkg/usr/lib/testbin
echo -e "echo hello" > .debpkg/usr/bin/testbin
echo -e "echo hello2" > .debpkg/usr/bin/testbin2
echo -e "a=1" > .debpkg/usr/lib/testbin/testbin.conf
chmod +x .debpkg/usr/bin/*
- uses: ./
with:
package: testbin
package_root: .debpkg
maintainer: jiro4989
version: 'v1.0.0'
arch: 'amd64'
compress_type: ${{ matrix.compress_type }}
- name: Test installing on docker
run: docker run --rm -v $PWD:/work -w /work -t ${{ matrix.image }} dpkg -i ./*.deb