Skip to content

fix linting and add golangci-lint #64

fix linting and add golangci-lint

fix linting and add golangci-lint #64

Workflow file for this run

name: CI
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on: [push, pull_request]
env:
GOTOOLCHAIN: local
jobs:
lint:
name: Golang-CI Lint
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Install Go
uses: actions/setup-go@v6
with:
go-version: stable
- name: Install golangci-lint
uses: golangci/golangci-lint-action@v9
with:
args: --verbose --show-stats
test:
name: Unit test
timeout-minutes: 10
strategy:
matrix:
go-version: [1.13.x, oldstable, stable]
platform: [ubuntu-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Install Go
uses: actions/setup-go@v6
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v6
- name: Validate headers
if: startsWith(matrix.go-version, '1.13') == false
run: |
go install github.com/containerd/ltag@latest \
&& ./scripts/validate/fileheader
- name: Test
run: go test -race -v ./...