Skip to content

Merge pull request #466 from emborchert/master #862

Merge pull request #466 from emborchert/master

Merge pull request #466 from emborchert/master #862

Workflow file for this run

name: test
on:
push:
branches: [ master ]
paths-ignore:
- 'docs/**'
- 'README.md'
pull_request:
branches: [ master ]
paths-ignore:
- 'docs/**'
- 'README.md'
env:
OMP_STACKSIZE: 512M
OMP_NUM_THREADS: 4
jobs:
test:
strategy:
fail-fast: false
matrix:
system:
- gfortran
- ifort
debug:
- no
- yes
input: # [SETUP, phantom_tests]
- ['test', '']
- ['testkd', '']
- ['testdust', 'dust']
- ['testgr', 'gr']
- ['testgrav', 'gravity ptmass']
- ['testgrowth', 'dustgrowth']
- ['testnimhd', 'nimhd']
- ['test2', '']
- ['testcyl', '']
name: |
test (SYSTEM=${{ matrix.system }},
DEBUG=${{ matrix.debug }},
SETUP=${{ matrix.input[0] }},
targets=${{ matrix.input[1] }})
runs-on: ubuntu-latest
steps:
- name: "Nuke the github workspace before doing anything"
run: rm -r ${{ github.workspace }} && mkdir ${{ github.workspace }}
- name: Setup Intel repo
if: matrix.system == 'ifort'
id: intel-repo
run: |
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
sudo echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
sudo apt-get update
INTELVERSION=$(apt-cache show intel-oneapi-compiler-fortran | grep Version | head -1)
echo "::set-output name=intelversion::$INTELVERSION"
- name: Cache intel installation
if: matrix.system == 'ifort'
id: cache-intel
uses: actions/cache@v3
with:
path: |
/opt/intel
key: ${{ steps.intel-repo.outputs.intelversion }}
- name: Install Intel compilers
if: ${{ steps.cache-intel.outputs.cache-hit != 'true' && matrix.system == 'ifort' }}
run: |
sudo apt-get install -y intel-oneapi-common-vars
sudo apt-get install -y intel-oneapi-compiler-fortran
sudo apt-get install -y intel-oneapi-mpi
sudo apt-get install -y intel-oneapi-mpi-devel
- name: Setup Intel oneAPI environment
if: matrix.system == 'ifort'
run: |
source /opt/intel/oneapi/setvars.sh
printenv >> $GITHUB_ENV
- name: "Clone phantom"
uses: actions/checkout@v3
- name: "Compile phantom"
run: make SETUP=${{ matrix.input[0] }} DEBUG=${{ matrix.debug }} phantomtest
env:
SYSTEM: ${{ matrix.system }}
- name: "Run phantom tests"
run: ./bin/phantomtest ${{ matrix.input[1] }}
# Gather results into a dummy job that will fail if the previous job fails
gather_results:
if: always()
needs:
- test
# This name matches the branch protection requirement
name: test
runs-on: ubuntu-latest
steps:
- name: Check all tests
run: |
if [[ "${{ needs.test.result }}" == "success" ]]; then
echo "All tests succeeded"
else
echo "At least one test failed"
exit 1
fi