CI: create github workflow #14
Workflow file for this run
This file contains hidden or 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
| name: DisCoTec-github-CI | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| workflow_dispatch: | |
| # ── global options (analogous to Jenkins logRotation & timeout) | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| test-matrix: | |
| name: build-and-test (${{ matrix.compiler }}, ${{ matrix.mpi }}, ${{ matrix.build_type }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| compiler: [gcc] # todo test clang/flang | |
| mpi: [openmpi, mpich] | |
| build_type: [Release, Debug] | |
| env: | |
| SPACK_USER_CACHE_PATH: spack/user_cache | |
| SPACK_USER_CONFIG_PATH: spack/user_config | |
| SPACK_SYSTEM_CONFIG_PATH: spack/system_config | |
| steps: | |
| - name: update system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y build-essential cmake # libhdf5-dev \ | |
| # liblz4-dev libboost-test-dev libboost-serialization-dev \ | |
| # libboost-filesystem-dev libboost-system-dev \ | |
| # libboost-program-options-dev libboost-date-time-dev | |
| if [ "${{ matrix.compiler }}" == "gcc" ]; then | |
| sudo apt-get install -y gcc | |
| elif [ "${{ matrix.compiler }}" == "clang" ]; then | |
| sudo apt-get install -y clang-20 flang-20 | |
| fi | |
| # if [ "${{ matrix.mpi }}" == "openmpi" ]; then | |
| # sudo apt-get install -y libopenmpi-dev | |
| # elif [ "${{ matrix.mpi }}" == "mpich" ]; then | |
| # sudo apt-get install -y mpich | |
| # fi | |
| - name: Checkout spack | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: spack/spack | |
| ref: v1.0.2 | |
| path: spack | |
| - name: Spack bootstrap & install | |
| run: | | |
| . ./spack/share/spack/setup-env.sh | |
| spack bootstrap now | |
| spack compiler find | |
| spack external find --exclude curl,perl | |
| spack mirror add --unsigned github-actions-buildcache oci://ghcr.io/spack/github-actions-buildcache | |
| spack install ${{ matrix.compiler }} | |
| spack install --only dependencies -y discotec@main -lto +compression %${{ matrix.compiler }} ^${{ matrix.mpi }} | |
| - name: Checkout DisCoTec | |
| uses: actions/checkout@v4 | |
| with: | |
| path: discotec | |
| - name: Load Spack + dependencies | |
| run: | | |
| ls -l | |
| echo $(pwd) | |
| . spack/share/spack/setup-env.sh | |
| spack find | |
| spack load --first ${{ matrix.mpi }} # %${{ matrix.compiler }} | |
| spack load --first cmake # %${{ matrix.compiler }} | |
| spack load --first boost # %${{ matrix.compiler }} | |
| spack load --first glpk highfive lz4 | |
| - name: CMake Configure | |
| working-directory: discotec | |
| run: | | |
| cmake -B build -S . \ | |
| -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ | |
| -DDISCOTEC_TEST=ON -DDISCOTEC_TIMING=ON \ | |
| -DDISCOTEC_ENABLEFT=OFF -DDISCOTEC_GENE=OFF \ | |
| -DDISCOTEC_USE_HIGHFIVE=ON -DDISCOTEC_OPENMP=ON \ | |
| -DDISCOTEC_USE_LTO=OFF -DDISCOTEC_WITH_COMPRESSION=ON | |
| - name: Build | |
| working-directory: discotec | |
| run: cmake --build build -j | |
| - name: Unit tests | |
| working-directory: discotec/tests | |
| timeout-minutes: 360 | |
| run: | | |
| OMPI_ALLOW_RUN_AS_ROOT=1 \ | |
| mpiexec.${{ matrix.mpi }} -n 9 ./test_distributedcombigrid_boost --run_test=mpisystem | |
| mpiexec.${{ matrix.mpi }} -n 9 ./test_distributedcombigrid_boost --run_test=fullgrid | |
| mpiexec.${{ matrix.mpi }} -n 9 ./test_distributedcombigrid_boost --run_test=hierarchization --log_level=message | |
| mpiexec.${{ matrix.mpi }} -n 9 ./test_distributedcombigrid_boost --run_test=io | |
| mpiexec.${{ matrix.mpi }} -n 9 ./test_distributedcombigrid_boost --run_test=loadmodel | |
| mpiexec.${{ matrix.mpi }} -n 9 ./test_distributedcombigrid_boost --run_test=reduce | |
| mpiexec.${{ matrix.mpi }} -n 9 ./test_distributedcombigrid_boost --run_test=rescheduling | |
| mpiexec.${{ matrix.mpi }} -n 9 ./test_distributedcombigrid_boost --run_test=task |