-
Notifications
You must be signed in to change notification settings - Fork 109
117 lines (98 loc) · 2.71 KB
/
test.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: Tests
on:
push: ~
pull_request: ~
jobs:
check:
runs-on: ubuntu-latest
outputs:
fe-changed: ${{ steps.fe.outputs.changed }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 10
- uses: marceloprado/has-changed-path@v1
id: fe
with:
paths: vj4/ui yarn.lock
build-constant:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup environment
uses: actions/setup-node@v2
with:
node-version: 10
cache: yarn
- name: Install dependencies
run: yarn install
- name: Generate constant
run: yarn build --constant
- name: Upload Python constant
uses: actions/upload-artifact@v2
with:
name: vj4-constant
path: vj4/constant/
test-fe:
needs: check
if: ${{ needs.check.outputs.fe-changed == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup environment
uses: actions/setup-node@v2
with:
node-version: 10
cache: yarn
- name: Install dependencies
run: yarn install
- name: Generate constant
run: yarn build:production
- name: Upload uibuild
uses: actions/upload-artifact@v2
with:
name: uibuild
path: |
vj4/.uibuild/
vj4/constant/
test-python:
needs: build-constant
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9']
services:
rabbitmq:
image: rabbitmq
ports:
- "5672:5672"
mongodb:
image: mongo:5.0
ports:
- "27017:27017"
steps:
- uses: actions/checkout@v2
- name: Download constants
uses: actions/download-artifact@v2
with:
name: vj4-constant
path: vj4/constant/
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Setup pip cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-py${{ matrix.python-version }}-pip--${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-py${{ matrix.python-version }}-pip-
${{ runner.os }}-py${{ matrix.python-version }}-
- name: Install dependencies
run: |
sudo python -m pip install --upgrade setuptools pip
python -c "import sys; print(sys.version)"
python -m pip install -r requirements.txt
- name: Unit tests
run: python -m unittest