Skip to content

Commit c08dca3

Browse files
committed
Add a GitHub workflow to test this thing
Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 8454302 commit c08dca3

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

.github/workflows/test.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Run tests
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
windows:
7+
runs-on: windows-latest
8+
steps:
9+
- uses: actions/checkout@v1
10+
- name: download Git for Windows' git-sdk-64
11+
shell: bash
12+
run: |
13+
## Get artifact
14+
urlbase=https://dev.azure.com/git-for-windows/git/_apis/build/builds
15+
id=$(curl "$urlbase?definitions=29&statusFilter=completed&resultFilter=succeeded&\$top=1" |
16+
jq -r ".value[] | .id")
17+
download_url="$(curl "$urlbase/$id/artifacts" |
18+
jq -r '.value[] | select(.name == "git-sdk-64-full-sdk").resource.downloadUrl')"
19+
curl --connect-timeout 10 --retry 5 --retry-delay 0 --retry-max-time 240 \
20+
-o artifacts.zip "$download_url"
21+
22+
## Unzip and remove artifact
23+
unzip -v artifacts.zip
24+
mkdir git-sdk-64
25+
unzip -p artifacts.zip git-sdk-64-full-sdk/git-sdk-64.tar.xz | tar -C git-sdk-64 -xJf -
26+
rm artifacts.zip
27+
- name: test
28+
shell: powershell
29+
env:
30+
HOME: ${{runner.workspace}}
31+
MSYSTEM: MINGW64
32+
TEST_SHELL_PATH: /bin/sh
33+
run: |
34+
& .\git-sdk-64\usr\bin\bash.exe -lc @"
35+
cd t &&
36+
prove -j`$(nproc) t[0-9]*.sh :: -i -V -x
37+
"@
38+
- name: print failures
39+
if: failure()
40+
shell: powershell
41+
run: |
42+
& .\git-sdk-64\usr\bin\bash.exe -lc @"
43+
mkdir failed
44+
tar tzvf failed/failed.tar.gz t
45+
for out in t/test-results/*.out
46+
do
47+
printf '\n\n== %s ==\n' \"`$out\"
48+
cat \"`$out\"
49+
done
50+
mv t/trash* t/test-results failed/
51+
"@
52+
- name: upload failed tests' directories
53+
if: failure()
54+
uses: actions/upload-artifact@v1
55+
with:
56+
name: failed-tests-windows
57+
path: failed
58+

0 commit comments

Comments
 (0)