-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
58 lines (48 loc) · 1.48 KB
/
justfile
File metadata and controls
58 lines (48 loc) · 1.48 KB
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
set positional-arguments
set shell := ["bash", "-cue"]
root_dir := `git rev-parse --show-toplevel`
flake_dir := root_dir / "tools/nix"
output_dir := root_dir / ".output"
build_dir := output_dir / "build"
mod nix "./tools/just/nix.just"
# Default target if you do not specify a target.
default:
just --list --unsorted
# Enter the default Nix development shell and execute the command `"$@`.
develop *args:
just nix::develop "default" "$@"
# Format the project.
format *args:
"{{root_dir}}/tools/scripts/setup-config-files.sh"
nix run --accept-flake-config {{flake_dir}}#treefmt -- "$@"
# Setup the project.
setup *args:
cd "{{root_dir}}" && ./tools/scripts/setup.sh
# Run commands over the ci development shell.
ci *args:
just nix::develop "ci" "$@"
main_package := "tool"
# Lint the project.
lint *args:
cd "src/{{main_package}}" && \
golangci-lint run \
--max-issues-per-linter 0 \
--max-same-issues 0 \
--timeout 10m0s \
--config "{{root_dir}}/tools/configs/golangci-lint/golangci.yaml" \
"$@"
# Build the project.
build *args:
mkdir -p "{{build_dir}}/{{main_package}}" && \
export GOBIN="{{build_dir}}/{{main_package}}" && \
cd "src/{{main_package}}" && \
go generate "$@" ./... && \
go install "$@" ./...
# Test the project.
test *args:
cd "src/{{main_package}}" && \
go test "$@" ./...
# Run an executable.
run *args:
cd "src/{{main_package}}" && \
go run "$@" ./cmd/cli/...