forked from projectcaluma/caluma
-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (74 loc) · 2.13 KB
/
tests.yml
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Tests
on:
push:
pull_request:
schedule:
- cron: '0 0 * * 0'
jobs:
standard-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build the project
run: |
echo "UID=$(id --user)" > .env
docker-compose up -d --build
- name: Lint the code
run: |
docker-compose exec -T caluma black --check .
docker-compose exec -T caluma flake8
docker-compose exec -T caluma ./manage.py makemigrations --check --dry-run --no-input
docker-compose exec -T caluma reuse lint
- name: Run pytest
run: docker-compose exec -T caluma pytest --no-cov-on-fail --cov --create-db -vv
pipenv-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: '3.7'
- name: Install requirements
env:
PIPENV_IGNORE_VIRTUALENVS: 1
run: |
pip install pipenv
python3 setup.py pipenv
- name: Run pytest
run: pipenv run pytest
package-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: '3.7'
- name: Install package
run: |
echo UID=$(id -u) > .env
echo ENV=dev >> .env
docker-compose up -d db
rm -rf dist/
python -m pip install --upgrade pip
pip install setuptools wheel
python setup.py bdist_wheel
pip install dist/caluma-*.whl
pip install -r requirements-dev.txt
- name: Run pytest
run: pytest --no-cov-on-fail --cov --create-db -vv
gitlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: '3.7'
- name: Install gitlint
run: pip install gitlint
- name: Run gitlint
run: gitlint --contrib contrib-title-conventional-commits