-
Notifications
You must be signed in to change notification settings - Fork 0
151 lines (150 loc) · 5.08 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
name: test
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
test_local:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Prebuild Docker dpkg container
run: ./docker-build-dpkg-container
- name: Download test packages
run: ./test-download-debs
- name: Generate test GPG keys
run: ./test-generate-gpg
- name: Run tests
run: ./docker-test-all
test_as_action_keys_in_fs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download test packages
run: ./test-download-debs
- name: Generate test GPG keys
run: ./test-generate-gpg
- name: Clean Az Storage container
env:
AZURE_STORAGE_SAS_TOKEN: ${{ secrets.TEST_AZURE_STORAGE_SAS_TOKEN }}
run: |
az storage blob delete-batch \
--account-name packageskaitai \
--source test3 \
--pattern '*'
- name: List Az Storage container
env:
AZURE_STORAGE_SAS_TOKEN: ${{ secrets.TEST_AZURE_STORAGE_SAS_TOKEN }}
run: |
az storage blob list \
--account-name packageskaitai \
-c test3 \
--output table \
--verbose
- name: Run action - create repo from scratch
uses: ./ # Uses an action in the root directory
with:
az_storage_sas_token: ${{ secrets.TEST_AZURE_STORAGE_SAS_TOKEN }}
az_storage_account: packageskaitai
az_storage_container: test3
packages: all_pkgs/kaitai-struct-compiler_0.7_all.deb
- name: Test install 0.7
run: |
mkdir -p test
sudo ./test-pkg-install-az | tee test/test-0.7.log
if grep -q 'kaitai-struct-compiler 0.7' test/test-0.7.log; then
echo OK
else
echo FAIL
exit 1
fi
- name: Run action - add to repo
uses: ./ # Uses an action in the root directory
with:
az_storage_sas_token: ${{ secrets.TEST_AZURE_STORAGE_SAS_TOKEN }}
az_storage_account: packageskaitai
az_storage_container: test3
packages: all_pkgs/kaitai-struct-compiler_0.9_all.deb
- name: Test install 0.9
run: |
mkdir -p test
sudo ./test-pkg-install-az | tee test/test-0.9.log
if grep -q 'kaitai-struct-compiler 0.9' test/test-0.9.log; then
echo OK
else
echo FAIL
exit 1
fi
test_as_action_keys_in_inputs:
runs-on: ubuntu-latest
# In theory, they could run in parallel, but we have one test Az storage container, so forcing sequential execution
needs: test_as_action_keys_in_fs
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download test packages
run: ./test-download-debs
- name: Clean Az Storage container
env:
AZURE_STORAGE_SAS_TOKEN: ${{ secrets.TEST_AZURE_STORAGE_SAS_TOKEN }}
run: |
az storage blob delete-batch \
--account-name packageskaitai \
--source test3 \
--pattern '*'
- name: List Az Storage container
env:
AZURE_STORAGE_SAS_TOKEN: ${{ secrets.TEST_AZURE_STORAGE_SAS_TOKEN }}
run: |
az storage blob list \
--account-name packageskaitai \
-c test3 \
--output table \
--verbose
- name: Run action - create repo from scratch
uses: ./ # Uses an action in the root directory
with:
az_storage_sas_token: ${{ secrets.TEST_AZURE_STORAGE_SAS_TOKEN }}
az_storage_account: packageskaitai
az_storage_container: test3
gpg_priv_key: ${{ secrets.TEST_GPG_PRIV_KEY }}
gpg_passphrase: ${{ secrets.TEST_GPG_PASSPHRASE }}
packages: all_pkgs/kaitai-struct-compiler_0.7_all.deb
- name: Prepare gpg pub key in file
run: |
mkdir -p gpg
echo "${{ secrets.TEST_GPG_PUB_KEY }}" >gpg/repo-pubkey.asc
- name: Test install 0.7
run: |
mkdir -p test
sudo ./test-pkg-install-az | tee test/test-0.7.log
if grep -q 'kaitai-struct-compiler 0.7' test/test-0.7.log; then
echo OK
else
echo FAIL
exit 1
fi
- name: Run action - add to repo
uses: ./ # Uses an action in the root directory
with:
az_storage_sas_token: ${{ secrets.TEST_AZURE_STORAGE_SAS_TOKEN }}
az_storage_account: packageskaitai
az_storage_container: test3
gpg_priv_key: ${{ secrets.TEST_GPG_PRIV_KEY }}
gpg_passphrase: ${{ secrets.TEST_GPG_PASSPHRASE }}
packages: all_pkgs/kaitai-struct-compiler_0.9_all.deb
- name: Test install 0.9
run: |
mkdir -p test
sudo ./test-pkg-install-az | tee test/test-0.9.log
if grep -q 'kaitai-struct-compiler 0.9' test/test-0.9.log; then
echo OK
else
echo FAIL
exit 1
fi