-
Notifications
You must be signed in to change notification settings - Fork 12
259 lines (203 loc) · 6.05 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
name: Test
on: [push, pull_request]
jobs:
test:
runs-on: windows-latest
strategy:
matrix:
include:
- platform: 'x86_64'
- platform: 'x86'
packages: >-
coreutils
moreutils
- platform: 'amd64'
packages: |
coreutils,
moreutils
fail-fast: false
name: 'Test ${{ matrix.platform }}'
steps:
- run: git config --global core.autocrlf input
- uses: actions/checkout@v4
- name: Install Cygwin
uses: ./
with:
platform: ${{ matrix.platform }}
packages: ${{ matrix.packages }}
add-to-path: false
- name: Explicitly running shell
run: C:\cygwin\bin\bash -lc "echo 'Explicitly run shell'"
- name: Single-line inline shell
run: echo "Running in $(pwd)"
shell: C:\cygwin\bin\bash.exe '{0}'
- name: Multiline inline shell
run: >-
echo "Running in $(pwd)" &&
true
shell: C:\cygwin\bin\bash.exe '{0}'
- name: Shell script
run: C:\cygwin\bin\bash.exe tests/script.sh
- name: Check requested packages got installed
run: C:\cygwin\bin\sponge.exe tmp
if: contains(matrix.packages, 'moreutils')
- name: Check PATH hasn't changed
run: |
if [[ "${OSTYPE}" = "cygwin" ]]; then
echo "unexpectedly using Cygwin Bash"
exit 1
fi
if [[ "$(cygpath -aw "$(which cygpath)")" = 'C:\cygwin\'* ]]; then
echo "unexpectedly using Cygwin cygpath"
exit 1
fi
shell: bash # If Cygwin is not in PATH -- as expected -- this will be Git Bash
env:
SHELLOPTS: igncr
complex-test:
runs-on: windows-latest
name: 'Complex Test'
strategy:
matrix:
include:
- combination: 1
defaults:
run:
shell: C:\cygwin\bin\bash.exe --noprofile --norc -o igncr -eo pipefail '{0}'
steps:
- run: git config --global core.autocrlf input
shell: pwsh -command ". '{0}'".
- uses: actions/checkout@v4
- name: Install Cygwin
uses: ./
- name: Run one
run: |
echo
echo "One"
echo
- name: Run two
run: |
if [[ '${{ matrix.combination }}' == "${COMBINATION}" ]]; then
echo "It's true: ${COMBINATION} satisfied"
else
exit 1
fi
echo
echo "Two"
echo
env:
COMBINATION: 1
install-dir-test:
runs-on: windows-latest
name: 'Check install directory behaviour'
strategy:
matrix:
include:
- install-dir: C:\tools\cygwin
- install-dir: D:\cygwin64
steps:
- run: git config --global core.autocrlf input
- uses: actions/checkout@v4
- name: Install Cygwin
uses: ./
with:
install-dir: "${{ matrix.install-dir }}"
- name: Check install directory
run: |
if [[ "$(cygpath -aw /)" == '${{ matrix.install-dir }}' ]]; then
echo "Installed in $(cygpath -aw /)"
else
exit 1
fi
if [[ "${OSTYPE}" != "cygwin" ]]; then
echo "unexpected OSTYPE ${OSTYPE}"
exit 1
fi
# Only specify the shell by name; GitHub actions should find the correct
# executable thanks to the action setting the path appropriately.
shell: bash
env:
SHELLOPTS: igncr
symlink-test:
runs-on: windows-latest
name: 'Check symlink type control'
strategy:
matrix:
include:
- symlink-type: native
- symlink-type: sys
- symlink-type: wsl
env:
CYGWIN: winsymlinks:${{ matrix.symlink-type }}
steps:
- run: git config --global core.autocrlf input
- uses: actions/checkout@v4
- name: Install Cygwin
uses: ./
- name: Check symlink
run: bash tests/symlink.sh
time-machine:
runs-on: windows-latest
strategy:
fail-fast: false
name: 'Test time machine signature'
steps:
- run: git config --global core.autocrlf input
- uses: actions/checkout@v4
- name: Install Cygwin
uses: ./
with:
site: http://ctm.crouchingtigerhiddenfruitbat.org/pub/cygwin/circa/64bit/2021/01/22/181752
check-sig: false
- name: Check cygwin version
run: |
cygcheck -cd cygwin | grep -qF 3.1.7-1
shell: C:\cygwin\bin\bash.exe --noprofile --norc -o igncr -eo pipefail '{0}'
bad-sig:
runs-on: windows-latest
strategy:
fail-fast: false
name: 'Test failure of time machine signature'
steps:
- run: git config --global core.autocrlf input
- uses: actions/checkout@v4
- name: Fail to install Cygwin
uses: ./
with:
site: http://ctm.crouchingtigerhiddenfruitbat.org/pub/cygwin/circa/64bit/2021/01/22/181752
continue-on-error: true
# The install step should have failed due to the duff signature. Check
# that by trying to run Bash: if Cygwin were installed correctly, we'd run
# Cygwin Bash; if it isn't, we'll run one of the non-Cygwin Bash
# executables provided by the GitHub runner.
- name: Check Cygwin isn't installed
run: |
if [[ "${OSTYPE}" = "cygwin" ]]; then
echo "Unexpectedly running Cygwin"
exit 1
fi
shell: bash
env:
SHELLOPTS: igncr
multiple-sites-and-pubkeys:
runs-on: windows-latest
strategy:
fail-fast: false
name: 'Test multiple sites and extra pubkeys'
steps:
- run: git config --global core.autocrlf input
- uses: actions/checkout@v4
- name: Run repo HTTP server
uses: Eun/[email protected]
with:
directory: ${{ github.workspace }}\tests\repo
- name: Install Cygwin
uses: ./
with:
site: |
http://localhost:8080
http://mirrors.kernel.org/sourceware/cygwin/
packages: cygwin-install-action-test
pubkeys: ${{ github.workspace }}\tests\repo\key.pub
- name: Run test shell script
run: C:\cygwin\bin\bash.exe /cygwin-install-action-test.sh