Skip to content

Commit

Permalink
build: disable cache for golangci-lint
Browse files Browse the repository at this point in the history
Signed-off-by: Lukáš Zapletal <lzap+git@redhat.com>
  • Loading branch information
lzap authored and ezr-ondrej committed May 17, 2023
1 parent 4e0290f commit b74b9c2
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 24 deletions.
66 changes: 43 additions & 23 deletions .github/workflows/gotest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,51 @@ jobs:
make check-commits
working-directory: code
linting:
name: "🎯 Code format, imports and style"
build:
name: "🛠️ Go Build"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_SVR }}
cache: true
- name: Build all artifacts
run: |
make check-system-go build GO=go
lint:
name: "🎯 Code format & OpenAPI lint"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_SVR }}
# disabled until 'lookup-only' is implemented for setup-go or cache prefix is added
cache: false
- uses: actions/cache@v3
id: cache
with:
path: bin
key: bin-go${{ env.GO_SVR }}-tools-${{ hashFiles('mk/tools.mk') }}
- name: Install Go Tools
if: steps.cache.outputs.cache-hit != 'true'
run: make install-tools GO=go
- name: Generate and validate
run: |
touch config/_config.yaml
make check-system-go check-fmt validate GO=go
golint:
name: "🎯 Go linter"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_SVR }}
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
Expand All @@ -52,6 +89,8 @@ jobs:
- uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_SVR }}
# disabled until 'lookup-only' is implemented for setup-go or cache prefix is added
cache: false
- run: |
make check-system-go test GO=go
Expand Down Expand Up @@ -88,31 +127,12 @@ jobs:
- uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_SVR }}
# disabled until 'lookup-only' is implemented for setup-go or cache prefix is added
cache: false
- name: "Run tests"
env:
DATABASE_USER: postgres
DATABASE_PASSWORD: foobar
DATABASE_NAME: provisioning_test
WORKER_QUEUE: redis
run: make check-system-go integration-test check-migrations GO=go

openapi:
name: "🪆 Generated code diff check"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_SVR }}
- uses: actions/cache@v3
id: cache
with:
path: bin
key: bin-go${{ env.GO_SVR }}-tools-${{ hashFiles('mk/tools.mk') }}
- name: Install Go Tools
if: steps.cache.outputs.cache-hit != 'true'
run: make install-tools GO=go
- name: Generate and validate
run: |
touch config/_config.yaml
make check-system-go validate GO=go
6 changes: 5 additions & 1 deletion mk/code.mk
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ check-commits: ## Check commit format
.PHONY: fmt ## Alias to perform all code formatting and linting
fmt: format imports lint

.PHONY: check ## Alias to perform all checking (commits, migrations)
.PHONY: check-fmt ## Reformat the code and check git diff
check-fmt: format imports
git diff --exit-code

.PHONY: check ## Alias to perform commit message and migration checking
check: check-commits check-migrations

0 comments on commit b74b9c2

Please sign in to comment.