-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (42 loc) · 1.02 KB
/
validate_pr.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
name: Validate Pull Request
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
GO_VERSION_FILE: 'go.mod'
jobs:
run-lint:
name: Run Linter
runs-on: [main]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: ${{ env.GO_VERSION_FILE }}
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: latest
run-tests:
name: Run Tests
needs: [run-lint]
runs-on: [main]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: ${{ env.GO_VERSION_FILE }}
cache: false
- name: Set up gotestfmt
uses: gotesttools/gotestfmt-action@v2
- name: Run Tests
run: |
set -euo pipefail
go test -json -v ./... 2>&1 | tee //tmp/gotest.log | gotestfmt