-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (72 loc) · 1.98 KB
/
Pre-commmit and 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
77
name: Pre-commit & Tests
on: push
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
pre-commit:
runs-on: [self-hosted, ubuntu-20.04]
name: Pre-commit
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Pre-commit
uses: pre-commit/action@v2.0.3
webserver-tests:
needs: pre-commit
runs-on: [self-hosted, ubuntu-20.04]
name: Webserver tests
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install Recommerce package
shell: bash -l {0}
run: |
pip install -e .[cpu]
- name: Setup Recommerce
shell: bash -l {0}
run: |
recommerce --get-defaults-unpack
- name: Run Webserver tests
env:
SECRET_KEY: 'fake_secret_key'
API_TOKEN: 'fake_api_token'
shell: bash -l {0}
run: |
(cd ./webserver && python ./manage.py test -v 2)
recommerce-tests:
needs: webserver-tests
runs-on: [self-hosted, ubuntu-20.04]
name: Recommerce tests
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install Recommerce package
shell: bash -l {0}
run: |
pip install -e .[cpu]
- name: Setup Recommerce
shell: bash -l {0}
run: |
recommerce --get-defaults-unpack
- name: Run Recommerce tests
shell: bash -l {0}
run: |
coverage run --source=. -m pytest
- name: Report Coverage
shell: bash -l {0}
run: |
coverage report