-
Notifications
You must be signed in to change notification settings - Fork 9
116 lines (114 loc) · 4.68 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
116
name: ci
on:
pull_request:
paths:
- .github/workflows/**
- unidist/**
- environment_linux.yml
- environment_win.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@v4
with:
fetch-depth: 1
- uses: actions/setup-python@v5
with:
python-version: "3.10"
architecture: "x64"
- run: pip install black
- run: black --check --diff .
lint-flake8:
name: lint (flake8)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: actions/setup-python@v5
with:
python-version: "3.10"
architecture: "x64"
- run: pip install flake8 flake8-print
- run: flake8 --enable=T .
test-all:
needs: [lint-black, lint-flake8]
strategy:
matrix:
os:
- ubuntu
- windows
python-version: ["3.9", "3.10"]
backend: ["ray", "mpi", "dask", "pymp", "pyseq"]
runs-on: ${{ matrix.os }}-latest
defaults:
run:
shell: bash -l {0}
env:
UNIDIST_BACKEND: ${{matrix.backend}}
name: test-${{ matrix.os }} (backend ${{matrix.backend}}, python ${{matrix.python-version}})
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: unidist
environment-file: ${{ matrix.os == 'ubuntu' && 'environment_linux.yml' || matrix.os == 'windows' && 'environment_win.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 == 'ubuntu'
- run: UNIDIST_MPI_SHARED_OBJECT_STORE=False mpiexec -n 1 python -m pytest unidist/test/test_actor.py
if: matrix.backend == 'mpi' && matrix.os == 'windows'
- 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 == 'ubuntu'
- run: UNIDIST_MPI_SHARED_OBJECT_STORE=False mpiexec -n 1 python -m pytest unidist/test/test_async_actor.py
if: matrix.backend == 'mpi' && matrix.os == 'windows'
- 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 == 'ubuntu'
- run: UNIDIST_MPI_SHARED_OBJECT_STORE=False mpiexec -n 1 python -m pytest unidist/test/test_task.py
if: matrix.backend == 'mpi' && matrix.os == 'windows'
- 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 == 'ubuntu'
- run: UNIDIST_MPI_SHARED_OBJECT_STORE=False mpiexec -n 1 python -m pytest unidist/test/test_general.py
if: matrix.backend == 'mpi' && matrix.os == 'windows'