nezha/.github/workflows/test.yml

35 lines
798 B
YAML
Raw Normal View History

2021-09-04 00:51:02 -04:00
name: Run Tests
2021-09-04 00:18:12 -04:00
on:
push:
branches:
- master
2021-11-03 09:40:22 -04:00
paths-ignore:
- ".github/workflows/agent.yml"
2022-04-18 08:45:07 -04:00
- ".github/workflows/codeql-analysis.yml"
2021-11-03 09:40:22 -04:00
- ".github/workflows/test-on-pr.yml"
- "README.md"
- ".goreleaser.yml"
2021-09-04 00:18:12 -04:00
jobs:
tests:
runs-on: ubuntu-latest
env:
GO111MODULE: on
steps:
- uses: actions/checkout@v2
2021-11-04 00:55:12 -04:00
- uses: actions/setup-go@v2
with:
2022-08-12 23:40:10 -04:00
go-version: "^1.19.0"
2021-09-04 00:18:12 -04:00
- name: Unit test
run: |
go test -v ./...
2021-09-04 00:19:59 -04:00
- name: Build test
run: |
go build cmd/dashboard/main.go
go build cmd/agent/main.go
2021-09-04 00:18:12 -04:00
- name: Run Gosec Security Scanner
2021-11-04 01:02:07 -04:00
run: |
go install github.com/securego/gosec/v2/cmd/gosec@latest
2022-03-31 10:59:07 -04:00
gosec -exclude=G104,G404 ./...