Skip to content

Commit

Permalink
Add Github workflow grouping (#1406)
Browse files Browse the repository at this point in the history
Co-authored-by: Erik Sundell <[email protected]>
  • Loading branch information
mathbunnyru and consideRatio authored Jul 16, 2021
1 parent fc40290 commit 493a9ba
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@ help:


build/%: DARGS?=
build/%: ## build the latest image for a stack
docker build $(DARGS) --rm --force-rm -t $(OWNER)/$(notdir $@):latest --build-arg OWNER=$(OWNER) ./$(notdir $@)
build/%: ## build the latest image for a stack using the system's architecture
@echo "::group::Build $(OWNER)/$(notdir $@) (system's architecture)"
docker build $(DARGS) --rm --force-rm -t $(OWNER)/$(notdir $@):latest ./$(notdir $@) --build-arg OWNER=$(OWNER)
@echo -n "Built image size: "
@docker images $(OWNER)/$(notdir $@):latest --format "{{.Size}}"
@echo "::endgroup::"
build-all: $(foreach I, $(ALL_IMAGES), build/$(I)) ## build all stacks
build-test-all: $(foreach I, $(ALL_IMAGES), build/$(I) test/$(I)) ## build and test all stacks

Expand Down Expand Up @@ -110,7 +112,9 @@ pull-all: $(foreach I, $(ALL_IMAGES), pull/$(I)) ## pull all images

push/%: DARGS?=
push/%: ## push all tags for a jupyter image
@echo "::group::Push $(OWNER)/$(notdir $@) (system's architecture)"
docker push --all-tags $(DARGS) $(OWNER)/$(notdir $@)
@echo "::endgroup::"
push-all: $(foreach I, $(ALL_IMAGES), push/$(I)) ## push all tagged images


Expand All @@ -126,7 +130,9 @@ run-sudo/%: ## run a bash in interactive mode as root in a stack


test/%: ## run tests against a stack (only common tests or common tests + specific tests)
@echo "::group::test/$(OWNER)/$(notdir $@)"
@if [ ! -d "$(notdir $@)/test" ]; then TEST_IMAGE="$(OWNER)/$(notdir $@)" pytest -m "not info" test; \
else TEST_IMAGE="$(OWNER)/$(notdir $@)" pytest -m "not info" test $(notdir $@)/test; fi
@echo "::endgroup::"

test-all: $(foreach I, $(ALL_IMAGES), test/$(I)) ## test all stacks

0 comments on commit 493a9ba

Please sign in to comment.