Skip to content

Maven/access2

Maven/access2 #2300

Workflow file for this run

name: lint-and-test
on:
pull_request_target:
push:
branches:
- main
workflow_dispatch:
workflow_call:
permissions:
contents: read
pull-requests: read
jobs:
test:
name: Run tests
runs-on: large_runner
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Cache go-build and mod
uses: actions/cache@v4
with:
path: |
~/.cache/go-build/
~/go/pkg/mod/
key: go-${{ hashFiles('go.sum') }}
restore-keys: |
go-
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: '${{ github.workspace }}/go.mod'
- name: Unit test
run: |
PATH=$PATH:$(go env GOPATH)/bin make build
PATH=$PATH:$(go env GOPATH)/bin make test
lint:
name: Lint
runs-on: large_runner
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Cache go-build and mod
uses: actions/cache@v4
with:
path: |
~/.cache/go-build/
~/go/pkg/mod/
key: go-${{ hashFiles('go.sum') }}
restore-keys: |
go-
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: '${{ github.workspace }}/go.mod'
- name: Install goimports
run: |
go install golang.org/x/tools/cmd/goimports@latest
- name: Setup lint
run: |
make -f hack/Makefile golangci-lint
#curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.54.2
- name: Lint
run: |
PATH=$PATH:$(go env GOPATH)/bin make check
generate:
name: DeepCopy verification
runs-on: large_runner
steps:
- name: Self Hosted Runner Post Job Cleanup Action
uses: TooMuch4U/actions-clean@v2.2
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Cache go-build and mod
uses: actions/cache@v4
with:
path: |
~/.cache/go-build/
~/go/pkg/mod/
key: go-${{ hashFiles('go.sum') }}
restore-keys: |
go-
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: '${{ github.workspace }}/go.mod'
- name: Generate DeepCopy
run: |
PATH=$PATH:$(go env GOPATH)/bin make generate-deepcopy
- name: Check for diff
run: |
git diff --exit-code --shortstat