-
Notifications
You must be signed in to change notification settings - Fork 1
52 lines (43 loc) · 1.05 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
name: Tests
on:
workflow_dispatch:
push:
branches: ["main"]
pull_request:
branches: ["main"]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Run tests
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./src
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.23.4"
- name: Install dependencies
run: go get .
- name: Run unit tests
run: go test -v ./...
if: ${{ !cancelled() }}
- name: Run formatter
run: test -z $(gofmt -l .)
if: ${{ !cancelled() }}
- name: Run Hadolint
uses: hadolint/[email protected]
if: ${{ !cancelled() }}
with:
dockerfile: Dockerfile
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
if: ${{ !cancelled() }}
with:
version: v1.62.2
working-directory: src