2021-04-15 23:22:04 +08:00
|
|
|
name: Integration Test
|
|
|
|
|
|
|
|
on:
|
2022-12-19 19:10:02 +08:00
|
|
|
workflow_dispatch:
|
2022-07-27 02:09:20 +08:00
|
|
|
pull_request:
|
2022-12-19 19:19:10 +08:00
|
|
|
types: [opened, synchronize, reopened]
|
2021-04-15 23:22:04 +08:00
|
|
|
|
|
|
|
jobs:
|
2023-01-11 21:25:07 +08:00
|
|
|
|
2022-01-23 05:17:28 +08:00
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2022-11-10 23:52:44 +08:00
|
|
|
uses: actions/checkout@v3
|
2022-01-23 05:17:28 +08:00
|
|
|
- name: Setup Go
|
2022-12-06 23:52:37 +08:00
|
|
|
uses: actions/setup-go@v3
|
2022-01-23 05:17:28 +08:00
|
|
|
with:
|
2022-11-11 05:06:03 +08:00
|
|
|
go-version: 1.19
|
2022-01-23 05:17:28 +08:00
|
|
|
- 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-11 21:25:07 +08:00
|
|
|
|
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
|
2023-01-11 21:25:07 +08:00
|
|
|
|
|
|
|
tests:
|
|
|
|
runs-on: ubuntu-22.04
|
2022-05-06 03:30:01 +08:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2022-11-10 23:52:44 +08:00
|
|
|
uses: actions/checkout@v3
|
2022-05-06 03:30:01 +08:00
|
|
|
- name: Setup Go
|
2022-12-06 23:52:37 +08:00
|
|
|
uses: actions/setup-go@v3
|
2022-05-06 03:30:01 +08:00
|
|
|
with:
|
2022-11-11 05:06:03 +08:00
|
|
|
go-version: 1.19
|
2023-01-11 21:25:07 +08:00
|
|
|
- name: run tests
|
2022-05-06 03:30:01 +08:00
|
|
|
run: |
|
2023-02-16 18:11:30 +08:00
|
|
|
go vet ./...
|
2023-01-11 21:25:07 +08:00
|
|
|
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
|
2022-07-06 22:44:59 +08:00
|
|
|
runs-on: ubuntu-22.04
|
2021-04-15 23:22:04 +08:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2022-11-10 23:52:44 +08:00
|
|
|
uses: actions/checkout@v3
|
2022-01-07 04:05:38 +08:00
|
|
|
- name: Setup Go
|
2022-12-06 23:52:37 +08:00
|
|
|
uses: actions/setup-go@v3
|
2022-01-07 04:05:38 +08:00
|
|
|
with:
|
2022-11-11 05:06:03 +08:00
|
|
|
go-version: 1.19
|
2023-01-11 21:25:07 +08:00
|
|
|
- name: run static checks
|
2021-04-15 23:22:04 +08:00
|
|
|
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 ./... ; }
|