run-success.mk: Record last successful run
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 5m27s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 4m43s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 5m0s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 4m16s
CI / Packaging test (push) Successful in 0s
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 5m27s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 4m43s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 5m0s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 4m16s
CI / Packaging test (push) Successful in 0s
Add a run-success.mk which provides a $(RUN_SUCCESS_CREATE_MARKER) variable, and include it from run.mk and py-run.mk. If it's not overridden, it logs the current commit to a marker file if the run succeeds. The marker file is ignored from Git and cleaned in the context of the distclean target. The machinery can be customized by variables: RUN_SUCCESS_MARKER is the name of the marker file RUN_SUCCESS_RECORD_CMD is the generator for its content For example, putting this into local.mk or jw-pkg/make/local.mk will record the hashes of every repository in the entire workspace: define RUN_SUCCESS_RECORD_CMD make git-log-1 make git-log-tree-1 endef Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
24fec38f75
commit
2fcda74277
5 changed files with 24 additions and 5 deletions
8
.gitignore
vendored
8
.gitignore
vendored
|
|
@ -20,7 +20,6 @@
|
||||||
*tmp*
|
*tmp*
|
||||||
*~
|
*~
|
||||||
.cache-project.mk
|
.cache-project.mk
|
||||||
.cache-projects.mk
|
|
||||||
.exrc
|
.exrc
|
||||||
.feedfs_history
|
.feedfs_history
|
||||||
.gdb_history
|
.gdb_history
|
||||||
|
|
@ -38,20 +37,19 @@ bin/*.tcl
|
||||||
conftest.py
|
conftest.py
|
||||||
core
|
core
|
||||||
dist
|
dist
|
||||||
|
last-successful-run.txt
|
||||||
ld-*.conf
|
ld-*.conf
|
||||||
local.conf
|
local.conf
|
||||||
local.mk
|
local.mk
|
||||||
local.mk
|
|
||||||
local.yaml
|
local.yaml
|
||||||
make/*.pc
|
make/*.pc
|
||||||
make/ssh-wrapper.sh
|
|
||||||
mkspec.sh
|
mkspec.sh
|
||||||
pr-descr*.txt
|
pr-descr*.txt
|
||||||
pre-local.mk
|
pre-local.mk
|
||||||
pyproject.toml
|
pyproject.toml
|
||||||
pyrightconfig.json
|
pyrightconfig.json
|
||||||
test-out.txt
|
test-out.txt
|
||||||
test/integration/jw-pkg/projects/cache/test-pyproject.toml
|
|
||||||
test/integration/jw-pkg/projects/cache/test-pyrightconfig.json
|
|
||||||
!*.jw-tmpl
|
!*.jw-tmpl
|
||||||
!*.tmpl
|
!*.tmpl
|
||||||
|
.cache-projects.mk
|
||||||
|
make/ssh-wrapper.sh
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,7 @@ bin/*.tcl
|
||||||
conftest.py
|
conftest.py
|
||||||
core
|
core
|
||||||
dist
|
dist
|
||||||
|
last-successful-run.txt
|
||||||
ld-*.conf
|
ld-*.conf
|
||||||
local.conf
|
local.conf
|
||||||
local.mk
|
local.mk
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
include $(JWBDIR)/make/defs.mk
|
include $(JWBDIR)/make/defs.mk
|
||||||
include $(JWBDIR)/make/py-defs.mk
|
include $(JWBDIR)/make/py-defs.mk
|
||||||
include $(JWBDIR)/make/test-guard.mk
|
include $(JWBDIR)/make/test-guard.mk
|
||||||
|
include $(JWBDIR)/make/run-success.mk
|
||||||
|
|
||||||
EXE ?= $(firstword $(wildcard main.py runme.py test.py *.py))
|
EXE ?= $(firstword $(wildcard main.py runme.py test.py *.py))
|
||||||
EXE_ARGS ?=
|
EXE_ARGS ?=
|
||||||
|
|
@ -14,6 +15,7 @@ test: all testability
|
||||||
|
|
||||||
run:
|
run:
|
||||||
$(PYTHON_RUNNER) $(EXE) $(EXE_ARGS)
|
$(PYTHON_RUNNER) $(EXE) $(EXE_ARGS)
|
||||||
|
$(RUN_SUCCESS_CREATE_MARKER)
|
||||||
|
|
||||||
run.sh:
|
run.sh:
|
||||||
echo -e "#!/bin/bash\n\nexport PYTHONPATH=$(PYTHONPATH)\nset -x\nexec $(PYTHON) $(EXE)" '"$$@"' > $@.tmp
|
echo -e "#!/bin/bash\n\nexport PYTHONPATH=$(PYTHONPATH)\nset -x\nexec $(PYTHON) $(EXE)" '"$$@"' > $@.tmp
|
||||||
|
|
|
||||||
15
make/run-success.mk
Normal file
15
make/run-success.mk
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
ifndef RUN_SUCCESS_RECORD_CMD
|
||||||
|
RUN_SUCCESS_RECORD_CMD := git log --oneline -1
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifndef RUN_SUCCESS_MARKER
|
||||||
|
RUN_SUCCESS_MARKER := last-successful-run.txt
|
||||||
|
endif
|
||||||
|
|
||||||
|
RUN_SUCCESS_CREATE_MARKER = $(RUN_SUCCESS_RECORD_CMD) > $(RUN_SUCCESS_MARKER).tmp && \
|
||||||
|
mv $(RUN_SUCCESS_MARKER).tmp $(RUN_SUCCESS_MARKER)
|
||||||
|
all:
|
||||||
|
|
||||||
|
distclean: distclean.run-success
|
||||||
|
distclean.run-success:
|
||||||
|
rm -f $(RUN_SUCCESS_MARKER)
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
|
|
||||||
include $(JWBDIR)/make/defs.mk
|
include $(JWBDIR)/make/defs.mk
|
||||||
include $(JWBDIR)/make/defs-cpp.mk
|
include $(JWBDIR)/make/defs-cpp.mk
|
||||||
|
include $(JWBDIR)/make/run-success.mk
|
||||||
|
|
||||||
DIR_BASENAME = $(notdir $(CWD))
|
DIR_BASENAME = $(notdir $(CWD))
|
||||||
|
|
||||||
|
|
@ -76,6 +77,7 @@ run test: run-deps
|
||||||
@echo "wine $(EXE_CMD)"
|
@echo "wine $(EXE_CMD)"
|
||||||
@echo -e "set PATH=%PATH;$(DLL_PATH)\n" \
|
@echo -e "set PATH=%PATH;$(DLL_PATH)\n" \
|
||||||
"$(EXE_CMD)" | wine cmd
|
"$(EXE_CMD)" | wine cmd
|
||||||
|
$(RUN_SUCCESS_CREATE_MARKER)
|
||||||
|
|
||||||
start: run-deps
|
start: run-deps
|
||||||
@echo "wine $(EXE_CMD)"
|
@echo "wine $(EXE_CMD)"
|
||||||
|
|
@ -85,6 +87,7 @@ start: run-deps
|
||||||
else
|
else
|
||||||
run test: run-deps
|
run test: run-deps
|
||||||
$(EXE_CMD)
|
$(EXE_CMD)
|
||||||
|
$(RUN_SUCCESS_CREATE_MARKER)
|
||||||
start: run-deps
|
start: run-deps
|
||||||
$(EXE_CMD) &
|
$(EXE_CMD) &
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue