-
Notifications
You must be signed in to change notification settings - Fork 0
142 lines (121 loc) · 3.49 KB
/
main.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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
name: CI
# Controls when the action will run. Triggers the workflow on pushes to main or on pull request events
on:
push:
branches: [ main ]
pull_request:
branches: [ '**' ]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
Server_Side_Unit_Tests:
runs-on: ubuntu-20.04
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Setup Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: 1.4.2
- uses: actions/cache@v3
with:
path: ~/.cache/pypoetry/virtualenvs
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-
- name: Install Python Packages
run: |
cd server
poetry install
- name: Run Server-side unit tests and generate coverage report
run: |
cd server
cp portal/apps/workbench/templates/portal/apps/workbench/index.j2 portal/apps/workbench/templates/portal/apps/workbench/index.html
poetry run pytest --cov-config=.coveragerc --cov=portal --cov-report=xml -ra
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./server/coverage.xml
flags: unittests
name: cep-server-side
fail_ci_if_error: true
Server_Side_Linting:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Setup Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: 1.4.2
- uses: actions/cache@v3
with:
path: ~/.cache/pypoetry/virtualenvs
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-
- name: Install Python Packages
run: |
cd server
poetry install
- name: Server-Side Linting
run: |
cd server
poetry run flake8
Client_Side_Unit_Tests:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Setup Node.js for use with actions
uses: actions/setup-node@v3
with:
node-version: 16
- uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: npm ci
run: |
cd client
npm ci
- name: Client Side Unit Tests
run: |
cd client
npm run test
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: javascript
fail_ci_if_error: true
Client_Side_Linting:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Setup Node.js for use with actions
uses: actions/setup-node@v3
with:
node-version: 16
- uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: npm ci
run: |
cd client
npm ci
- name: Client Side Linting
run: |
cd client
npm run lint