Repository navigation
115 lines (105 loc) · 3.86 KB
/
Copy pathtests.yml
File metadata and controls
115 lines (105 loc) · 3.86 KB
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: unit tests
on:
schedule:
- cron: "0 6 * * *" # Fire at 06:00 AM every day
workflow_dispatch:
pull_request:
push:
branches:
- master
- develop
- single_rank_mock_mpi
release:
types:
- published
permissions:
contents: read
jobs:
test:
name: test with ${{ matrix.env }} on ${{ matrix.os }} with ${{ matrix.mpi }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
env:
- "3.14"
- "3.13"
- "3.12"
- "3.11"
- "3.10"
mpi: [ 'mpich', 'openmpi' ]
os:
- ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup MPI ${{ matrix.mpi }}
uses: mpi4py/setup-mpi@v1
with:
mpi: ${{ matrix.mpi }}
- name: Set up Python ${{ matrix.env}}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.env }}
- name: Install Repast4Py
run: CC=mpicxx CXX=mpicxx python3 -m pip install -e .
- name: Install Coverage
run: pip install coverage
- name: Test with unittest
uses: nick-fields/retry@v4
env:
# MPI envs for compatiblity with the GitHub Actions environment
RDMAV_FORK_SAFE: 1
OMPI_MCA_btl_openib_allow_ib: 0 # disables OpenIB transport and forces OpenMPI to use TCP instead
UCX_TLS: tcp # Forces UCX to use only TCP transport, avoiding InfiniBand issues
OMPI_MCA_pml: ^ucx # Disables the UCX pointille message layer and uses the standard PML instead
with:
timeout_minutes: 15 # per-attempt cap; MPI on GH runners can hang indefinitely
max_attempts: 3 # retry attempts
retry_on: any # retry condition on any failure or timeout
command: |
coverage run -m unittest discover tests
coverage run -m unittest discover tests
mpirun -n 9 coverage run --rcfile=coverage.rc -m unittest tests.shared_obj_tests
mpirun -n 9 coverage run --rcfile=coverage.rc -m unittest tests.shared_vl_tests
mpirun -n 9 coverage run --rcfile=coverage.rc -m unittest tests.ctopo_tests
mpirun -n 18 coverage run --rcfile=coverage.rc -m unittest tests.shared_obj_tests.SharedGridTests.test_buffer_data_3d
mpirun -n 18 coverage run --rcfile=coverage.rc -m unittest tests.shared_obj_tests.SharedGridTests.test_buffer_data_3d_periodic
mpirun -n 4 coverage run --rcfile=coverage.rc -m unittest tests.logging_tests
mpirun -n 4 coverage run --rcfile=coverage.rc -m unittest tests.shared_network_tests
- name: Generate Coverage Report
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
coverage combine
coverage report -m
bash <(curl -s https://codecov.io/bash)
test-single-rank:
name: single-rank test with ${{ matrix.env }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
env:
- "3.14"
- "3.13"
- "3.12"
- "3.11"
- "3.10"
# No MPI is set up: the single-rank build must require neither a native MPI nor mpi4py.
os:
- ubuntu-latest
- windows-latest
steps:
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.env }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.env }}
- name: Install Repast4Py (single-rank, no MPI)
env:
R4PY_NO_MPI: 1
run: python3 -m pip install -e .
- name: Verify single-rank MPI is active
run: python3 -c "from repast4py import MPI; assert MPI.COMM_WORLD.Get_size() == 1; print(MPI.__name__)"
- name: Test with unittest
run: python3 -m unittest discover tests