netmaker/.github/workflows/test.yml

74 lines
1.7 KiB
YAML
Raw Normal View History

name: Integration Test
on:
workflow_dispatch:
2022-07-27 02:09:20 +08:00
pull_request:
2022-12-19 19:19:10 +08:00
types: [opened, synchronize, reopened]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.19
- name: Build
run: |
2022-03-05 02:36:48 +08:00
env CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build main.go
2022-09-23 03:30:09 +08:00
env CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -tags=ee main.go
2023-01-03 23:13:16 +08:00
nmctl:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup go
uses: actions/setup-go@v3
with:
go-version: 1.19
2023-01-03 23:14:31 +08:00
- name: Build
2023-01-03 23:13:16 +08:00
run: |
cd cli
GOOS=linux GOARCH=amd64 go build -o nmctl
GOOS=darwin GOARCH=amd64 go build -o nmctl
GOOS=darwin GOARCH=arm64 go build -o nmctl
GOOS=windows GOARCH=amd64 go build -o nmctl
tests:
runs-on: ubuntu-22.04
2022-05-06 03:30:01 +08:00
steps:
- name: Checkout
uses: actions/checkout@v3
2022-05-06 03:30:01 +08:00
- name: Setup Go
uses: actions/setup-go@v3
2022-05-06 03:30:01 +08:00
with:
go-version: 1.19
- name: run tests
2022-05-06 03:30:01 +08:00
run: |
go vet ./...
go test -p 1 ./... -v
env:
DATABASE: sqlite
CLIENT_MODE: "off"
staticcheck:
2022-05-06 02:03:08 +08:00
env:
2022-05-06 02:05:43 +08:00
DATABASE: sqlite
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
2022-01-07 04:05:38 +08:00
- name: Setup Go
uses: actions/setup-go@v3
2022-01-07 04:05:38 +08:00
with:
go-version: 1.19
- name: run static checks
run: |
2022-11-30 19:02:44 +08:00
sudo apt update
2022-11-29 03:13:58 +08:00
go install honnef.co/go/tools/cmd/staticcheck@latest
{ ~/go/bin/staticcheck -tags=ee ./... ; }