Skip to content

long check

long check #147

Workflow file for this run

name: "long check"
on:
workflow_dispatch: # allows manual triggering
schedule:
- cron: "0 0 * * *" # runs daily at 00:00
jobs:
check_new_commit:
runs-on: ubuntu-latest
outputs:
nb_commits: ${{ steps.new_commits.outputs.nb_commits }}
steps:
- uses: actions/checkout@v3
- id: new_commits
run: echo "nb_commits=$(git log --oneline --since '24 hours ago' | wc -l)" >> $GITHUB_OUTPUT
#
# Check samurai with clang-tidy
#
#########################################################
clang-tidy-check:
needs: check_new_commit
if: needs.check_new_commit.outputs.nb_commits > 0
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache
uses: actions/cache@v3
with:
path: |
~/.cache/ccache
~/micromamba-root/envs/samurai-env
key: clang-tidy
- name: Mamba and samurai env installation
uses: mamba-org/setup-micromamba@v1
with:
environment-file: conda/environment.yml
environment-name: samurai-env
cache-environment: true
- name: clang-tidy installation
shell: bash -l {0}
run: |
conda install -y clang-tools cxx-compiler clang clangxx
pip install compdb
- name: Configure
shell: bash -l {0}
run: |
cmake . -Bbuild -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=Debug -DBUILD_DEMOS=ON
compdb -p build list > compile_commands.json
- name: run clang-tidy on samurai
shell: bash -l {0}
run: |
run-clang-tidy
#
# Check conan build
#
#########################################################
conan:
needs: check_new_commit
if: needs.check_new_commit.outputs.nb_commits > 0
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- windows-2022
- ubuntu-22.04
- macos-12
compiler:
# - llvm
- gcc
CMAKE_GENERATOR:
- "Ninja Multi-Config"
include:
- os: windows-2022
compiler: msvc
CMAKE_GENERATOR: "Visual Studio 17 2022"
# exclude:
# - os: windows-2022
# compiler: llvm
steps:
- uses: actions/checkout@v3
- name: Cache
uses: actions/cache@v3
with:
path: |
~/.conan/
~/.cache/ccache
~/.cache/pip
~/Library/Caches/ccache
C:\Users\runneradmin\cmake
C:\Users\runneradmin\AppData\Local\ccache
key: conan-${{ runner.os }}-${{ matrix.compiler }}-${{ hashFiles('./conanfile.py')}}
restore-keys: |
conan-${{ runner.os }}-${{ matrix.compiler }}-
- name: configure Pagefile
if: runner.os == 'Windows'
uses: al-cheb/configure-pagefile-action@v1.2
with:
minimum-size: 16GB
maximum-size: 16GB
disk-root: "C:"
- name: Setup Cpp
uses: aminya/setup-cpp@v0.26.2
with:
compiler: ${{ matrix.compiler }}
vcvarsall: ${{ contains(matrix.os, 'windows' )}}
cmake: true
ninja: true
conan: true
vcpkg: false
ccache: false
clangtidy: false
task: false
cppcheck: false
gcovr: false
opencppcoverage: false
# - name: Information about ccache
# run: |
# ccache -s -v
- name: Configure CMake
run: |
cmake . -B ./build -G "${{matrix.CMAKE_GENERATOR}}" -DCMAKE_BUILD_TYPE=Release -DENABLE_CONAN_OPTION=ON -DBUILD_TESTS=ON -DBUILD_DEMOS=ON
- name: Build
run: |
cmake --build ./build --config Release
- name: Install hdf5 with brew
if: runner.os == 'Macos'
env:
ARCHFLAGS: "-arch x86_64"
run: |
brew install hdf5@1.10
export HDF5_DIR=/usr/local/opt/hdf5@1.10
pip3 install pytest h5py
- name: Install Python dependencies
if: runner.os != 'Macos'
run: |
pip3 install pytest h5py
- name: Unix test
if: runner.os != 'Windows'
run: |
./build/test/Release/test_samurai_lib
cd test; pytest --h5diff
- name: Windows test
if: runner.os == 'Windows'
run: |
.\build\test\Release\test_samurai_lib
# cd test; pytest -s --h5diff
#
# Check vcpkg build
#
#########################################################
vcpkg:
needs: check_new_commit
if: needs.check_new_commit.outputs.nb_commits > 0
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- windows-2022
- ubuntu-22.04
- macos-12
compiler:
# - llvm
- gcc
CMAKE_GENERATOR:
- "Ninja Multi-Config"
include:
- os: windows-2022
compiler: msvc
CMAKE_GENERATOR: "Visual Studio 17 2022"
# exclude:
# - os: windows-2022
# compiler: llvm
steps:
- uses: actions/checkout@v3
- name: Cache
uses: actions/cache@v3
with:
path: |
~/vcpkg
~/.cache/ccache
~/.cache/pip
~/Library/Caches/ccache
./build/vcpkg_installed
${{ env.CONAN_USER_HOME }}
${{ env.HOME }}/.cache/vcpkg/archives
${{ env.XDG_CACHE_HOME }}/vcpkg/archives
${{ env.LOCALAPPDATA }}\vcpkg\archives
${{ env.APPDATA }}\vcpkg\archives
C:\Users\runneradmin\cmake
C:\Users\runneradmin\AppData\Local\ccache
key: vcpkg-${{ runner.os }}-${{ matrix.compiler }}-${{ hashFiles('./vcpkg.json')}}
restore-keys: |
vcpkg-${{ runner.os }}-${{ matrix.compiler }}-${{ hashFiles('./vcpkg.json') }}
vcpkg-${{ runner.os }}-${{ matrix.compiler }}-
- name: Setup Cpp
uses: aminya/setup-cpp@v0.26.2
with:
compiler: ${{ matrix.compiler }}
vcvarsall: ${{ contains(matrix.os, 'windows' )}}
cmake: true
ninja: true
vcpkg: true
ccache: false
clangtidy: false
task: false
cppcheck: false
gcovr: false
opencppcoverage: false
# - name: Information about ccache
# run: |
# ccache -s -v
- name: Configure CMake
run: |
cmake -B ./build -S . -G "${{matrix.CMAKE_GENERATOR}}" -DENABLE_VCPKG=ON -DBUILD_TESTS=ON -DBUILD_DEMOS=ON
- name: Build
run: |
cmake --build ./build --config Release
- name: Install hdf5 with brew
if: runner.os == 'Macos'
env:
ARCHFLAGS: "-arch x86_64"
run: |
brew install hdf5@1.10
export HDF5_DIR=/usr/local/opt/hdf5@1.10
pip3 install pytest h5py
- name: Install Python dependencies
if: runner.os != 'Macos'
run: |
pip3 install pytest h5py
- name: Unix test
if: runner.os != 'Windows'
run: |
./build/test/Release/test_samurai_lib
cd test; pytest --h5diff
- name: Windows test
if: runner.os == 'Windows'
run: |
.\build\test\Release\test_samurai_lib
cd test; pytest -s --h5diff
#
# Check windows build using mamba
#
#########################################################
win-mamba:
needs: check_new_commit
if: needs.check_new_commit.outputs.nb_commits > 0
runs-on: windows-2022
steps:
- uses: actions/checkout@v3
- name: Mamba and samurai env installation
uses: mamba-org/setup-micromamba@v1
with:
environment-file: conda/environment.yml
environment-name: samurai-env
cache-environment: true
- name: micromamba informations
shell: bash -l {0}
run: |
micromamba info
micromamba list
- name: Configure
shell: bash -l {0}
run: |
cmake \
. \
-Bbuild \
-G "Visual Studio 17 2022" \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_DEMOS=ON \
-DBUILD_TESTS=ON
- name: Build
shell: bash -l {0}
run: |
cmake --build ./build --config Release
- name: Windows test
shell: bash -l {0}
run: |
./build/test/Release/test_samurai_lib
cd test; pytest -s --h5diff