generated from nationalarchives/da-template
-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (55 loc) · 1.78 KB
/
unit_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
name: Run Unit Tests
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
app_tests:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.11
- name: Install Poetry
run: pip install poetry
- name: Install dependencies
run: poetry install
- name: Install Node dependencies
run: npm install
- name: Run build script
run: ./build.sh
- name: Build CSS
run: npm run build
- name: Run App unit tests
run: AWS_DEFAULT_REGION=eu-west-2 poetry run pytest --cov=app/main --cov-report term-missing -rsa -vvv app/tests
- name: Generate coverage XML
run: poetry run coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
data_management_tests:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.11
- name: Install Poetry
run: pip install poetry
- name: Install dependencies
run: poetry install
- name: Install dependencies
run: pip install pip==24.0 && pip install -r data_management/opensearch_indexer/requirements.txt && pip install -r data_management/opensearch_indexer/requirements-dev.txt
- name: Run Data Management unit tests
run: AWS_DEFAULT_REGION=eu-west-2 pytest --cov=data_management/opensearch_indexer/opensearch_indexer --cov-report term-missing -rsa -vvv data_management/opensearch_indexer/tests
- name: Generate coverage XML
run: coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3