-
Notifications
You must be signed in to change notification settings - Fork 9
115 lines (113 loc) · 4.51 KB
/
ci.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
name: ci
on:
pull_request:
paths:
- .github/workflows/**
- unidist/**
- environment.yml
- requirements.txt
- setup.cfg
- setup.py
- versioneer.py
push:
concurrency:
# Cancel other jobs in the same branch. We don't care whether CI passes
# on old commits.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint-black:
name: lint (black)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1
- uses: actions/setup-python@v2
with:
python-version: "3.8.x"
architecture: "x64"
- run: pip install black
- run: black --check --diff .
lint-flake8:
name: lint (flake8)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 1
- uses: actions/setup-python@v2
with:
python-version: "3.8.x"
architecture: "x64"
- run: pip install flake8 flake8-print
- run: flake8 --enable=T .
test-all:
needs: [lint-black, lint-flake8]
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
strategy:
matrix:
os:
- ubuntu
- windows
python-version: ["3.8", "3.9"]
backend: ["ray", "mpi", "dask", "pymp", "pyseq"]
env:
UNIDIST_BACKEND: ${{matrix.backend}}
name: test-${{ matrix.os }} (backend ${{matrix.backend}}, python ${{matrix.python-version}})
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 2
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: unidist
environment-file: environment.yml
python-version: ${{matrix.python-version}}
channel-priority: strict
# we set use-only-tar-bz2 to false in order for conda to properly find new packages to be installed
# for more info see https://github.com/conda-incubator/setup-miniconda/issues/264
use-only-tar-bz2: false
# Build unidist to make C++ extensions available
- name: Build unidist
run: pip install -e .
- name: Conda environment
run: |
conda info
conda list
# We disable actor tests for Ray for now because
# they hang in CI for some reason but pass locally.
# TODO: Find a solution for https://github.com/modin-project/unidist/issues/322
- run: python -m pytest unidist/test/test_actor.py
if: matrix.backend != 'mpi' && matrix.backend != 'ray'
- run: python -m pytest unidist/test/test_async_actor.py
if: matrix.backend != 'mpi' && matrix.backend != 'ray'
- run: python -m pytest unidist/test/test_task.py
if: matrix.backend != 'mpi'
- run: python -m pytest unidist/test/test_general.py
if: matrix.backend != 'mpi'
# When using a directory to run with mpiexec
# MPI gets hung after executing tests
# so we run the test files one by one.
# We test enabled and disabled shared object store on linux, and
# disabled shared object store on Windows as
# msmpi doesn't support the shared memory feature.
- run: UNIDIST_MPI_SHARED_OBJECT_STORE=True mpiexec -n 1 --oversubscribe python -m pytest unidist/test/test_actor.py
if: matrix.backend == 'mpi' && matrix.os != 'windows'
- run: UNIDIST_MPI_SHARED_OBJECT_STORE=False mpiexec -n 1 --oversubscribe python -m pytest unidist/test/test_actor.py
if: matrix.backend == 'mpi'
- run: UNIDIST_MPI_SHARED_OBJECT_STORE=True mpiexec -n 1 --oversubscribe python -m pytest unidist/test/test_async_actor.py
if: matrix.backend == 'mpi' && matrix.os != 'windows'
- run: UNIDIST_MPI_SHARED_OBJECT_STORE=False mpiexec -n 1 --oversubscribe python -m pytest unidist/test/test_async_actor.py
if: matrix.backend == 'mpi'
- run: UNIDIST_MPI_SHARED_OBJECT_STORE=True mpiexec -n 1 --oversubscribe python -m pytest unidist/test/test_task.py
if: matrix.backend == 'mpi' && matrix.os != 'windows'
- run: UNIDIST_MPI_SHARED_OBJECT_STORE=False mpiexec -n 1 --oversubscribe python -m pytest unidist/test/test_task.py
if: matrix.backend == 'mpi'
- run: UNIDIST_MPI_SHARED_OBJECT_STORE=True mpiexec -n 1 --oversubscribe python -m pytest unidist/test/test_general.py
if: matrix.backend == 'mpi' && matrix.os != 'windows'
- run: UNIDIST_MPI_SHARED_OBJECT_STORE=False mpiexec -n 1 --oversubscribe python -m pytest unidist/test/test_general.py
if: matrix.backend == 'mpi'