File tree 2 files changed +15
-18
lines changed
2 files changed +15
-18
lines changed Original file line number Diff line number Diff line change 36
36
name : rig-linux
37
37
path : ' rig-*.tar.gz'
38
38
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
-
47
39
- name : Run tests
48
40
run : |
49
- bats tests/ test-linux.sh
41
+ make linux- test-all
50
42
51
43
linux-arm :
52
44
runs-on : [linux-arm64]
63
55
64
56
- name : Build rig
65
57
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
73
59
74
60
- name : Upload build as artifact
75
61
uses : actions/upload-artifact@v3
78
64
name : rig-linux-aarch64
79
65
path : ' rig-*.tar.gz'
80
66
81
- # TODO: run tests in Docker container
67
+ - name : Run tests
68
+ run : |
69
+ make linux-test-all
82
70
83
71
macos :
84
72
runs-on : ${{ matrix.config.os }}
Original file line number Diff line number Diff line change @@ -68,14 +68,23 @@ linux-in-docker:
68
68
69
69
define GEN_TESTS
70
70
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
72
77
shell-$(variant ) :
73
78
docker run -ti --rm -v $(PWD ) :/work `echo $(variant ) | tr - :` bash
74
79
TEST_IMAGES += linux-test-$(variant )
75
80
endef
76
81
$(foreach variant, $(VARIANTS), $(eval $(GEN_TESTS)))
77
82
78
83
linux-test-all : $(TEST_IMAGES )
84
+ if ls tests/results | grep -q fail; then \
85
+ echo Some tests failed; \
86
+ exit 1; \
87
+ fi
79
88
80
89
# -------------------------------------------------------------------------
81
90
You can’t perform that action at this time.
0 commit comments