Skip to content

Commit de498e4

Browse files
committed
add-scripts-folder
1 parent af8d2d4 commit de498e4

File tree

8 files changed

+23
-15
lines changed

8 files changed

+23
-15
lines changed

.github/workflows/tests.yaml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
name: Python package
1+
name: Test Suite
22

3-
on: [push]
3+
on:
4+
push:
5+
branches: ["master"]
6+
pull_request:
7+
branches: ["master"]
48

59
jobs:
610
linters:
@@ -20,10 +24,8 @@ jobs:
2024
python -m pip install --upgrade pip
2125
pip install -r requirements.txt
2226
pip install -r tests/test-requirements.txt
23-
- name: Mypy
24-
run: mypy piccolo tests
25-
- name: Flake8
26-
run: flake8 piccolo tests
27+
- name: Lint
28+
run: ./scripts/lint.sh
2729

2830
postgres:
2931
runs-on: ubuntu-latest
@@ -70,7 +72,7 @@ jobs:
7072
psql -h localhost -c "CREATE EXTENSION IF NOT EXISTS \"uuid-ossp\";" -d piccolo -U postgres
7173
7274
- name: Test with pytest, Postgres
73-
run: cd tests && ./test-postgres.sh
75+
run: ./scripts/test-postgres.sh
7476
env:
7577
PG_HOST: localhost
7678
PG_DATABASE: piccolo
@@ -94,4 +96,4 @@ jobs:
9496
pip install -r requirements.txt
9597
pip install -r tests/test-requirements.txt
9698
- name: Test with pytest, SQLite
97-
run: cd tests && ./test-sqlite.sh
99+
run: ./scripts/test-sqlite.sh

scripts/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Development Scripts
2+
3+
The scripts follow GitHub's ["Scripts to Rule Them All"](https://github.com/github/scripts-to-rule-them-all).
4+
5+
* `scripts/coverage-report.sh` - Generate coverage report.
6+
* `scripts/lint.sh` - Run the automated code linting/formatting tools.
7+
* `scripts/release.sh` - Publish package to PYPI.
8+
* `scripts/test-postgres.sh` - Run the test suite with Postgres.
9+
* `scripts/test-sqlite.sh` - Run the test suite with Sqlite.

scripts/lint.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
3+
mypy piccolo tests
4+
flake8 piccolo tests
File renamed without changes.
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,5 @@
44
# To run all in a class tests/test_foo.py::TestFoo
55
# To run a single test tests/test_foo.py::TestFoo::test_foo
66

7-
cd ..
8-
97
export PICCOLO_CONF="tests.postgres_conf"
108
python -m pytest --cov=piccolo -s $@
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,5 @@
44
# To run all in a class tests/test_foo.py::TestFoo
55
# To run a single test tests/test_foo.py::TestFoo::test_foo
66

7-
cd ..
8-
97
export PICCOLO_CONF="tests.sqlite_conf"
108
python -m pytest --cov=piccolo -s $@

tests/run-mypy.sh

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)