Skip to content

Commit

Permalink
Move ci-checks.sh to a make target:
Browse files Browse the repository at this point in the history
This allows us to check for nix-shell
and use docker if nix-shell is not installed.
Update CI to use the make target.

Signed-off-by: Jacob Weinstock <[email protected]>
  • Loading branch information
jacobweinstock committed May 10, 2023
1 parent ff98222 commit 307de72
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ jobs:
uses: cachix/install-nix-action@v20
with:
nix_path: nixpkgs=channel:nixos-unstable
- run: nix-shell --run 'true'
- run: PATH=$PWD/bin/:$PATH ./ci-checks.sh
- name: Run ci-checks.sh
run: nix-shell --run 'make ci-checks'
# We preemptively build the binaries for efficiency instead of waiting on unit tests to pass
# hence this doesn't depend on anything.
build:
Expand Down
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,14 @@ check-proto: generate-proto
verify: lint check-generated ## Verify code style, is lint free, freshness ...
$(GOFUMPT) -s -d .

.PHONY: ci-checks
ci-checks: ## Run ci-checks.sh script
@if type nix-shell 2>&1 > /dev/null; then \
./ci-checks.sh; \
else \
docker run -it --rm -v $${PWD}:/code -w /code nixos/nix nix-shell --run 'make ci-checks'; \
fi

.PHONY: lint
lint: shellcheck hadolint golangci-lint yamllint ## Lint code

Expand Down

0 comments on commit 307de72

Please sign in to comment.