nezha/.github/workflows/test.yml

46 lines
877 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
paths:
- "**.go"
- "go.mod"
- "go.sum"
- "resource/**"
- ".github/workflows/test.yml"
pull_request:
branches:
- master
2021-11-03 09:40:22 -04:00
2021-09-04 00:18:12 -04:00
jobs:
tests:
strategy:
fail-fast: true
matrix:
os: [ubuntu, windows, macos]
runs-on: ${{ matrix.os }}-latest
2021-09-04 00:18:12 -04:00
env:
GO111MODULE: on
steps:
2023-10-21 06:27:25 -04:00
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
2021-11-04 00:55:12 -04:00
with:
go-version: "1.21.x"
2021-09-04 00:18:12 -04:00
- name: Unit test
run: |
go test -v ./...
- name: Build test
run: go build -v ./cmd/dashboard
2021-09-04 00:18:12 -04:00
- name: Run Gosec Security Scanner
if: runner.os == 'Linux'
2023-10-21 06:27:25 -04:00
uses: securego/gosec@master
with:
2024-10-01 22:10:06 -04:00
args: --exclude=G104,G402,G115,G203 ./...