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 2aa8ed1 commit bf125c9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@ 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; \
export GOLANGCI_LINT_CACHE=/tmp/.golangci-lint; \
fi
@$(gopath)/bin/golangci-lint run --deadline=10m --tests --disable-all \
--enable=misspell \
Expand Down
1 change: 1 addition & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ cd /home/clr/mixer-tools

run_precheck() {
make && sudo -E make install
export CI_ONLY=1
make lint && make check
}

Expand Down

0 comments on commit bf125c9

Please sign in to comment.