-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Cristian Le <[email protected]>
- Loading branch information
Showing
2 changed files
with
22 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,29 +2,38 @@ name: test | |
|
||
on: | ||
workflow_call: | ||
inputs: | ||
mask-experimental: | ||
type: boolean | ||
default: true | ||
description: Always report experimental test as successful | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
tests: | ||
name: Check on ${{ matrix.toolchain }} toolchain ${{ matrix.mpi }} | ||
name: > | ||
🖥️ ${{ matrix.os || 'Fedora' }} | ||
${{ !matrix.os && format('🛠️ {0}', matrix.toolchain) || '' }} | ||
${{ matrix.mpi && format('🖧 {0}', matrix.mpi) || '' }} | ||
${{ matrix.experimental && '[🧪 Experimental]' || '' }} | ||
runs-on: ${{ matrix.os || 'ubuntu-latest' }} | ||
container: ${{ !matrix.os && 'ghcr.io/lecrisut/dev-env:main' || '' }} | ||
continue-on-error: ${{ matrix.experimental || false }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
toolchain: [ gcc, llvm, intel ] | ||
mpi: ['', openmpi, mpich, intel] | ||
mpi: [false, openmpi, mpich, intel] | ||
include: | ||
# flang is missing features in 16.0.6 | ||
- toolchain: llvm | ||
experimental: true | ||
steps: | ||
- name: Install missing packages | ||
run: dnf install -y bzip2 python-unversioned-command | ||
- name: Load mpi module ${{ matrix.mpi }} | ||
- name: Load mpi module ${{ matrix.mpi || '' }} | ||
run: | | ||
# Get interactive profile to be able to load modules | ||
source /etc/profile | ||
|
@@ -40,47 +49,23 @@ jobs: | |
# Set MPI flag on | ||
echo "WITH_MPI=ON" >> $GITHUB_ENV | ||
if: ${{ matrix.mpi }} | ||
if: matrix.mpi | ||
- name: Enable msvc toolchain on windows | ||
uses: ilammy/msvc-dev-cmd@v1 | ||
if: contains(matrix.os, 'windows') | ||
- name: Activate Intel compilers | ||
# Not elegant, it will propagate all environment variable. | ||
# Intel does not provide a way to output the environment variables to a file | ||
# Note: PATH needs to be exported to GITHUB_PATH otherwise it can be overwritten | ||
run: | | ||
source /etc/profile | ||
printenv > orig_env | ||
module load compiler | ||
printenv > module_env | ||
diff orig_env module_env | sed -n 's/> //p' >> $GITHUB_ENV | ||
source /opt/intel/oneapi/setvars.sh | ||
printenv >> $GITHUB_ENV | ||
echo $PATH >> $GITHUB_PATH | ||
if: matrix.toolchain == 'intel' | ||
- uses: actions/checkout@v3 | ||
- uses: lukka/get-cmake@latest | ||
- name: Run CMake configuration for ${{ matrix.toolchain }} toolchain | ||
- name: Run CMake workflow ${{ matrix.toolchain }}-ci | ||
uses: lukka/[email protected] | ||
with: | ||
workflowPreset: "${{ matrix.toolchain }}-ci" | ||
|
||
coverage: | ||
name: Check test coverage | ||
runs-on: ubuntu-latest | ||
needs: [ tests ] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: lukka/get-cmake@latest | ||
- name: Get test coverage | ||
uses: lukka/[email protected] | ||
with: | ||
workflowPreset: ci-coverage | ||
- name: Get lcov data | ||
uses: danielealbano/lcov-action@v3 | ||
with: | ||
# Note lcov-action prepends and appends wild-cards *. Account for those | ||
# https://github.com/danielealbano/lcov-action/issues/11 | ||
remove_patterns: /test/,/cmake-build*/ | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
name: ${{ matrix.coverage }} coverage | ||
files: coverage.info | ||
flags: ${{ matrix.coverage }} | ||
verbose: true | ||
continue-on-error: ${{ matrix.experimental && inputs.mask-experimental}} |