Skip to content

ci

ci #1

Workflow file for this run

name: CI
on: [push]
jobs:
tests_and_coverage:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: [3.9]
toolchain:
- {compiler: gcc, version: 10}
- {compiler: gcc, version: 11}
- {compiler: gcc, version: 12}
- {compiler: gcc, version: 13}
- {compiler: intel, version: '2024.1'}
- {compiler: intel, version: '2023.2'}
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: false
- name: Setup Fortran Compiler
uses: fortran-lang/setup-fortran@v1
id: setup-fortran
with:
compiler: ${{ matrix.toolchain.compiler }}
version: ${{ matrix.toolchain.version }}
- name: Install Python
uses: actions/setup-python@v1 # Use pip to install latest CMake, & FORD/Jin2For, etc.
with:
python-version: ${{ matrix.python-version }}
- name: Setup Graphviz
uses: ts-graphviz/setup-graphviz@v1
- name: Setup Fortran Package Manager
uses: fortran-lang/setup-fpm@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ford numpy matplotlib gcovr numpy scipy
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
sudo apt-get install libnlopt-dev
- name: Run tests without coverage
if: ${{ env.FC != 'gfortran' }}
run: |
fpm test --profile release --flag "-g" --compiler ${{ env.FC }} --c-compiler gcc
- name: Run tests with coverage
if: ${{ env.FC == 'gfortran' }}
run: |
fpm test --profile release --flag "-g -coverage" --compiler ${{ env.FC }} --c-compiler gcc
- name: Coverage
run: bash ci/ci.sh coverage
if: ${{ env.FC == 'gfortran' }}
- name: Upload coverage reports to Codecov
if: ${{ env.FC == 'gfortran' }}
uses: codecov/codecov-action@v4.0.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: fedebenelli/ForTimize