Skip to content

Commit 15e989a

Browse files
committed
[CI] add golang tests launch
Signed-off-by: v.oleynikov <[email protected]>
1 parent 1f469d0 commit 15e989a

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/go_tests.yaml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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

0 commit comments

Comments
 (0)