Skip to content

Commit

Permalink
Add special handling for installing linter in CI
Browse files Browse the repository at this point in the history
Don't download the linter unless a special CI env setting is set. Also
use a different cache to avoid permissions issues with the rootfs in
CI.

Signed-off-by: William Douglas <[email protected]>
  • Loading branch information
bryteise committed Jan 30, 2024
1 parent bb53ba0 commit e514207
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ checkcoverage:

.PHONY: lint
lint:
@if ! $(gopath)/bin/golangci-lint --version &>/dev/null; then \
@if [ ! -z "${CI_ONLY}" ]; then \
echo "Installing linters..."; \
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(gopath)/bin v1.55.2; \
fi
Expand Down
2 changes: 2 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ cd /home/clr/mixer-tools

run_precheck() {
make && sudo -E make install
export CI_ONLY=1
export GOLANGCI_LINT_CACHE=/tmp/.golangci-lint
make lint && make check
}

Expand Down

0 comments on commit e514207

Please sign in to comment.