Skip to content

Commit

Permalink
[Debug] test simpler
Browse files Browse the repository at this point in the history
Signed-off-by: Cristian Le <[email protected]>
  • Loading branch information
LecrisUT committed Feb 21, 2024
1 parent 002bdab commit d481948
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 35 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ jobs:
name: test
needs: [ pre-commit ]
uses: ./.github/workflows/step_test.yaml
with:
mask-experimental: ${{ github.event_name == 'push' }}

tests-makefile:
name: test Makefile
Expand Down
55 changes: 20 additions & 35 deletions .github/workflows/step_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}}

0 comments on commit d481948

Please sign in to comment.