Commit 34a1a46 1 parent 1f469d0 commit 34a1a46 Copy full SHA for 34a1a46
File tree 1 file changed +41
-0
lines changed
1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Go tests for images
2
+
3
+ on :
4
+ pull_request :
5
+ push :
6
+ branches :
7
+ - main
8
+
9
+ jobs :
10
+ test :
11
+ name : Go tests for images
12
+ runs-on : [self-hosted, regular]
13
+
14
+ steps :
15
+ - name : Checkout repository
16
+ uses : actions/checkout@v2
17
+
18
+ - name : Setup Go environment
19
+ uses : actions/setup-go@v5
20
+ with :
21
+ go-version : ' 1.22'
22
+
23
+ - name : Run Go tests
24
+ run : |
25
+ basedir=$(pwd)
26
+ failed='false'
27
+ for dir in $(find images -type d); do
28
+ if ls $dir/*_test.go &> /dev/null; then
29
+ echo "Running tests in $dir"
30
+ cd $dir
31
+ go test -v
32
+ if [ $? -ne 0 ]; then
33
+ echo "Tests failed in $dir"
34
+ failed='true'
35
+ fi
36
+ cd $basedir
37
+ fi
38
+ done
39
+ if [ $failed == 'true' ]; then
40
+ exit 1
41
+ fi
You can’t perform that action at this time.
0 commit comments