Simplify things #32
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
# Workflow settings | |
# See https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions | |
name: Test pressio-tutorials | |
on: | |
push: | |
branches: [main, develop] | |
pull_request: | |
branches: [main, develop] | |
concurrency: # Concurrency group: which jobs run together and which cancel each other | |
group: CI-${{ github.head_ref }} | |
cancel-in-progress: true | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false # true -> cancel all jobs if any fails | |
max-parallel: 8 | |
# Build matrix for your jobs: you can define different variations to run each job in | |
# matrix configurations - reachable with ${{ matrix.config.<key> }}. | |
# Extra options: | |
# - cxx: path to C++ compiler | |
# - mode: build mode inside Pressio (Debug / Release) | |
matrix: | |
config: | |
- { cxx: clang++, mode: Release } | |
- { cxx: clang++, mode: Debug } | |
- { cxx: g++, mode: Release } | |
- { cxx: g++, mode: Debug } | |
env: # environment variables available to all steps | |
CXX: ${{ matrix.config.cxx }} | |
APT_PACKAGES: python3 pip python-is-python3 g++ clang gpg wget cmake | |
PIP_PACKAGES: pytest build numpy scipy matplotlib PyYAML GitPython | |
SRC_HOME: /home/runner/work/pressio-tutorials/pressio-tutorials | |
BUILD_DIR: /home/runner/work/build/pressio-tutorials | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install packages | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y --install-suggests $APT_PACKAGES | |
- name: Check environment | |
run: | | |
echo ====================================================== | |
echo CPU Threads: $(grep -c processor /proc/cpuinfo) | |
echo ====================================================== | |
echo $(which $CXX) --version | |
$CXX --version | |
echo ====================================================== | |
echo $(which python) --version | |
python --version | |
echo ====================================================== | |
echo Source directory: $SRC_HOME | |
echo Build directory: $BUILD_DIR | |
echo ====================================================== | |
git --version | |
cd $SRC_HOME | |
git status | |
- name: Install required Python modules | |
run: | | |
sudo pip install $PIP_PACKAGES | |
echo ====================================================== | |
pip list | |
echo ====================================================== | |
- name: Configure C++ tests | |
run: | | |
cmake \ | |
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \ | |
-DCMAKE_BUILD_TYPE:STRING=${{ matrix.config.mode }} \ | |
-B $BUILD_DIR -S $SRC_HOME | |
- name: Build tests | |
run: | | |
export NUM_CPU=$(grep -c processor /proc/cpuinfo) | |
cmake --build $BUILD_DIR -j $NUM_CPU | |
- name: Run tutorials | |
run: | | |
cd $BUILD_DIR/ode-using-eigen-types | |
bash runall_for_ci.sh | |
cd ../nonlinearsolvers-using-eigen-types | |
bash runall_for_ci.sh |