Skip to content

Commit

Permalink
Enable coverage analysis (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
awvwgk authored Feb 28, 2021
1 parent 4be7d5a commit fcf7c14
Show file tree
Hide file tree
Showing 3 changed files with 122 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fixes:
- "/home/runner/work/grimme-lab/gcp::"
128 changes: 119 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,20 @@ name: CI

on: [push, pull_request]

env:
BUILD_DIR: _build_meson
PIP_PACKAGES: >-
meson==0.56.2
ninja
gcovr
jobs:
gcc-build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest, macos-latest]

env:
FC: gfortran
Expand Down Expand Up @@ -36,14 +43,117 @@ jobs:
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${GCC_V} \
--slave /usr/bin/gcov gcov /usr/bin/gcov-${GCC_V}
- name: Install meson
run: pip3 install meson==0.56.2 ninja
- name: Install meson/cmake
run: pip3 install ${{ env.PIP_PACKAGES }}

- name: Configure meson build
run: >-
meson setup ${{ env.BUILD_DIR }}
--buildtype=debug
--prefix=$PWD/_dist
--libdir=lib
-Db_coverage=true
- name: Build project (meson)
run: meson compile -C ${{ env.BUILD_DIR }}

- name: Run unit tests (meson)
run: meson test -C ${{ env.BUILD_DIR }} --print-errorlogs --no-rebuild

- name: Install project (meson)
run: meson install -C ${{ env.BUILD_DIR }} --no-rebuild

- name: Create coverage report (meson)
run: ninja -C ${{ env.BUILD_DIR }} coverage

- name: Upload coverage report
uses: codecov/codecov-action@v1


# Test native MinGW Windows build
mingw-build:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
include: [
{ msystem: MINGW64, arch: x86_64 },
# { msystem: MINGW32, arch: i686 }
]
defaults:
run:
shell: msys2 {0}
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup MSYS2 toolchain
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.msystem }}
update: false
install: >-
git
mingw-w64-${{ matrix.arch }}-gcc-fortran
mingw-w64-${{ matrix.arch }}-meson
mingw-w64-${{ matrix.arch }}-ninja
- name: Configure meson build
run: meson setup ${{ env.BUILD_DIR }}
env:
FC: gfortran
CC: gcc

- name: Build project (meson)
run: meson compile -C ${{ env.BUILD_DIR }}

- name: Run unit tests (meson)
run: meson test -C ${{ env.BUILD_DIR }} --print-errorlogs --no-rebuild
env:
OMP_NUM_THREADS: 2,1


intel-build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]

env:
FC: ifort
OMP_NUM_THREADS: 2,1

steps:
- name: Checkout code
uses: actions/checkout@v2

- uses: actions/setup-python@v1
with:
python-version: '3.x'

- name: Add Intel repository
run: |
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
sudo apt-get update
- name: Install Intel oneAPI compiler
run: |
sudo apt-get install intel-oneapi-compiler-fortran
source /opt/intel/oneapi/setvars.sh
printenv >> $GITHUB_ENV
- name: Install meson/cmake
run: pip3 install ${{ env.PIP_PACKAGES }}

- name: Configure build
run: meson setup _build
- name: Configure meson build
run: meson setup ${{ env.BUILD_DIR }}

- name: Build library
run: meson compile -C _build
- name: Build library (meson)
run: meson compile -C ${{ env.BUILD_DIR }}

- name: Run unit tests
run: meson test -C _build --print-errorlogs --no-rebuild
- name: Run unit tests (meson)
run: meson test -C ${{ env.BUILD_DIR }} --print-errorlogs --no-rebuild
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
[![CI](https://github.com/grimme-lab/gcp/workflows/CI/badge.svg)](https://github.com/grimme-lab/gcp/actions)
[![DOI](https://img.shields.io/badge/DOI-10.1063%2F1.3700154-blue)](https://doi.org/10.1063/1.3700154)
[![DOI](https://img.shields.io/badge/DOI-10.1021%2Fjp406658y-blue)](https://doi.org/10.1021/jp406658y)
[![codecov](https://codecov.io/gh/grimme-lab/gcp/branch/main/graph/badge.svg)](https://codecov.io/gh/grimme-lab/gcp)


## Installation
Expand Down

0 comments on commit fcf7c14

Please sign in to comment.