Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
74 lines (59 loc) · 1.94 KB
/
Copy pathMakefile
File metadata and controls
74 lines (59 loc) · 1.94 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
MAKEFLAGS = -rR --warn-unused-variables
ARGS ?=
VERBOSE ?=
.PHONY: test
test:
env NOMAD_NAMESPACE= NOMAD_TOKEN= pytest -v tests/unit
vagrant_test:
vagrant up
vagrant ssh -- -t 'cd /app && ./integration_tests.sh $(ARGS)'
vagrant_destroy:
vagrant destroy -f
lint: pyright pylava ruff
pyright:
uv run --with pyright --with pytest pyright $(ARGS)
pylava:
pylava src/ tests/ $(ARGS)
ruff:
ruff check $(ARGS)
autofix:
uvx ruff check --select I --fix
uvx ruff check --fix
uvx ruff format
integration_tests:
./integration_tests.sh $(ARGS)
paralell_integration_tests:
./integration_tests.sh -n auto $(ARGS)
importtime: ARGS=entry
importtime:
python -X importtime -c 'import nomad_tools.$(ARGS)' 2>build/importtime.log
tuna build/importtime.log
try_docker_integration_test:
docker build --target integration -f ./tests/Dockerfile.integration_test -t tmp .
docker run --network=host --privileged -ti --rm tmp \
bash -xeuc ' \
dockerd & \
./tests/provision.sh nomad_start & \
sleep 10 && \
./integration_tests.sh \
'
export PATH := $(PATH):$(HOME)/.local/bin/
run_githubrunner_locally:
. ./.env && nomadtools githubrunner -c ./deploy/githubrunner.yml $(ARGS) run
run_githubrunner:
. ./.env && nomadtools watch run \
-var GITHUB_TOKEN=$$GITHUB_TOKEN \
-var NOMAD_TOKEN=$$NOMAD_TOKEN \
-var NOMAD_NAMESPACE=$$NOMAD_NAMESPACE \
-var VERBOSE=$(VERBOSE) \
./deploy/nomadtools-githubrunner.nomad.hcl
listrunners:
. ~/.env_nomad && watch -n1 nomadtools githubrunner -q listrunners
remote_run_githubrunner_locally:
. ~/.env_nomad && $(MAKE) run_githubrunner_locally
weles_rsync:
,rsync --exclude=*/__pycache__/ --no-group --no-owner $(CURDIR)/ kamil@weles:./myprojects/nomad-tools/
weles_run_githubrunner_locally: weles_rsync
ssh -t kamil@weles make -C ./myprojects/nomad-tools/ "ARGS=$(ARGS)" run_githubrunner_locally
weles_run_githubrunner: weles_rsync
ssh -t kamil@weles make -C ./myprojects/nomad-tools/ "ARGS=$(ARGS)" run_githubrunner