Skip to content

Enable parallel builds in CI #791

Enable parallel builds in CI

Enable parallel builds in CI #791

Workflow file for this run

name: basictest
on:
push:
pull_request:
schedule:
- cron: '30 18 * * 0' # 18:30 every Sunday
jobs:
preparations:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: src
- name: Pip install packages for ncdevtool
run: pip install -r ./src/devel/reqs/requirements_devel.txt
- name: ncdevtool checks
run: ./src/devel/bin/ncdevtool check -n "fix""me"
- name: determine nprocs
id: nprocs
run: echo "nprocs=$(./src/devel/bin/ncdevtool nprocs)" >> $GITHUB_OUTPUT
outputs:
nprocs: ${{ steps.nprocs.outputs.nprocs }}
build:
needs: [ preparations ]
strategy:
matrix:
include:
# - { os: ubuntu-24.04-arm, CC: gcc-12, CXX: g++-12, python: '3.12', buildtype: 'Release' }
# - { os: ubuntu-24.04-arm, CC: gcc-12, CXX: g++-12, python: '3.12', buildtype: 'Debug' }
# - { os: ubuntu-20.04, CC: gcc-10, CXX: g++-10, python: '3.8', buildtype: 'Release' }
# - { os: ubuntu-22.04, CC: gcc, CXX: g++, python: '3.9', buildtype: 'Release' }
- { os: ubuntu-latest, CC: gcc-13, CXX: g++-13, python: '3.12', buildtype: 'Release' }
# - { os: ubuntu-latest, CC: clang, CXX: clang++, python: '3.11', buildtype: 'Debug' }
# - { os: ubuntu-latest, CC: gcc-12, CXX: g++-12, python: '3.12', buildtype: 'Release' }
# - { os: ubuntu-latest, CC: gcc, CXX: g++, python: '3.13', buildtype: 'Release' }
# - { os: macos-latest, CC: clang, CXX: clang++, python: "3.12", buildtype: 'Release' }
# - { os: macos-13, CC: clang, CXX: clang++, python: "3.11", buildtype: 'Release' }
# name: ${{ matrix.os }}.${{ matrix.CC }}.python-${{ matrix.python }}-${{ matrix.buildtype }}
runs-on: ${{ matrix.os }}
env:
CC: ${{ matrix.CC }}
CXX: ${{ matrix.CXX }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: src
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Pip install dependencies
run: python -mpip install -r ./src/devel/reqs/requirements_all_and_devel.txt
- name: Configure CMake
run: >
cmake
-S ${{github.workspace}}/src
-B ${{github.workspace}}/build
--parallel ${{ needs.preparations.outputs.nprocs }}
-DCMAKE_BUILD_TYPE=${{ matrix.buildtype }}
-DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install
-DNCRYSTAL_ENABLE_EXAMPLES=ON
-DNCRYSTAL_BUILD_STRICT=ON
-DNCRYSTAL_ENABLE_TESTING=ON
-DMCTOOLS_REQUIRE_ALL_TEST_DEPS=ON
- name: Build
run: >
cmake
--build ${{github.workspace}}/build
--config ${{ matrix.buildtype }}
- name: CTest (from the build area)
run: |
set -eux
cd ${{github.workspace}}/build
ctest --output-on-failure --test-output-size-failed 100000 --test-output-truncation middle