-
Notifications
You must be signed in to change notification settings - Fork 10
41 lines (33 loc) · 896 Bytes
/
go-tests.yml
File metadata and controls
41 lines (33 loc) · 896 Bytes
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
name: Go Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 'stable'
- name: Install dependencies
run: go mod download
- name: Run tests
run: go test ./internal/... -v
- name: Run staticcheck
run: |
go tool honnef.co/go/tools/cmd/staticcheck ./internal/... ./cmd/...
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Run Docker Compose Tests
run: |
if [ ! -d "test" ]; then
echo "Error: test directory not found"
exit 1
fi
cd test
docker compose up --build test --exit-code-from test