Skip to content

Commit ba8809e

Browse files
committed
makefile for common tasks
1 parent 7447069 commit ba8809e

File tree

3 files changed

+31
-14
lines changed

3 files changed

+31
-14
lines changed

.github/workflows/test.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,15 @@ jobs:
2121
run: |
2222
pip install --upgrade pip
2323
pip install poetry
24-
./build-drafter.sh
24+
make build-drafter
2525
poetry install
26-
pip install 'Django ${{ matrix.django-version }}'
26+
make install
2727
2828
- name: Check coding standards
29-
run: |
30-
poetry run isort --profile black -c --diff .
31-
poetry run flake8 .
32-
poetry run black --check .
29+
run: make lint
3330

3431
- name: Run tests
35-
run: |
36-
poetry run coverage run --source=apiblueprint_view --omit=apiblueprint_view/tests/*.py ./run_tests.py
37-
poetry run coverage xml
32+
run: make test
3833

3934
- name: Ensure package builds
4035
run: poetry build

CONTRIBUTING.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ This project uses:
99

1010
Development Tasks:
1111

12-
* Install dependencies: `poetry install`
13-
* Run the test suite: `./run_tests.py`
14-
* Sort imports: `isort --profile black .`
15-
* Run lint checks: `flake8 .`
16-
* Auto-format: `black .`
12+
* Install dependencies: `make install`
13+
* Run the test suite: `make test`
14+
* Run lint checks: `make lint`
15+
* Auto-format: `make format`

Makefile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
.PHONY: help build-drafter format install lint test
2+
3+
help:
4+
@grep '^\.PHONY' Makefile | cut -d' ' -f2- | tr ' ' '\n'
5+
6+
build-drafter:
7+
./build-drafter.sh
8+
9+
format:
10+
poetry run isort --profile black .
11+
poetry run black .
12+
13+
install:
14+
poetry install
15+
16+
lint:
17+
poetry run isort --profile black -c --diff .
18+
poetry run black --check .
19+
poetry run flake8 .
20+
21+
test:
22+
poetry run coverage run --source=apiblueprint_view --omit=apiblueprint_view/tests/*.py ./run_tests.py
23+
poetry run coverage xml

0 commit comments

Comments
 (0)