-
Notifications
You must be signed in to change notification settings - Fork 2
82 lines (66 loc) · 1.91 KB
/
ci.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
78
79
80
81
82
name: CI
on:
push:
pull_request:
jobs:
style:
name: "Style Checks"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
run: |
pip install flake8
pip install pep8-naming
- name: Perform Style Check
run: |
flake8 .
test-plugin:
name: "Unit Tests"
runs-on: ubuntu-latest
container:
image: inventree/inventree:latest
options: --user root
env:
INVENTREE_DB_ENGINE: postgresql
INVENTREE_DB_NAME: inventree
INVENTREE_DB_HOST: db
INVENTREE_DB_PORT: 5432
INVENTREE_DB_USER: inventree
INVENTREE_DB_PASSWORD: inventree
INVENTREE_PLUGINS_ENABLED: True
INVENTREE_PLUGIN_TESTING: True
PLUGIN_TESTING_EVENTS: True
INVENTREE_PLUGIN_TESTING_SETUP: True
INVENTREE_SITE_URL: http://localhost:8000
services:
db:
image: postgres:13
ports:
- 5432:5432
env:
POSTGRES_USER: inventree
POSTGRES_PASSWORD: inventree
POSTGRES_DB: inventree
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup InvenTree
run: |
cd /home/inventree
HOME=/root pip3 install --no-cache-dir --disable-pip-version-check -U -r requirements.txt
- name: Setup IPN Generator Plugin
run: |
cd /home/inventree
HOME=/root pip3 install -e $GITHUB_WORKSPACE
HOME=/root pip3 install django-test-migrations==1.2.0 coverage==7.4.1 django_slowtests==1.1.1
HOME=/root invoke migrate
- name: Run Tests
run: |
cd /home/inventree
HOME=/root src/backend/InvenTree/manage.py test ipn_generator.tests.test_IPNGenerator