-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
50 lines (42 loc) · 1.62 KB
/
Makefile
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
.PHONY:
cicd
cicd_pull_request
cicd_release
contributor_requirements
coverage
docs
example
example_with_input
# Install contributor-required dependencies
contributor_requirements:
poetry install --with=ci-cd,docs,pre-commit,testing --sync
# Build the `Sphinx` documentation, and open it
docs: contributor_requirements
rm -rf docs/_build docs/reference/api
sphinx-build -b=html docs docs/_build
open docs/_build/index.html
# Run `pytest` suite, create a coverage report, and open it
coverage: contributor_requirements
pytest --cov --cov-report=html
open htmlcov/index.html
# Build an example project using default settings, and open the folder
example: contributor_requirements
@TEMPORARY_DIRECTORY="$$(mktemp -d 2>/dev/null || mktemp -d -t 'mytmpdir')" && \
cookiecutter . --no-input --output-dir $$TEMPORARY_DIRECTORY && \
echo "Example project stored at " $$TEMPORARY_DIRECTORY && \
open $$TEMPORARY_DIRECTORY
# Build an example project using user-defined settings, and open the folder
example_with_input: contributor_requirements
@TEMPORARY_DIRECTORY="$$(mktemp -d 2>/dev/null || mktemp -d -t 'mytmpdir')" && \
cookiecutter . --output-dir $$TEMPORARY_DIRECTORY && \
echo "Example project stored at " $$TEMPORARY_DIRECTORY && \
open $$TEMPORARY_DIRECTORY
# Run GitHub Actions with `pull_request` trigger locally — requires `act` installed
cicd_pull_request: contributor_requirements
act pull_request
# Run GitHub Actions with `release` trigger locally — requires `act` installed
cicd_release: contributor_requirements
act release
# Run GitHub Actions
cicd: cicd_pull_request cicd_release
@echo "GitHub Actions ran locally"