diff options
Diffstat (limited to '')
-rw-r--r-- | .github/workflows/ci.yml | 10 | ||||
-rw-r--r-- | Makefile | 32 |
2 files changed, 26 insertions, 16 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dedadd7..96d8d0b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,10 +32,10 @@ jobs: run: pip install -q -e . - name: Verify that scripts are runnable run: cgitize --version - - name: Integration test (local) - run: ./test/integration/local/test.sh - name: Unit tests - run: python -m unittest --buffer + run: make test/unit + - name: Integration test (local) + run: make test/local test_docker: runs-on: ubuntu-latest @@ -44,7 +44,7 @@ jobs: - name: Checkout uses: actions/checkout@v3 - name: Integration test (Docker) - run: sudo ./test/integration/docker/test.sh + run: sudo make test/docker test_example_config: needs: [test_local, test_docker] @@ -74,7 +74,7 @@ jobs: with: ssh-private-key: '${{ secrets.SSH_KEY }}' - name: Integration test (example config) - run: ./test/integration/example/test.sh + run: make test/example publish_docker: needs: [test_local, test_example_config, test_docker] @@ -92,6 +92,7 @@ buildx/push: . venv_dir := .venv +venv_activate := . '$(call escape,$(venv_dir)/bin/activate)' .PHONY: venv/reset venv/reset: @@ -101,33 +102,42 @@ venv/reset: .PHONY: venv venv: venv/reset - . '$(call escape,$(venv_dir))/bin/activate' && pip install -q -r requirements.txt + $(venv_activate) && pip install -q -r requirements.txt # Is there a better way? .PHONY: venv/upgrade venv/upgrade: venv/reset - . '$(call escape,$(venv_dir))/bin/activate' \ + $(venv_activate) \ && pip install -q . \ && pip uninstall -q --yes '$(call escape,$(PROJECT))' \ && pip freeze > requirements.txt -.PHONY: py -py: python +.PHONY: python +python: + $(venv_activate) && python .PHONY: repl repl: python -.PHONY: python -python: - . '$(call escape,$(venv_dir))/bin/activate' && python +.PHONY: test/unit +test/unit: + python -m unittest --verbose --buffer + +.PHONY: test/local +test/local: + ./test/integration/local/test.sh + +.PHONY: test/docker +test/docker: + ./test/integration/docker/test.sh -.PHONY: test -test: - . '$(call escape,$(venv_dir))/bin/activate' && python -m unittest --verbose --buffer +.PHONY: test/example +test/example: + ./test/integration/example/test.sh .PHONY: tag tag: - . '$(call escape,$(venv_dir))/bin/activate' \ + $(venv_activate) \ && pip install -q --upgrade setuptools-scm \ && version="$$( python -m setuptools_scm --strip-dev )" \ && git tag "v$$version" |