nezha/.github/workflows/test.yml

47 lines
1.2 KiB
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:
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"
2023-05-08 00:48:50 -04:00
- ".github/workflows/contributors.yml"
2023-10-26 11:29:20 -04:00
- ".github/workflows/sync.yml"
2023-11-28 10:18:29 -05:00
- ".github/workflows/release.yml"
2021-11-03 09:40:22 -04:00
- "README.md"
- ".goreleaser.yml"
2021-09-04 00:18:12 -04:00
jobs:
tests:
runs-on: ubuntu-latest
env:
GO111MODULE: on
steps:
2023-10-21 06:27:25 -04:00
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
2021-11-04 00:55:12 -04:00
with:
2023-10-21 06:27:25 -04:00
go-version: "^1.21.3"
2021-09-04 00:18:12 -04:00
- name: Unit test
run: |
go test -v ./...
- name: Run Gosec Security Scanner
2023-10-21 06:27:25 -04:00
uses: securego/gosec@master
with:
2023-10-21 10:21:21 -04:00
args: --exclude=G104,G402 ./...
2023-11-29 02:45:32 -05:00
- name: xgo build
uses: crazy-max/ghaction-xgo@v2
with:
xgo_version: latest
go_version: 1.21
dest: dist
pkg: cmd/dashboard
prefix: dashboard
targets: linux/amd64,linux/arm64,linux/arm-7,linux/s390x,linux/riscv64 # linux/386,
v: true
x: false
race: false
ldflags: -s -w --extldflags '-static -fpic' -X github.com/naiba/nezha/service/singleton.Version=test
buildmode: default