nezha/.github/workflows/test.yml

34 lines
763 B
YAML
Raw Normal View History

2021-09-04 12:51:02 +08:00
name: Run Tests
2021-09-04 12:18:12 +08:00
on:
push:
branches:
- master
2021-11-03 21:40:22 +08:00
paths-ignore:
2022-04-18 20:45:07 +08:00
- ".github/workflows/codeql-analysis.yml"
2021-11-03 21:40:22 +08:00
- ".github/workflows/test-on-pr.yml"
2023-05-08 12:48:50 +08:00
- ".github/workflows/contributors.yml"
2021-11-03 21:40:22 +08:00
- "README.md"
- ".goreleaser.yml"
2021-09-04 12:18:12 +08:00
jobs:
tests:
runs-on: ubuntu-latest
env:
GO111MODULE: on
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v4
2021-11-04 12:55:12 +08:00
with:
go-version: "^1.20.0"
2021-09-04 12:18:12 +08:00
- name: Unit test
run: |
go test -v ./...
2021-09-04 12:19:59 +08:00
- name: Build test
run: |
go build cmd/dashboard/main.go
2021-09-04 12:18:12 +08:00
- name: Run Gosec Security Scanner
2021-11-04 13:02:07 +08:00
run: |
go install github.com/securego/gosec/v2/cmd/gosec@latest
2022-12-16 23:34:14 +08:00
gosec -exclude=G104 ./...