Skip to content

CO2_sequestration_v1.0 #146

CO2_sequestration_v1.0

CO2_sequestration_v1.0 #146

Workflow file for this run

name: Build
on:
push:
branches:
- 'develop'
paths-ignore:
- 'README.md'
- 'docs/**'
pull_request:
paths-ignore:
- 'README.md'
- 'docs/**'
env:
BUILD_PREFIX: ~/_build
INSTALL_PREFIX: ~/_install
BUILD_TYPE: Debug
GALOIS: ON
MUMPS: ON
jobs:
prepare-dependencies:
strategy:
matrix:
cxx: [GCC-10, Clang-12]
name: Build dependencies
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Prepare for building
id: prepare
uses: ./.github/actions/prepare
with:
cxx: ${{ matrix.cxx }}
- name: Cache dependencies
uses: actions/cache@v2
id: cache-libs
with:
path: ${{ env.INSTALL_PREFIX }}
key: libs-v2-${{ steps.prepare.outputs.cxx-family }}
- name: Build dependencies
if: steps.cache-libs.outputs.cache-hit != 'true'
run: scripts/install-dependencies.sh ${BUILD_PREFIX} ${INSTALL_PREFIX}
build:
strategy:
fail-fast: false
matrix:
cxx: [GCC-7, GCC-8, GCC-9, GCC-10, GCC-11, Clang-6, Clang-10, Clang-12]
build-type: [Release]
galois: [ON]
mumps: [ON]
shared: [OFF]
include:
# Feature combinations
- cxx: gcc-10
build-type: Release
galois: ON
mumps: OFF
- cxx: gcc-10
build-type: Release
galois: OFF
mumps: ON
- cxx: gcc-10
build-type: Release
galois: OFF
mumps: OFF
# Shared libraries
- cxx: gcc-10
build-type: Release
galois: ON
mumps: ON
shared: ON
- cxx: Clang-12
build-type: Release
galois: ON
mumps: ON
shared: ON
name: >
${{ matrix.cxx }}
${{ matrix.build-type }}
${{ matrix.shared == 'ON' && 'shared' || '' }}
(${{ matrix.galois == 'ON' && 'Galois' || '' }}
${{ matrix.mumps == 'ON' && 'MUMPS' || '' }})
runs-on: ubuntu-20.04
needs: prepare-dependencies
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Prepare for building
id: prepare
uses: ./.github/actions/prepare
with:
cxx: ${{ matrix.cxx }}
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ env.INSTALL_PREFIX }}
key: libs-v2-${{ steps.prepare.outputs.cxx-family }}
- name: Configure
uses: ./.github/actions/configure
with:
cxx-flags: -Werror -fdiagnostics-color=always
build-type: ${{ matrix.build-type }}
use-galois: ${{ matrix.galois }}
use-mumps: ${{ matrix.mumps }}
shared: ${{ matrix.shared }}
- name: Build library
run: cmake --build build --target ADS
- name: Build examples
run: cmake --build build --target ads-examples
- name: Build tools
run: cmake --build build --target ads-tools
- name: Build tests
run: cmake --build build --target ads-suite
- name: Test
run: ctest --test-dir build --output-on-failure
sanitize:
name: "Sanitizers"
runs-on: ubuntu-20.04
needs: prepare-dependencies
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Prepare for building
id: prepare
uses: ./.github/actions/prepare
with:
cxx: Clang-12
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ env.INSTALL_PREFIX }}
key: libs-v2-${{ steps.prepare.outputs.cxx-family }}
- name: Configure
uses: ./.github/actions/configure
with:
build-type: Debug
use-galois: ON
use-mumps: ON
use-sanitizers: "address;undefined"
- name: Build tests
run: cmake --build build --target ads-suite
- name: Test
run: ctest --test-dir build --output-on-failure
coverage:
name: "Code coverage"
runs-on: ubuntu-20.04
needs: prepare-dependencies
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Prepare for building
id: prepare
uses: ./.github/actions/prepare
with:
cxx: Clang-12
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ env.INSTALL_PREFIX }}
key: libs-v2-${{ steps.prepare.outputs.cxx-family }}
- name: Setup tools
run: |
sudo update-alternatives --install /usr/bin/llvm-profdata llvm-profdata /usr/bin/llvm-profdata-12 100
sudo update-alternatives --install /usr/bin/llvm-cov llvm-cov /usr/bin/llvm-cov-12 100
- name: Configure
uses: ./.github/actions/configure
with:
build-type: Debug
use-galois: ON
use-mumps: ON
enable-coverage: ON
- name: Generate coverage data
run: cmake --build build --target coverage
- name: Upload to Codecov
uses: codecov/codecov-action@v1
with:
files: build/coverage.txt
check-format:
name: "Code formatting"
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup clang-format
run: |
sudo update-alternatives --remove-all clang-format
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-12 100
- name: Run clang-format
run: scripts/format.py check
check-spelling:
name: "Spelling"
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install codespell
run: sudo pip install codespell
- name: Run codespell
run: scripts/spelling.sh
check-header-guards:
name: "Header guards"
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Check header guards
run: scripts/guards.py check
check-copyright:
name: "Copyright"
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Check copyright headers
run: scripts/copyright.py check