Skip to content

Merge pull request #30 from jchristopherson/v1.5.6 #311

Merge pull request #30 from jchristopherson/v1.5.6

Merge pull request #30 from jchristopherson/v1.5.6 #311

Workflow file for this run

name: fpm
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
build-and-test:
name: ${{ matrix.os }} / ${{ matrix.compiler }} / shared=${{ matrix.shared }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
compiler: gcc
version: '14'
shared: false
- os: ubuntu-latest
compiler: gcc
version: '14'
shared: true
- os: ubuntu-latest
compiler: gcc
version: '15'
shared: false
- os: ubuntu-latest
compiler: gcc
version: '15'
shared: true
- os: ubuntu-latest
compiler: intel
version: '2023.2'
shared: true
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Fortran toolchain
uses: fortran-lang/setup-fortran@v1
id: setup-fortran
with:
compiler: ${{ matrix.compiler }}
version: ${{ matrix.version }}
- name: Show compiler version
shell: bash
env:
FC: ${{ steps.setup-fortran.outputs.fc }}
CC: ${{ steps.setup-fortran.outputs.cc }}
run: |
"$FC" --version
- name: Install BLAS/LAPACK (Linux)
if: runner.os == 'Linux'
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y libopenblas-dev liblapack-dev
- name: Install fpm
uses: fortran-lang/setup-fpm@v5
with:
fpm-version: 'v0.10.1'
- name: Build FSTATS
shell: bash
env:
FC: ${{ steps.setup-fortran.outputs.fc }}
CC: ${{ steps.setup-fortran.outputs.cc }}
FPM_FC: ${{ steps.setup-fortran.outputs.fc }}
FPM_CC: ${{ steps.setup-fortran.outputs.cc }}
FPM_FLAGS: ${{ matrix.shared && '--flag=-fPIC' || '' }}
run: |
if [[ -n "$FPM_FLAGS" ]]; then
fpm build $FPM_FLAGS
else
fpm build
fi
- name: Run tests
shell: bash
env:
FC: ${{ steps.setup-fortran.outputs.fc }}
CC: ${{ steps.setup-fortran.outputs.cc }}
FPM_FC: ${{ steps.setup-fortran.outputs.fc }}
FPM_CC: ${{ steps.setup-fortran.outputs.cc }}
FPM_FLAGS: ${{ matrix.shared && '--flag=-fPIC' || '' }}
run: |
if [[ -n "$FPM_FLAGS" ]]; then
fpm test $FPM_FLAGS
else
fpm test
fi