Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/CI&CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ jobs:
~/.cache/go-build
~/.cache/golangci-lint
.buildcache
key: v1-go-with-tools-${{ runner.os }}-${{ matrix.go }}-${{ hashFiles('tools.go') }}-${{ hashFiles('go.sum') }}
key: v1-go-with-tools-${{ runner.os }}-${{ env.GO_VERSION }}-${{ hashFiles('0-tools.go') }}-${{ hashFiles('go.sum') }}
restore-keys: |
v1-go-with-tools-${{ runner.os }}-${{ matrix.go }}-${{ hashFiles('tools.go') }}-
v1-go-with-tools-${{ runner.os }}-${{ matrix.go }}-
v1-go-with-tools-${{ runner.os }}-${{ env.GO_VERSION }}-${{ hashFiles('0-tools.go') }}-
v1-go-with-tools-${{ runner.os }}-${{ env.GO_VERSION }}-

- run: scripts/test

Expand Down Expand Up @@ -74,10 +74,10 @@ jobs:
~/.cache/go-build
~/.cache/golangci-lint
.buildcache
key: v1-go-with-tools-${{ runner.os }}-${{ matrix.go }}-${{ hashFiles('tools.go') }}-${{ hashFiles('go.sum') }}
key: v1-go-with-tools-${{ runner.os }}-${{ env.GO_VERSION }}-${{ hashFiles('0-tools.go') }}-${{ hashFiles('go.sum') }}
restore-keys: |
v1-go-with-tools-${{ runner.os }}-${{ matrix.go }}-${{ hashFiles('tools.go') }}-
v1-go-with-tools-${{ runner.os }}-${{ matrix.go }}-
v1-go-with-tools-${{ runner.os }}-${{ env.GO_VERSION }}-${{ hashFiles('0-tools.go') }}-
v1-go-with-tools-${{ runner.os }}-${{ env.GO_VERSION }}-

# Add support for more platforms with QEMU (optional)
# https://github.com/docker/setup-qemu-action
Expand Down
2 changes: 2 additions & 0 deletions tools.go → 0-tools.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
//go:build generate

// NOTE: Prefix 0- in this file's name ensures that `go generate ./...` processes it first.

//go:generate mkdir -p .buildcache/bin
//go:generate -command GOINSTALL env "GOBIN=$PWD/.buildcache/bin" go install
//go:generate -command INSTALL-HADOLINT sh -c ".buildcache/bin/hadolint --version 2>/dev/null | grep -wq \"$DOLLAR{DOLLAR}{1}\" || curl -sSfL https://github.com/hadolint/hadolint/releases/download/v\"$DOLLAR{DOLLAR}{1}\"/hadolint-\"$(uname)\"-x86_64 --output ./.buildcache/bin/hadolint && chmod +x .buildcache/bin/hadolint" -sh
Expand Down
2 changes: 1 addition & 1 deletion scripts/cover
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
export PATH="$PWD/.buildcache/bin:$PATH"
set -e -o pipefail
go generate tools.go
go generate 0-tools.go

gotestsum -- \
-coverpkg="$(go list ./... | paste -s -d,)" \
Expand Down
2 changes: 1 addition & 1 deletion scripts/release
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
export PATH="$PWD/.buildcache/bin:$PATH"
set -x -e -o pipefail
go generate tools.go
go generate 0-tools.go

DIST_DIR=bin
TAG=$(git describe --match='v*' --exact-match --tags)
Expand Down
2 changes: 1 addition & 1 deletion scripts/test
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
export PATH="$PWD/.buildcache/bin:$PATH"
set -x -e -o pipefail
go generate tools.go
go generate 0-tools.go

hadolint Dockerfile

Expand Down
Loading