ci/gha: add lint job

This is currently similar to what make validate does in .cirrus.yml,
but let's have it as a separate job since it it faster.

Let's keep the same job in Cirrus CI for now.

Note we do not ping Go version, but rather depend on action/setup-go to
know which one is latest.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
Kir Kolyshkin 2022-04-11 15:05:09 -07:00
parent 82bf88ed0c
commit a663d96294
1 changed files with 19 additions and 0 deletions

View File

@ -7,6 +7,8 @@ on:
- main - main
- v* - v*
pull_request: pull_request:
env:
LINT_VERSION: v1.45
jobs: jobs:
codespell: codespell:
@ -18,3 +20,20 @@ jobs:
run: pip install codespell run: pip install codespell
- name: run codespell - name: run codespell
run: codespell run: codespell
lint:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.x # latest stable
- name: install deps
run: |
sudo apt-get -qq update
sudo apt-get -qq install libseccomp-dev libdevmapper-dev
- name: lint
uses: golangci/golangci-lint-action@v3
with:
version: "${{ env.LINT_VERSION }}"
- name: validate seccomp
run: ./tools/validate_seccomp.sh ./pkg/seccomp