Additional testing and incremental refactor #22
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go | |
name: Lint | Test | Build | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
lint: | |
timeout-minutes: 10 | |
runs-on: ubuntu-latest | |
steps: | |
- | |
uses: actions/checkout@v4 | |
- | |
name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.21.5' | |
- | |
name: Install lint deps | |
shell: bash --noprofile --norc -x -eo pipefail {0} | |
run: | | |
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.53.3 | |
- | |
name: Build ui | |
working-directory: ./ui/web | |
run: | | |
curl -fsSL https://get.pnpm.io/install.sh | SHELL=bash sh - | |
~/.local/share/pnpm/pnpm install | |
~/.local/share/pnpm/pnpm build | |
- | |
name: Run Lint | |
shell: bash --noprofile --norc -x -eo pipefail {0} | |
run: | | |
golangci-lint run --timeout 5m | |
test: | |
timeout-minutes: 10 | |
runs-on: ubuntu-latest | |
steps: | |
- | |
uses: actions/checkout@v4 | |
- | |
name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.21.5' | |
- | |
name: Symlink go | |
run: sudo ln -f -s /opt/hostedtoolcache/go/1.21.5/x64/bin/* /usr/bin/ | |
- | |
name: Install ginkgo | |
shell: bash --noprofile --norc -x -eo pipefail {0} | |
run: | | |
go install github.com/onsi/ginkgo/v2/ginkgo@latest | |
- | |
name: Build agent | |
working-directory: ./agent/cmd/nex-agent | |
run: go build -tags netgo -ldflags '-extldflags "-static"' | |
- | |
name: Build ui | |
working-directory: ./ui/web | |
run: | | |
curl -fsSL https://get.pnpm.io/install.sh | SHELL=bash sh - | |
~/.local/share/pnpm/pnpm install | |
~/.local/share/pnpm/pnpm build | |
- | |
name: Run spec suite | |
working-directory: . | |
run: sudo -E go run github.com/onsi/ginkgo/v2/ginkgo -r --randomize-all --randomize-suites --vv --trace --keep-going --output-interceptor-mode=none ./spec | |
- | |
name: Run test suite | |
working-directory: . | |
run: go test -v -race ./test | |
build: | |
timeout-minutes: 10 | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- | |
name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.21.5' | |
- | |
name: Run GoReleaser | |
uses: goreleaser/goreleaser-action@v5 | |
with: | |
distribution: goreleaser | |
version: latest | |
args: build --clean --snapshot | |