-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (73 loc) · 1.83 KB
/
ci.yaml
File metadata and controls
76 lines (73 loc) · 1.83 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
name: CI
on:
push:
branches:
- master
- main
pull_request:
jobs:
vet:
name: Go Vet
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
fail-fast: false
matrix:
module:
- backend/byteport
- backend/nvms
steps:
- name: Checkout the code
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: ${{ matrix.module }}/go.mod
cache-dependency-path: ${{ matrix.module }}/go.sum
- name: Run go vet
working-directory: ${{ matrix.module }}
run: go vet ./...
build:
name: Go Build
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
fail-fast: false
matrix:
module:
- backend/byteport
- backend/nvms
steps:
- name: Checkout the code
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: ${{ matrix.module }}/go.mod
cache-dependency-path: ${{ matrix.module }}/go.sum
- name: Run go build
working-directory: ${{ matrix.module }}
run: go build ./...
fmt:
name: Go Fmt (advisory)
runs-on: ubuntu-latest
continue-on-error: true
permissions:
contents: read
steps:
- name: Checkout the code
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: 'stable'
- name: Check formatting
run: |
unformatted=$(gofmt -l backend/byteport backend/nvms)
if [ -n "$unformatted" ]; then
echo "::warning::The following files are not gofmt-clean (advisory; does not block merge):"
echo "$unformatted"
exit 1
fi