-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (77 loc) · 2.49 KB
/
reusable-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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Run tests
on:
pull_request:
types: [opened, edited, reopened, synchronize]
workflow_call:
jobs:
python-tests:
name: Python tests
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@6d193bf28034eafb982f37bd894289fe649468fc
- name: Install poetry
run: pipx install poetry
- name: Set up Python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b
with:
python-version: "3.11"
cache: poetry
cache-dependency-path: ./poetry.lock
- name: Install project
run: |
make install_python_deps
make install_npm_deps
poetry install --no-interaction --no-root
sudo apt-get install gettext
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "21"
- name: Get npm cache directory
id: npm-cache-dir
run: make export_npm_cache_dir
- name: Load cached npm
uses: actions/cache@v4
with:
path: $(cat .npm_cache_dir)
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Build frontend assets
run: make assets
- name: Run unit tests with coverage
id: fast-tests
run: TESTING=True poetry run pytest --cov -m 'not slow and not datahub' --doctest-modules
- name: Set up chromedriver
# https://github.com/marketplace/actions/setup-chromedriver
uses: nanasess/[email protected]
- name: Run integration tests
id: slow-tests
if: steps.fast-tests.outcome == 'success'
run: make integration
javascript-only-tests:
name: Javascript tests
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "21"
- name: Get npm cache directory
id: npm-cache-dir
run: make export_npm_cache_dir
- name: Load cached npm
uses: actions/cache@v4
with:
path: $(cat .npm_cache_dir)
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
id: install_dependencies
run: npm install
- name: Run javascript tests
run: npm test