Skip to content

Commit 3bb6c1b

Browse files
committed
Use standardized CI workflow
1 parent 77095b8 commit 3bb6c1b

1 file changed

Lines changed: 40 additions & 27 deletions

File tree

.github/workflows/qa.yml

Lines changed: 40 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,61 @@
1-
name: Quality Assurance
1+
name: CI
22

33
on:
44
push:
5-
branches: ["main", "initial"]
6-
tags-ignore: ["**"]
5+
branches: [main, initial]
76
pull_request:
7+
branches: [main, initial]
88

99
jobs:
10+
test:
11+
runs-on: ubuntu-24.04
12+
steps:
13+
- uses: actions/checkout@v4.2.2
1014

11-
build:
12-
runs-on: ubuntu-latest
15+
- uses: actions/setup-go@v5.2.0
16+
with:
17+
go-version-file: go.mod
18+
19+
- name: Run tests
20+
run: go test -v -race ./...
21+
22+
lint:
23+
runs-on: ubuntu-24.04
1324
steps:
14-
- name: Git checkout
15-
uses: actions/checkout@v5
25+
- uses: actions/checkout@v4.2.2
1626

17-
- uses: actions/setup-go@v6
27+
- uses: actions/setup-go@v5.2.0
1828
with:
19-
go-version: stable
29+
go-version-file: go.mod
2030

21-
- name: Build
22-
run: go build -o docker-api-auth .
31+
- name: golangci-lint
32+
uses: golangci/golangci-lint-action@v6.2.0
33+
with:
34+
version: v2.8.0
2335

24-
test:
25-
runs-on: ubuntu-latest
36+
fmt:
37+
runs-on: ubuntu-24.04
2638
steps:
27-
- name: Git checkout
28-
uses: actions/checkout@v5
39+
- uses: actions/checkout@v4.2.2
2940

30-
- uses: actions/setup-go@v6
41+
- uses: actions/setup-go@v5.2.0
3142
with:
32-
go-version: stable
43+
go-version-file: go.mod
44+
45+
- name: Install golangci-lint
46+
run: go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.8.0
3347

34-
- name: Test
35-
run: go test ./...
48+
- name: Check formatting
49+
run: test -z "$(golangci-lint fmt --diff)" || (echo "Run 'golangci-lint fmt' to fix formatting" && exit 1)
3650

37-
golangci-lint:
38-
runs-on: ubuntu-latest
51+
build:
52+
runs-on: ubuntu-24.04
3953
steps:
40-
- name: Git checkout
41-
uses: actions/checkout@v5
54+
- uses: actions/checkout@v4.2.2
4255

43-
- uses: actions/setup-go@v6
56+
- uses: actions/setup-go@v5.2.0
4457
with:
45-
go-version: stable
58+
go-version-file: go.mod
4659

47-
- name: Golangci-lint
48-
uses: golangci/golangci-lint-action@v8.0.0
60+
- name: Build
61+
run: go build -o docker-api-auth .

0 commit comments

Comments
 (0)