-
Notifications
You must be signed in to change notification settings - Fork 2
38 lines (35 loc) · 990 Bytes
/
testing.yml
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
name: Testing
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
GOLANGCI_LINT_TIMEOUT: 5m
jobs:
cancel-previous-workflows:
name: Cancel previous workflows
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
# https://github.com/styfle/cancel-workflow-action#advanced-token-permissions
permissions:
actions: write
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5
with:
access_token: ${{ github.token }}
code-quality-test:
runs-on: ubuntu-latest
steps:
- name: "Checkout code"
uses: actions/checkout@v3
- name: "Set up Go"
uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'
cache: true
- name: "Check code quality"
uses: golangci/golangci-lint-action@v3
with:
args: --timeout=${{ env.GOLANGCI_LINT_TIMEOUT }}