mirror of
https://github.com/CoolProp/CoolProp.git
synced 2026-04-23 03:00:17 -04:00
* Enable upload to testpypi * Figure out the next available version to avoid override (especially for testpypi, shouldn't happen for pypi as we should bump in CMakeLists)
73 lines
2.1 KiB
YAML
73 lines
2.1 KiB
YAML
name: Catch2 Testing
|
|
|
|
on:
|
|
push:
|
|
branches: [ master, develop, actions_shared ]
|
|
# Sequence of patterns matched against refs/tags
|
|
tags:
|
|
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
|
|
pull_request:
|
|
branches: [ master, develop ]
|
|
|
|
env:
|
|
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
|
|
BUILD_TYPE: Release
|
|
|
|
jobs:
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Extract CoolProp version from CMakeLists.txt
|
|
shell: bash
|
|
run: |
|
|
set -x
|
|
COOLPROP_VERSION=$(python dev/extract_version.py --cmake-only)
|
|
echo COOLPROP_VERSION=$COOLPROP_VERSION >> $GITHUB_ENV
|
|
# Create the build directory too
|
|
mkdir build
|
|
|
|
- name: Configure CMake
|
|
working-directory: ./build
|
|
shell: bash
|
|
run: cmake -DCMAKE_BUILD_TYPE:STRING=$BUILD_TYPE -DCOOLPROP_SHARED_LIBRARY:BOOL=ON -DCOOLPROP_CATCH_MODULE:BOOL=ON ..
|
|
|
|
- name: Build
|
|
working-directory: ./build
|
|
shell: bash
|
|
run: |
|
|
set -x
|
|
cmake --build . --target install -j $(nproc) --config $BUILD_TYPE
|
|
|
|
- name: Test
|
|
working-directory: ./build
|
|
shell: bash
|
|
# Execute tests defined by the CMake configuration.
|
|
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
|
|
run: |
|
|
ctest -j $(nproc)
|
|
|
|
- name: Rerun failed Tests
|
|
if: failure()
|
|
working-directory: ./build
|
|
shell: bash
|
|
# Execute tests defined by the CMake configuration.
|
|
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
|
|
run: |
|
|
ctest -j $(nproc) --rerun-failed --output-on-failure
|
|
|
|
# TODO: pick one style, for now I'm doing this so I can report zero new failures compared to catch1
|
|
- name: Rerun failed Tests in CatchTestRunner directly
|
|
if: failure()
|
|
working-directory: ./build
|
|
shell: bash
|
|
# Execute tests defined by the CMake configuration.
|
|
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
|
|
run: |
|
|
./CatchTestRunner
|