-
Notifications
You must be signed in to change notification settings - Fork 17
88 lines (78 loc) · 2.3 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
name: Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
pre-commit:
name: pre-commit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: pre-commit/[email protected]
with:
extra_args: --all-files --hook-stage=manual
- name: Help message if pre-commit fail
if: ${{ failure() }}
run: |
echo "You can install pre-commit hooks to automatically run formatting"
echo "on each commit with:"
echo " pre-commit install"
echo "or you can run by hand on staged files with"
echo " pre-commit run"
echo "or after-the-fact on already committed files with"
echo " pre-commit run --all-files --hook-stage=manual"
test:
name: Run tests on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 10
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
defaults:
run:
shell: bash -l {0}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-variant: Mambaforge
miniforge-version: latest
python-version: "3.11"
- name: Install dependencies
run: |
mamba install pip nodejs=18
pip install ".[test]"
- name: Build JavaScript assets
working-directory: javascript
run: |
yarn
yarn build
- name: Linter check
if: ${{ !contains(matrix.os, 'windows') }}
working-directory: javascript
run: |
yarn lint:check
- name: Integrity check
if: ${{ !contains(matrix.os, 'windows') }}
working-directory: javascript
run: |
set -ex
yarn integrity
if [[ $(git ls-files --exclude-standard -m | wc -l) > 0 ]]
then
echo "Integrity test failed; please run locally 'yarn integrity' and commit the changes"
exit 1
fi
- name: Run JS tests
working-directory: javascript
run: |
yarn build:test
yarn test:cov
- name: Run Python tests
run: |
python -m pytest -v