Skip to content

Commit

Permalink
GHA: use new tests
Browse files Browse the repository at this point in the history
Plus do not stop if a test suite fails, always run
all platforms.
  • Loading branch information
gaborcsardi committed Aug 25, 2023
1 parent 9bff3d3 commit 4f921dc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 18 deletions.
22 changes: 5 additions & 17 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,9 @@ jobs:
name: rig-linux
path: 'rig-*.tar.gz'

- name: Install rig
run: |
sudo tar xzf rig-*.tar.gz -C /usr/local
- name: Install bats
run: |
sudo apt-get update && sudo apt-get install bats
- name: Run tests
run: |
bats tests/test-linux.sh
make linux-test-all
linux-arm:
runs-on: [linux-arm64]
Expand All @@ -63,13 +55,7 @@ jobs:

- name: Build rig
run: |
docker system prune -f
docker build -t rig:latest .
docker rm quickrig 2>/dev/null || true
docker run --name quickrig rig:latest ls out
docker cp quickrig:out .
ls out
cp out/rig* .
make linux-in-docker
- name: Upload build as artifact
uses: actions/upload-artifact@v3
Expand All @@ -78,7 +64,9 @@ jobs:
name: rig-linux-aarch64
path: 'rig-*.tar.gz'

# TODO: run tests in Docker container
- name: Run tests
run: |
make linux-test-all
macos:
runs-on: ${{ matrix.config.os }}
Expand Down
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,23 @@ linux-in-docker:

define GEN_TESTS
linux-test-$(variant): rig-$(VERSION).tar.gz
docker run -t --rm -v $(PWD):/work `echo $(variant) | tr - :` bash -c /work/tests/test-linux-docker.sh
mkdir -p tests/results
rm -f tests/results/$(variant).fail tests/results/$(variant).success
docker run -t --rm -v $(PWD):/work `echo $(variant) | tr - :` \
bash -c /work/tests/test-linux-docker.sh && \
touch tests/results/$(variant).success || \
touch tests/results/$(variant).fail
shell-$(variant):
docker run -ti --rm -v $(PWD):/work `echo $(variant) | tr - :` bash
TEST_IMAGES += linux-test-$(variant)
endef
$(foreach variant, $(VARIANTS), $(eval $(GEN_TESTS)))

linux-test-all: $(TEST_IMAGES)
if ls tests/results | grep -q fail; then \
echo Some tests failed; \
exit 1; \
fi

# -------------------------------------------------------------------------

Expand Down

0 comments on commit 4f921dc

Please sign in to comment.