-
Notifications
You must be signed in to change notification settings - Fork 1
66 lines (66 loc) · 1.62 KB
/
test.yaml
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
name: tests
on: pull_request
jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Go
uses: WillAbides/[email protected]
with:
go-version: '1.19'
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
codeql:
name: analyze
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: go
- name: Autobuild
uses: github/codeql-action/autobuild@v2
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
build-containers:
name: build container test
runs-on: ubuntu-latest
needs:
- golangci
- codeql
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up buildx
uses: docker/setup-buildx-action@v1
- name: Build containers
uses: docker/build-push-action@v2
with:
push: false
platforms: linux/amd64,linux/arm64
build-binaries:
name: build test
runs-on: ubuntu-latest
needs:
- golangci
- codeql
strategy:
matrix:
goos: [linux]
goarch: [amd64, arm64]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Go
uses: WillAbides/[email protected]
with:
go-version: '1.19'
- name: Run go build
run: |
BINARY_NAME=scra-${{matrix.goos}}-${{matrix.goarch}}
GOOS=${{matrix.goos}} GOARCH=${{matrix.goarch}} go build -o $BINARY_NAME -v