Skip to content

Add golangci-lint job in CI #38

Add golangci-lint job in CI

Add golangci-lint job in CI #38

Workflow file for this run

name: Tests
on:
pull_request:
push:
permissions:
contents: read
jobs:
golangci-lint:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version-file: hack/ccp/go.mod
cache-dependency-path: hack/ccp/go.sum
- name: Get date
id: get-date
shell: bash
run: |
echo "::set-output name=date::$(date -u "+%Y-%m")"
- name: Restore golangci-lint cache
uses: actions/cache@v4
timeout-minutes: 10
continue-on-error: true
with:
path: ${{ runner.temp }}/golangci-lint-cache
key: ${{ runner.os }}-golangci-lint-cache-${{ steps.get-date.outputs.date }}
restore-keys: |
${{ runner.os }}-golangci-lint-cache-
- name: Run golangci-lint
run: make lint
env:
GOLANGCI_LINT_CACHE: ${{ runner.temp }}/golangci-lint-cache
working-directory: hack/ccp
test:
name: Test
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version-file: hack/ccp/go.mod
cache-dependency-path: hack/ccp/go.sum
- name: Run tests
run: go test -race ./...
working-directory: hack/ccp