-
Notifications
You must be signed in to change notification settings - Fork 15
158 lines (130 loc) · 3.85 KB
/
unit-tests.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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
name: Run unit tests
on:
workflow_dispatch:
push:
branches:
- main
paths:
- "tests/**"
- "src/tike/**"
- pyproject.toml
- .github/workflows/unit-tests.yml
pull_request:
branches:
- main
paths:
- "tests/**"
- "src/tike/**"
- pyproject.toml
- .github/workflows/unit-tests.yml
jobs:
linux-x86-no-mpi:
runs-on: self-hosted
continue-on-error: true
strategy:
matrix:
python-version:
- "3.10"
- "3.11"
- "3.9"
steps:
- uses: actions/checkout@v3
- run: |
echo ${CUDA_VISIBLE_DEVICES}
echo "CUDA_VERSION=$(nvidia-smi -q | grep "CUDA Version" | sed 's/CUDA Version\s*: //' | sed 's/\.[0-9]*//')" >> "$GITHUB_ENV"
- run: |
conda config --remove channels defaults || true
conda config --add channels conda-forge
conda config --show channels
name: Configure Conda to only use conda-forge
- run: >
conda create --quiet --yes --force
-n tike
--channel conda-forge
--file requirements.txt
pytest
python=${{ matrix.python-version }}
cuda-version=$CUDA_VERSION
name: Create build environment
- run: conda remove -n tike mpi4py --yes --quiet || true
name: Remove MPI from test environment
- run: conda list -n tike
name: List build environment
- run: |
source activate tike
pip install . --no-deps --no-build-isolation
name: Setup and install
- run: |
source activate tike
python tests/print-gpu-info.py
name: Print GPU info
- run: |
source activate tike
export TIKE_TEST_CI
pytest -vs tests
name: Run tests
- run: |
cd tests/result
zip -r9 ../../result.zip .
name: Zip results
- uses: actions/upload-artifact@v3
if: ${{ matrix.python-version == '3.9' }}
with:
path: result.zip
name: Without MPI results
- run: conda remove -n tike --all
name: Clean up environment
linux-x86-with-mpi:
runs-on: self-hosted
continue-on-error: true
strategy:
matrix:
python-version:
- "3.8"
steps:
- uses: actions/checkout@v3
- run: |
echo ${CUDA_VISIBLE_DEVICES}
echo "CUDA_VERSION=$(nvidia-smi -q | grep "CUDA Version" | sed 's/CUDA Version\s*: //' | sed 's/\.[0-9]*//')" >> "$GITHUB_ENV"
- run: |
conda config --remove channels defaults || true
conda config --add channels conda-forge
conda config --show channels
name: Configure Conda to only use conda-forge
- run: >
conda create --quiet --yes --force
-n tike
--channel conda-forge
--file requirements.txt
pytest
python=${{ matrix.python-version }}
'openmpi=*=h*'
mpi4py
cuda-version=$CUDA_VERSION
name: Create build environment
- run: conda list -n tike
name: List build environment
- run: |
source activate tike
pip install . --no-deps --no-build-isolation
name: Setup and install
- run: |
source activate tike
python tests/print-gpu-info.py
name: Print GPU info
- run: |
source activate tike
export OMPI_MCA_opal_cuda_support=true
export TIKE_TEST_CI
mpiexec -n 2 python -m pytest -vs tests
name: Run tests with MPI
- run: |
cd tests/result
zip -r9 ../../result.zip .
name: Zip results
- uses: actions/upload-artifact@v3
with:
path: result.zip
name: MPI results
- run: conda remove -n tike --all
name: Clean up environment