-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathMakefile
104 lines (81 loc) · 3.02 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
.PHONY: help
help: ## Lists the available commands. Add a comment with '##' to describe a command.
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST)\
| sort\
| awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: tests
tests: ## Execute all the tests
@cargo test --verbose
.PHONY: build
build: tests ## Execute all the tests and build funzzy binary
@cargo build --release
.PHONY: prebuild
prebuild: ## Build the project in non-release mode
@cargo build
.PHONY: integration ## Exectute integration tests
integration:
@cargo test --features test-integration
.PHONY: integration-e2e ## Exectute integration tests
integration-e2e: integration-clean
@cargo test --features test-integration-e2e
.PHONY: ci-enable-hook
ci-enable-hook: ## Enable the pre-push hook
@ln -fs "${PWD}/scripts/git-hooks-checks" "${PWD}/.git/hooks/pre-push"
@chmod +x "${PWD}/.git/hooks/pre-push"
.PHONY: ci-integration
ci-integration: integration-clean
@cargo test --features test-integration
.PHONY: ci-run-on-push
ci-run-on-push: ## Run checks from .github/workflows/on-push.yml
@cat .github/workflows/on-push.yml \
| yq '.jobs | .[] | .steps | .[] | .run | select(. != null)' \
| xargs -I {} bash -c {}
.PHONY: fmt
fmt: ## Format the code (with cargo fmt) and add the changes to the git stage
@cargo fmt
.PHONY: lint
lint:
@cargo fmt -- --check
.PHONY: linter
linter: lint
.PHONY: install
install: tests ## Install funzzy on your machine
GITSHA="$(shell git rev-parse --short HEAD)" cargo install --path .
.PHONY: integration-clean
integration-clean:
echo "Creating a temp dir for integration tests in /tmp/fzz"
rm -rf /tmp/fzz
mkdir -p /tmp/fzz
.PHONY: nix-gen-patch
nix-gen-patch: ## Generate a patch for the nix derivation
@git diff origin/master -r -u > nix/gitdiff.patch
.PHONY: nix-flake-check
nix-flake-check: ## Check the nix flake
@nix flake check
.PHONY: nix-build-all
nix-build-all: nix-build nix-build-nightly ## Build the nix derivation with the nightly toolchain
echo "Done"
.PHONY: nix-build-local
nix-build-local: ## Build the nix derivation with the local toolchain
@nix build .#local --verbose -L
.PHONY: nix-build-nightly
nix-build-nightly: ## Build the nix derivation with the nightly toolchain
@nix build .# --verbose -L
.PHONY: nix-build
nix-build: ## Build the nix derivation with the nightly toolchain
@nix build .# --verbose -L
.PHONY: nix-bump-default
nix-bump-default: ## Bump the version in nix default package and generate a new revision
@echo "Bumping the version in nix default"
scripts/bump-nix-default
.PHONY: nix-bump-nightly
nix-bump-nightly: ## Bump the version in nix nightly package and generate a new revision
@echo "Bumping the version in nix packages"
scripts/bump-nix-nightly
.PHONY: nix-bump-local
nix-bump-local: ## Bump the version in nix local package and generate a new revision
@echo "Bumping the version in nix packages"
scripts/bump-nix-local
.PHONY: nix-bump-all
nix-bump-all: nix-bump-default nix-bump-nightly ## Bump all nix revisions
@echo "Bumping all nix packages"