-
Notifications
You must be signed in to change notification settings - Fork 3
87 lines (72 loc) · 2.12 KB
/
Copy pathgo-testing.yml
File metadata and controls
87 lines (72 loc) · 2.12 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Go testing
on:
push:
branches:
- main
paths:
- 'website-admin/**'
pull_request:
paths:
- 'website-admin/**'
workflow_dispatch:
jobs:
testing:
name: Testing (Go)
runs-on: ubuntu-24.04
defaults:
run:
working-directory: website-admin
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6
with:
go-version: "1.26"
cache: false
- name: Run go version
run: go version
- name: Run Unit tests.
run: make test
golangci:
name: Linting (Go)
runs-on: ubuntu-24.04
defaults:
run:
working-directory: website-admin
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6
with:
go-version: "1.26"
cache: false
- name: Run go version
run: go version
- name: Run go fmt
if: runner.os != 'Windows'
run: diff -u <(echo -n) <(gofmt -d -s .)
- name: golangci-lint
uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # v9
with:
version: v2.12.2
working-directory: website-admin
# golangci-lint contains only a set of rules from staticcheck.
# It's not the same thing as the staticcheck binary.
# Hence we deactivate it above and run it alone.
# See https://golangci-lint.run/usage/linters/#enabled-by-default
- name: Run staticcheck
run: make staticcheck
compile:
name: Compile application
runs-on: ubuntu-24.04
defaults:
run:
working-directory: website-admin
needs: [testing, golangci]
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6
with:
go-version: "1.26"
- name: Run go version
run: go version
- name: Build
run: make build