GHA: Use step-security/harden-runner #132
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ci | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
workflow_dispatch: | |
jobs: | |
test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
mpi: | |
- mpich | |
- openmpi | |
- intelmpi | |
- msmpi | |
os: | |
- ubuntu-24.04 | |
- ubuntu-22.04 | |
- ubuntu-24.04-arm | |
- ubuntu-22.04-arm | |
- macos-15 | |
- macos-14 | |
- macos-13 | |
- windows-2025 | |
- windows-2022 | |
- windows-2019 | |
exclude: | |
- os: ubuntu-24.04 | |
mpi: msmpi | |
- os: ubuntu-22.04 | |
mpi: msmpi | |
- os: ubuntu-24.04-arm | |
mpi: intelmpi | |
- os: ubuntu-22.04-arm | |
mpi: intelmpi | |
- os: ubuntu-24.04-arm | |
mpi: msmpi | |
- os: ubuntu-22.04-arm | |
mpi: msmpi | |
- os: macos-15 | |
mpi: intelmpi | |
- os: macos-15 | |
mpi: msmpi | |
- os: macos-14 | |
mpi: intelmpi | |
- os: macos-14 | |
mpi: msmpi | |
- os: macos-13 | |
mpi: intelmpi | |
- os: macos-13 | |
mpi: msmpi | |
- os: windows-2025 | |
mpi: mpich | |
- os: windows-2025 | |
mpi: openmpi | |
- os: windows-2022 | |
mpi: mpich | |
- os: windows-2022 | |
mpi: openmpi | |
- os: windows-2019 | |
mpi: mpich | |
- os: windows-2019 | |
mpi: openmpi | |
steps: | |
- uses: step-security/harden-runner@v2 | |
with: | |
egress-policy: audit | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup MPI | |
id: setup-mpi | |
uses: ./ | |
with: | |
mpi: ${{ matrix.mpi }} | |
- name: Show MPI name | |
run: echo "${{ steps.setup-mpi.outputs.mpi }}" | |
- name: Show MPI info | |
run: mpichversion | |
if: ${{ matrix.mpi == 'mpich' }} | |
- name: Show MPI info | |
run: ompi_info | |
if: ${{ matrix.mpi == 'openmpi' }} | |
- name: Show MPI info | |
run: impi_info | |
if: ${{ matrix.mpi == 'intelmpi' }} | |
- name: Show MPI info | |
run: | | |
Write-Host MSMPI_BIN=$Env:MSMPI_BIN | |
Write-Host MSMPI_INC=$Env:MSMPI_INC | |
Write-Host MSMPI_LIB32=$Env:MSMPI_LIB32 | |
Write-Host MSMPI_LIB64=$Env:MSMPI_LIB64 | |
if: ${{ matrix.mpi == 'msmpi' }} | |
- name: Show MPI compiler wrappers | |
run: | | |
command -v mpicc | |
mpicc -show | |
command -v mpicxx | |
mpicxx -show | |
mpifort=$(command -v mpifort || command -v mpifc) | |
command -v $mpifort | |
$mpifort -show | |
if: ${{ runner.os != 'Windows' }} | |
- name: Show MPI compiler wrappers | |
run: | | |
mpicc -show | |
mpicxx -show | |
if: ${{ runner.os == 'Windows' && matrix.mpi == 'intelmpi' }} | |
- name: Help MPI executor | |
run: | | |
command -v mpiexec | |
mpiexec --help | |
if: ${{ runner.os != 'Windows' }} | |
- name: Help MPI executor | |
run: | | |
mpiexec -help | |
if: ${{ runner.os == 'Windows' && matrix.mpi == 'intelmpi' }} | |
- name: Help MPI executor | |
run: | | |
mpiexec /help2 | |
mpiexec /help3 | |
if: ${{ runner.os == 'Windows' && matrix.mpi == 'msmpi' }} | |
- name: Build MPI application | |
run: mpicc helloworld.c -o helloworld.exe | |
if: ${{ runner.os != 'Windows' }} | |
- name: Execute MPI application | |
run: mpiexec -n 5 ./helloworld.exe | |
if: ${{ runner.os != 'Windows' }} | |
Linux: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup MPICH | |
id: setup1 | |
uses: ./ | |
with: | |
mpi: mpich | |
- run: test ${{ steps.setup1.outputs.mpi }} == mpich | |
- run: command -v mpichversion | |
- name: Setup Open MPI | |
id: setup2 | |
uses: ./ | |
with: | |
mpi: openmpi | |
- run: test ${{ steps.setup2.outputs.mpi }} == openmpi | |
- run: command -v ompi_info | |
- name: Setup Intel MPI | |
id: setup3 | |
uses: ./ | |
with: | |
mpi: intelmpi | |
- run: test ${{ steps.setup3.outputs.mpi }} == intelmpi | |
- run: command -v impi_info | |
container: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
image: | |
- debian | |
- ubuntu | |
container: ${{ matrix.image }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup MPICH | |
id: setup1 | |
uses: ./ | |
with: | |
mpi: mpich | |
- run: test ${{ steps.setup1.outputs.mpi }} = mpich | |
- run: command -v mpichversion | |
- name: Setup Open MPI | |
id: setup2 | |
uses: ./ | |
with: | |
mpi: openmpi | |
- run: test ${{ steps.setup2.outputs.mpi }} = openmpi | |
- run: command -v ompi_info | |
- name: Setup Intel MPI | |
id: setup3 | |
uses: ./ | |
with: | |
mpi: intelmpi | |
- run: test ${{ steps.setup3.outputs.mpi }} = intelmpi | |
- run: command -v impi_info | |
macOS: | |
runs-on: macos-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup MPICH | |
id: setup1 | |
uses: ./ | |
with: | |
mpi: mpich | |
- run: test ${{ steps.setup1.outputs.mpi }} == mpich | |
- run: command -v mpichversion | |
- name: Setup Open MPI | |
id: setup2 | |
uses: ./ | |
with: | |
mpi: open-mpi | |
- run: test ${{ steps.setup2.outputs.mpi }} == openmpi | |
- run: command -v ompi_info | |
- name: Unlink Homebrew MPI formulae | |
run: brew unlink mpich openmpi | |
- name: Setup MPICH | |
id: setup3 | |
uses: ./ | |
with: | |
mpi: mpich | |
- run: test ${{ steps.setup3.outputs.mpi }} == mpich | |
- run: command -v mpichversion | |
- name: Setup Open MPI | |
id: setup4 | |
uses: ./ | |
with: | |
mpi: ompi | |
- run: test ${{ steps.setup4.outputs.mpi }} == openmpi | |
- run: command -v ompi_info | |
Windows: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Intel MPI | |
id: setup1 | |
uses: ./ | |
with: | |
mpi: intel | |
- name: Setup Microsoft MPI | |
id: setup2 | |
uses: ./ | |
with: | |
mpi: microsoft | |
- run: test ${{ steps.setup1.outputs.mpi }} == intelmpi | |
- run: test ${{ steps.setup2.outputs.mpi }} == msmpi |