-
-
Notifications
You must be signed in to change notification settings - Fork 7
56 lines (52 loc) · 1.88 KB
/
test.yaml
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
name: Game Tests
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [ '1.20' ]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Display Go version
run: go version
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install --no-install-recommends -y pkg-config libasound2-dev libx11-dev
- name: Test Game Content
run: |
bash -c '
changed_files=$(git diff --name-only --diff-filter=ACMRTUXB HEAD~1 | grep -E "\.go$|\.lua$")
if [ -z "$changed_files" ]; then
echo "No .go or .lua files were modified. Exiting."
echo "" > TestResults-${{ matrix.go-version }}.json
exit 0
else
echo "Changes found in .go or .lua files. Running tests."
EOE_TESTER_WORKING_DIR=$(pwd) go test ./cmd/internal/tester -json > TestResults-${{ matrix.go-version }}.json
fi
'
- name: Upload Go test results
uses: actions/upload-artifact@v3
with:
name: Go-results-${{ matrix.go-version }}
path: TestResults-${{ matrix.go-version }}.json
- name: Build Fuzzy Tester
run: go build -o ./fuzzy_tester ./cmd/internal/fuzzy_tester
- name: Running Fuzzy Tester
run: |
bash -c '
changed_files=$(git diff --name-only --diff-filter=ACMRTUXB HEAD~1 | grep -E "\.go$|\.lua$")
if [ -z "$changed_files" ]; then
echo "No .go or .lua files were modified. Exiting."
exit 0
else
echo "Changes found in .go or .lua files. Running fuzzy tester."
./fuzzy_tester -n 2 -timeout 30s
fi
'