1name: Go build and test
2
3on:
4 push:
5 branches: [ master ]
6 pull_request:
7 branches: [ master ]
8 workflow_dispatch:
9
10jobs:
11 build:
12
13 strategy:
14 matrix:
15 go-version: [1.18.x]
16 platform: [ubuntu-latest, macos-latest, windows-latest]
17
18 runs-on: ${{ matrix.platform }}
19
20 steps:
21
22 - name: Set up Go ${{ matrix.node-version }}
23 uses: actions/setup-go@v2
24 with:
25 go-version: ${{ matrix.go-version }}
26
27 - name: Check out code
28 uses: actions/checkout@v2
29
30 - name: Build
31 run: make
32
33 - name: Test
34 run: make test
35 env:
36 GITHUB_TEST_USER: ${{ secrets._GITHUB_TEST_USER }}
37 GITHUB_TOKEN_ADMIN: ${{ secrets._GITHUB_TOKEN_ADMIN }}
38 GITHUB_TOKEN_PRIVATE: ${{ secrets._GITHUB_TOKEN_PRIVATE }}
39 GITHUB_TOKEN_PUBLIC: ${{ secrets._GITHUB_TOKEN_PUBLIC }}
40 GITLAB_API_TOKEN: ${{ secrets.GITLAB_API_TOKEN }}
41 GITLAB_PROJECT_ID: ${{ secrets.GITLAB_PROJECT_ID }}
42
43 lint:
44 runs-on: ubuntu-latest
45 steps:
46 - name: Install Go
47 uses: actions/setup-go@v2
48 with:
49 go-version: 1.18.x
50
51 - name: Checkout code
52 uses: actions/checkout@v2
53
54 - name: Check Code Formatting
55 run: find . -name "*.go" | while read line; do [ -z "$(gofmt -d "$line" | head)" ] || exit 1; done
56
57 - name: Check Security (vulnerable dependencies and insecure practices)
58 run: make secure