-
Notifications
You must be signed in to change notification settings - Fork 0
123 lines (103 loc) · 2.92 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
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-22.04
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- name: Fetch base and install Poetry
run: |
git fetch origin ${{github.base_ref}}
pipx install poetry
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.11
cache: '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@v4
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-22.04
steps:
- uses: actions/checkout@v4
- name: Fetch base and install Poetry
run: |
git fetch origin ${{github.base_ref}}
pipx install poetry
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.11
cache: '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-22.04
steps:
- uses: actions/checkout@v4
- name: Setup Node.js for use with actions
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: '**/package-lock.json'
- 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@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: javascript
fail_ci_if_error: true
Client_Side_Linting:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Setup Node.js for use with actions
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: '**/package-lock.json'
- name: npm ci
run: |
cd client
npm ci
- name: Client Side Linting
run: |
cd client
npm run lint