-
Notifications
You must be signed in to change notification settings - Fork 132
69 lines (66 loc) · 1.8 KB
/
ci-build.yaml
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
name: CI
on:
# Trigger the workflow on push or pull request,
# only on the main branch
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
jobs:
lint_and_typecheck:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.11']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install -e '.[testing]'
- name: Lint with flake8
run: |
flake8 .
- name: Lint with pylint
run: |
pylint --fail-under 9.75 ferminet
- name: Type check with pytype
run: |
pytype ferminet
build:
name: "build ${{ matrix.name-prefix }} (py ${{ matrix.python-version }} on ${{ matrix.os }})"
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- name-prefix: "all tests"
python-version: '3.10'
os: ubuntu-latest
package-overrides: "none"
- name-prefix: "all tests"
python-version: '3.11'
os: ubuntu-latest
package-overrides: "none"
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
- name: Install dependencies
run: |
pip install -e '.[testing]'
if [ ${{ matrix.package-overrides }} != none ]; then
pip install ${{ matrix.package-overrides }}
fi
- name: Run tests
run: |
python -m pytest
- name: Run multi-device tests
if: matrix.python-version == '3.11'
run: |
FERMINET_CHEX_N_CPU_DEVICES=2 python -m pytest ferminet/tests/train_test.py