-
Notifications
You must be signed in to change notification settings - Fork 14
60 lines (55 loc) · 1.55 KB
/
unix.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
name: Unix
on:
push:
pull_request:
# Run daily at midnight (UTC).
schedule:
- cron: '0 0 * * *'
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.9, '3.10', 3.11]
steps:
- uses: actions/checkout@v2
- name: Cache conda
uses: actions/cache@v2
# Increase this value to reset cache
env: {CACHE_NUMBER: 0}
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ matrix.python-version }}
- uses: conda-incubator/setup-miniconda@v2
name: Setup conda
with:
auto-update-conda: true
activate-environment: testing
auto-activate-base: false
channels: defaults
channel-priority: true
- shell: bash -l {0}
name: Install dependencies
run: |
conda install numpy pandas pytorch cpuonly -c pytorch
conda install -c conda-forge mpi4py mpich
pip install .[test]
- shell: bash -l {0}
name: Lint with flake8
run: |
flake8 ./optimas
flake8 ./examples --extend-ignore F821 --exclude custom_fld_diags.py,custom_ptcl_diags.py
- shell: bash -l {0}
name: Run unit tests with MPICH
run: |
python -m pytest tests/
- shell: bash -l {0}
name: Replace MPICH with openMPI
run: |
conda uninstall mpi4py mpich
conda install -c conda-forge mpi4py openmpi
- shell: bash -l {0}
name: Run unit tests with openMPI
run: |
rm -r tests_output
python -m pytest tests/