-
Notifications
You must be signed in to change notification settings - Fork 279
55 lines (47 loc) · 1.26 KB
/
test.yml
File metadata and controls
55 lines (47 loc) · 1.26 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
name: Test
on:
push:
pull_request:
types: [opened, synchronize, reopened]
jobs:
test:
permissions:
contents: read
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
steps:
- name: Checkout codebase
uses: actions/checkout@v4.2.2
- name: Set up Go
uses: actions/setup-go@v5.4.0
with:
go-version-file: go.mod
cache: true
check-latest: true
- name: Cleanup old coverage files
shell: bash
run: |
rm -f coverage.txt || true # For all operating systems
- name: Install dependencies
shell: bash
run: go mod tidy
- name: Run Tests
shell: bash
run: go test -race -coverprofile=coverage.txt -covermode=atomic ./...
- name: Upload Coverage
uses: codecov/codecov-action@v5.4.2
if: success()
security:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.2.2
- run: |
go install github.com/securego/gosec/v2/cmd/gosec@latest
export PATH="$PATH:$(go env GOPATH)/bin"
gosec ./...
- name: Test
run: go test -timeout 1h -v ./...