-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (39 loc) · 1.29 KB
/
run-examples.yml
File metadata and controls
43 lines (39 loc) · 1.29 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
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Run examples
on: [pull_request]
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: webfactory/ssh-agent@v0.8.0
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Set up MPI
uses: mpi4py/setup-mpi@v1
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: 'pip' # caching pip dependencies
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install -e .
- name: Run examples
run: |
for f in examples/*.py; do python "$f"; done
- name: Get number of CPU cores
uses: SimenB/github-actions-cpu-cores@v1
id: cpu-cores
- name: Run MPI examples
run: |
for f in examples/mpi/*.py; do \
mpiexec -n ${{ steps.cpu-cores.outputs.count }} python "$f"; \
done