Skip to content

Commit c709f81

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

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

.github/workflows/test.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
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+
run: |
33+
& .\git-sdk-64\usr\bin\bash.exe -lc @"
34+
cd t &&
35+
PYTHONPATH=`$PWD \
36+
TEST_SHELL_PATH=/bin/sh \
37+
prove -j`$(nproc) t[0-9]*.sh :: -V -x
38+
"@
39+
- name: print failures
40+
if: failure()
41+
shell: powershell
42+
run: |
43+
& .\git-sdk-64\usr\bin\bash.exe -lc @"
44+
mkdir failed
45+
tar tzvf failed/failed.tar.gz t
46+
for out in t/test-results/*.out
47+
do
48+
printf '\n\n== %s ==\n' \"`$out\"
49+
cat \"`$out\"
50+
done
51+
mv t/trash* t/test-results failed/
52+
"@
53+
- name: upload failed tests' directories
54+
if: failure()
55+
uses: actions/upload-artifact@v1
56+
with:
57+
name: failed-tests-windows
58+
path: failed
59+

0 commit comments

Comments
 (0)