Skip to content

Commit d0d2d7c

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

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

.github/workflows/test.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Run tests
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
run-tests:
7+
strategy:
8+
matrix:
9+
os: [ 'windows', 'ubuntu', 'macos' ]
10+
fail-fast: false
11+
runs-on: ${{ matrix.os }}-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Setup python
15+
uses: actions/setup-python@v2
16+
with:
17+
python-version: 3.x
18+
- name: test
19+
shell: bash
20+
run: |
21+
# setup-python puts `python` into the `PATH`, not `python3`, yet
22+
# `git-filter-repo` expects `python3` in the `PATH`. Let's add
23+
# a shim.
24+
printf '#!/bin/sh\n\nexec python "$@"\n' >python3 &&
25+
26+
export PATH=$PWD:$PATH &&
27+
export PYTHONPATH=$PWD &&
28+
export TEST_SHELL_PATH=/bin/sh &&
29+
30+
failed=0 &&
31+
for t in t[0-9]*.sh
32+
do
33+
printf '\n\n== %s ==\n' "$t" &&
34+
(cd t && bash $t -q -v -x) ||
35+
failed=$(($failed+1))
36+
done &&
37+
if test 0 != $failed
38+
then
39+
mkdir failed &&
40+
tar czf failed/failed.tar.gz t
41+
exit 1
42+
fi
43+
- name: upload failed tests' directories
44+
if: failure()
45+
uses: actions/upload-artifact@v1
46+
with:
47+
name: failed-${{ matrix.os }}
48+
path: failed

0 commit comments

Comments
 (0)