-
Notifications
You must be signed in to change notification settings - Fork 1
43 lines (36 loc) · 1.48 KB
/
test.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
# Test action that attempts to generate new docker containers on push to master
name: CMBenv Docker Test
on:
pull_request:
branches: [ master ]
# push:
# branches: [ master ]
jobs:
test:
name: Docker Test Python ${{ matrix.python }} ${{ matrix.mpi }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- python: 3.7
mpi: mpich
- python: 3.8
mpi: mpich
- python: 3.9
mpi: mpich
- python: 3.9
mpi: openmpi
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: Checkout
uses: actions/checkout@v2
- name: Create Dockerfile
run: ./cmbenv -c docker-py${{ matrix.python }}-debian-${{ matrix.mpi }}
- name: Build Docker Image
run: docker build -t hpc4cmb/cmbenv:temp_py${{ matrix.python }}_${{ matrix.mpi }} -f Dockerfile_docker-py${{ matrix.python }}-debian-${{ matrix.mpi }} .
- name: Test Docker Image
run: docker run -e "OMPI_ALLOW_RUN_AS_ROOT=1" -e "OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1" hpc4cmb/cmbenv:temp_py${{ matrix.python }}_${{ matrix.mpi }} python -c 'import toast.tests; toast.tests.run()' && docker run -e "OMPI_ALLOW_RUN_AS_ROOT=1" -e "OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1" hpc4cmb/cmbenv:temp_py${{ matrix.python }}_${{ matrix.mpi }} mpirun -np 2 python -c 'import toast.tests; toast.tests.run()'