Skip to content

Commit 4f921dc

Browse files
committed
GHA: use new tests
Plus do not stop if a test suite fails, always run all platforms.
1 parent 9bff3d3 commit 4f921dc

File tree

2 files changed

+15
-18
lines changed

2 files changed

+15
-18
lines changed

.github/workflows/test.yaml

+5-17
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,9 @@ jobs:
3636
name: rig-linux
3737
path: 'rig-*.tar.gz'
3838

39-
- name: Install rig
40-
run: |
41-
sudo tar xzf rig-*.tar.gz -C /usr/local
42-
43-
- name: Install bats
44-
run: |
45-
sudo apt-get update && sudo apt-get install bats
46-
4739
- name: Run tests
4840
run: |
49-
bats tests/test-linux.sh
41+
make linux-test-all
5042
5143
linux-arm:
5244
runs-on: [linux-arm64]
@@ -63,13 +55,7 @@ jobs:
6355

6456
- name: Build rig
6557
run: |
66-
docker system prune -f
67-
docker build -t rig:latest .
68-
docker rm quickrig 2>/dev/null || true
69-
docker run --name quickrig rig:latest ls out
70-
docker cp quickrig:out .
71-
ls out
72-
cp out/rig* .
58+
make linux-in-docker
7359
7460
- name: Upload build as artifact
7561
uses: actions/upload-artifact@v3
@@ -78,7 +64,9 @@ jobs:
7864
name: rig-linux-aarch64
7965
path: 'rig-*.tar.gz'
8066

81-
# TODO: run tests in Docker container
67+
- name: Run tests
68+
run: |
69+
make linux-test-all
8270
8371
macos:
8472
runs-on: ${{ matrix.config.os }}

Makefile

+10-1
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,23 @@ linux-in-docker:
6868

6969
define GEN_TESTS
7070
linux-test-$(variant): rig-$(VERSION).tar.gz
71-
docker run -t --rm -v $(PWD):/work `echo $(variant) | tr - :` bash -c /work/tests/test-linux-docker.sh
71+
mkdir -p tests/results
72+
rm -f tests/results/$(variant).fail tests/results/$(variant).success
73+
docker run -t --rm -v $(PWD):/work `echo $(variant) | tr - :` \
74+
bash -c /work/tests/test-linux-docker.sh && \
75+
touch tests/results/$(variant).success || \
76+
touch tests/results/$(variant).fail
7277
shell-$(variant):
7378
docker run -ti --rm -v $(PWD):/work `echo $(variant) | tr - :` bash
7479
TEST_IMAGES += linux-test-$(variant)
7580
endef
7681
$(foreach variant, $(VARIANTS), $(eval $(GEN_TESTS)))
7782

7883
linux-test-all: $(TEST_IMAGES)
84+
if ls tests/results | grep -q fail; then \
85+
echo Some tests failed; \
86+
exit 1; \
87+
fi
7988

8089
# -------------------------------------------------------------------------
8190

0 commit comments

Comments
 (0)