mirror of
https://github.com/slsdetectorgroup/aare.git
synced 2026-11-04 08:23:12 +01:00
Pull requests and manual wheel builds no longer rely on a hardcoded CIBW_SKIP list. A step asks cibuildwheel which identifiers pyproject.toml selects on the runner and exports the newest as CIBW_BUILD, so adding or dropping a Python version is a pyproject.toml-only change. The cibuildwheel version is pinned once at job level. The docs and conda build jobs get names without the Python version, "CMake build on <platform>" and "Conda build on <platform>", so the required status checks on main keep matching when the version is bumped. The ruleset must be updated from "build (ubuntu-latest, 3.12)" to the two new names when this merges.
100 lines
2.7 KiB
YAML
100 lines
2.7 KiB
YAML
name: Build the package using cmake then documentation
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
pull_request:
|
|
release:
|
|
types:
|
|
- published
|
|
|
|
env:
|
|
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
|
|
BUILD_TYPE: Debug
|
|
|
|
permissions:
|
|
contents: read
|
|
pages: write
|
|
id-token: write
|
|
|
|
jobs:
|
|
build:
|
|
# The name leaves out the Python version so that the required status
|
|
# check on main keeps matching when the version is bumped
|
|
name: CMake build on ${{ matrix.platform }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
platform: [ubuntu-latest, macos-latest]
|
|
python-version: ["3.14",]
|
|
|
|
runs-on: ${{ matrix.platform }}
|
|
|
|
env:
|
|
# sccache keeps compiled objects in the GitHub Actions cache
|
|
SCCACHE_GHA_ENABLED: "true"
|
|
|
|
defaults:
|
|
run:
|
|
shell: "bash -l {0}"
|
|
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
|
|
- name: Get conda
|
|
uses: conda-incubator/setup-miniconda@v4
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
environment-file: etc/dev-env.yml
|
|
miniforge-version: latest
|
|
channels: conda-forge
|
|
conda-remove-defaults: "true"
|
|
|
|
- uses: mozilla-actions/sccache-action@v0.0.11
|
|
with:
|
|
version: "v0.18.0"
|
|
|
|
# Precompiled headers are disabled because sccache does not cache
|
|
# compilations that use one
|
|
- name: Build library and docs
|
|
run: |
|
|
mkdir build
|
|
cd build
|
|
cmake .. -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DAARE_SYSTEM_LIBRARIES=ON -DAARE_PYTHON_BINDINGS=ON -DAARE_DOCS=ON -DAARE_TESTS=ON -DAARE_WARNINGS_AS_ERRORS=ON -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON
|
|
make -j 4
|
|
make docs
|
|
|
|
- name: Compiler cache statistics
|
|
run: sccache --show-stats
|
|
|
|
- name: C++ unit tests
|
|
working-directory: ${{github.workspace}}/build
|
|
run: ctest -C ${{env.BUILD_TYPE}} -j4
|
|
|
|
|
|
- name: Python unit tests
|
|
working-directory: ${{github.workspace}}/build
|
|
run: python -m pytest ${{github.workspace}}/python/tests/
|
|
|
|
- name: Upload static files as artifact
|
|
if: matrix.platform == 'ubuntu-latest'
|
|
id: deployment
|
|
uses: actions/upload-pages-artifact@v5
|
|
with:
|
|
path: build/docs/html/
|
|
deploy:
|
|
environment:
|
|
name: github-pages
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
runs-on: ubuntu-latest
|
|
needs: build
|
|
if: (github.event_name == 'release' && github.event.action == 'published') || (github.event_name == 'workflow_dispatch' )
|
|
steps:
|
|
- name: Deploy to GitHub Pages
|
|
id: deployment
|
|
uses: actions/deploy-pages@v5
|
|
|
|
|
|
|
|
|