-
-
Notifications
You must be signed in to change notification settings - Fork 1
63 lines (54 loc) · 1.62 KB
/
tests.yml
File metadata and controls
63 lines (54 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Tests
on:
push:
branches: [ '**' ]
pull_request:
jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get install -y shellcheck jq bash lua5.4 liblua5.4-dev
- name: Set up environment
run: |
echo "RETRO_DIR=$GITHUB_WORKSPACE" >> $GITHUB_ENV
echo "RETRO_CACHE=$HOME/.cache/retro" >> $GITHUB_ENV
mkdir -p $HOME/.cache/retro
- name: Run all tests via retro
run: |
chmod +x $RETRO_DIR/retro.sh
cd $RETRO_DIR
RETRO_TEST_BYPASS=true ./retro.sh --tests all
- name: Upload test cache
if: always()
uses: actions/upload-artifact@v4
with:
name: test-cache
path: ~/.cache/retro/test_cache.json
retention-days: 30
- name: Show test summary
if: always()
run: |
if [[ -f ~/.cache/retro/test_cache.json ]]; then
cat ~/.cache/retro/test_cache.json | jq -r '
"Test Summary:
Total: \(.total)
Passed: \(.passed)
Failed: \(.failed)
Warnings: \(.warnings)"
'
else
echo "No test cache found"
fi
- name: Fail if tests failed
run: |
if [[ -f ~/.cache/retro/test_cache.json ]]; then
failed=$(cat ~/.cache/retro/test_cache.json | jq -r '.failed')
if [[ "$failed" -gt 0 ]]; then
echo "Tests failed!"
exit 1
fi
fi