59 lines
1.7 KiB
YAML
59 lines
1.7 KiB
YAML
name: Lint
|
|
on:
|
|
workflow_dispatch:
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- master
|
|
# Limit one unit test job running per PR/Branch
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
# For example, if you push multiple commits to a pull request in quick succession, only the latest workflow run will continue
|
|
cancel-in-progress: true
|
|
env:
|
|
GOPROXY: https://proxy.golang.org
|
|
GO_VERSION: '1.24.0'
|
|
permissions:
|
|
contents: read
|
|
jobs:
|
|
Lint-Boilerplate-Tidy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
|
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5
|
|
with:
|
|
go-version: ${{env.GO_VERSION}}
|
|
cache: true
|
|
- name: Download Dependencies
|
|
run: go mod download
|
|
# needed because pkg/drivers/kvm/domain.go:28:2:
|
|
- name: Install libvirt (Linux)
|
|
if: runner.os == 'Linux'
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y libvirt-dev
|
|
- name: Lint
|
|
timeout-minutes: 8
|
|
env:
|
|
TESTSUITE: lint
|
|
run: make test
|
|
continue-on-error: false
|
|
- name: Boilerplate check
|
|
timeout-minutes: 2
|
|
env:
|
|
TESTSUITE: boilerplate
|
|
run: make test
|
|
continue-on-error: false
|
|
- name: Verify gomod tidy
|
|
timeout-minutes: 2
|
|
continue-on-error: false
|
|
run: |
|
|
make gomodtidy
|
|
if ! git diff --quiet; then
|
|
echo "::error::Please run 'make gomodtidy' and commit the changes"
|
|
git diff --name-only
|
|
exit 1
|
|
fi
|
|
|
|
|