Skip to content

Commit

Permalink
Add fpm workflow for testing (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
gha3mi committed Feb 21, 2024
1 parent 91a4037 commit cde5721
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/fpm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: fpm

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
test:
runs-on: ${{ matrix.os }}
permissions:
contents: write
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
toolchain:
- {compiler: gcc}
- {compiler: intel}
- {compiler: intel-classic}
exclude:
- os: macos-latest
toolchain: {compiler: intel}

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: recursive

- name: Setup Fortran Package Manager (fpm)
uses: fortran-lang/setup-fpm@main
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Setup Fortran Compiler
uses: fortran-lang/setup-fortran@v1
id: setup-fortran
with:
compiler: ${{ matrix.toolchain.compiler }}
version: ${{ matrix.toolchain.version }}

- name: Run Tests (Debug)
run: fpm test --profile debug --compiler ${{ env.FC}}
env:
FC: ${{ steps.setup-fortran.outputs.fc }}

- name: Run Tests (Release)
run: fpm test --profile release --compiler ${{ env.FC}}
env:
FC: ${{ steps.setup-fortran.outputs.fc }}

- name: Run Examples (Debug)
run: fpm run --example --all --profile debug --compiler ${{ env.FC}}
env:
FC: ${{ steps.setup-fortran.outputs.fc }}

- name: Run Examples (Release)
run: fpm run --example --all --profile release --compiler ${{ env.FC}}
env:
FC: ${{ steps.setup-fortran.outputs.fc }}

0 comments on commit cde5721

Please sign in to comment.