-
Notifications
You must be signed in to change notification settings - Fork 41
55 lines (48 loc) · 1.15 KB
/
test.yml
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
name: test
on: [push, pull_request, workflow_dispatch]
permissions:
contents: read
jobs:
mod:
runs-on: ubuntu-latest
name: Check modules
steps:
- uses: actions/setup-go@v4
with:
go-version: 'stable'
- uses: actions/checkout@v4
- run: go mod tidy && git diff --exit-code go.mod go.sum
format:
runs-on: ubuntu-latest
name: Check Go formatting
needs: mod
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: 'stable'
- run: go fmt ./... && git diff --exit-code
lint:
runs-on: ubuntu-latest
name: Lint Go code
needs: format
steps:
- uses: actions/checkout@v4
- uses: golangci/golangci-lint-action@v3
with:
version: latest
- run: golangci-lint run
unit-tests:
runs-on: ubuntu-latest
name: Run unit tests
needs: lint
steps:
- uses: actions/checkout@v4
- run: ./scripts/unit.sh
integration-tests:
runs-on: ubuntu-latest
name: Run integration tests
needs: unit-tests
steps:
- uses: actions/checkout@v4
- run: ./scripts/integration.sh