-
Notifications
You must be signed in to change notification settings - Fork 1
45 lines (39 loc) · 1.05 KB
/
go_tests.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
name: Go tests for images
env:
GO_BUILD_TAGS: "EE CE"
on:
pull_request:
push:
branches:
- main
jobs:
test:
name: Go tests for images
runs-on: [self-hosted, regular]
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup Go environment
uses: actions/setup-go@v5
with:
go-version: '1.23.4'
- name: Run Go tests
run: |
basedir=$(pwd)
failed='false'
for i in $(find images -type f -name '*_test.go');do
dir=$(echo $i | sed 's/[a-z_A-Z0-9-]*_test.go$//')
cd $basedir/$dir
# check all editions
for edition in $GO_BUILD_TAGS ;do
echo "Running tests in $dir (edition: $edition)"
go test -v -tags $edition
if [ $? -ne 0 ]; then
echo "Tests failed in $dir (edition: $edition)"
failed='true'
fi
done
done
if [ $failed == 'true' ]; then
exit 1
fi