Merge pull request #262 from glotzerlab/dependabot/pip/doc/pip-661d9d… #81
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
name: Unit test | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
on: | |
pull_request: | |
push: | |
branches: | |
- "trunk" | |
workflow_dispatch: | |
defaults: | |
run: | |
shell: bash -leo pipefail {0} | |
jobs: | |
build_test: | |
name: Unit test [py${{ matrix.python }} ${{ matrix.os }}] | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-24.04] | |
python: ['39', '310', '311', '312', '313'] | |
include: | |
# Render gallery images in one configuration | |
- os: 'ubuntu-24.04' | |
python: '313' | |
render_gallery: true | |
# Test macOS and windows on oldest and latest versions. | |
- os: 'macos-14' | |
python: '313' | |
- os: 'windows-2022' | |
python: '313' | |
cmake_generator: "Visual Studio 17 2022" | |
- os: 'windows-2022' | |
python: '39' | |
cmake_generator: "Visual Studio 17 2022" | |
- os: 'windows-2019' | |
python: '39' | |
cmake_generator: "Visual Studio 16 2019" | |
- os: 'macos-14' | |
python: '39' | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
path: code | |
submodules: true | |
- name: Create Python Environment | |
uses: mamba-org/setup-micromamba@617811f69075e3fd3ae68ca64220ad065877f246 # v2.0.0 | |
with: | |
micromamba-version: '2.0.2-2' | |
environment-name: test | |
environment-file: code/.github/workflows/environments/py${{ matrix.python }}-conda-lock.yml | |
- name: Configure | |
run: > | |
cmake -S code -B build | |
-DENABLE_EMBREE=ON | |
-DENABLE_OPTIX=OFF | |
-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=ON | |
env: | |
CMAKE_PREFIX_PATH: ${{ github.workspace }}\env | |
- name: Build | |
run: cmake --build build --config Release -j | |
- name: Install | |
run: cmake --install build --config Release | |
- name: Run tests | |
run: python -m pytest --pyargs fresnel -v --log-level=DEBUG --durations=0 --durations-min=0.1 | |
- name: Render gallery images | |
if: ${{ matrix.render_gallery }} | |
run: for i in *.py; do echo "Rendering $i" && python3 $i || exit 1; done | |
working-directory: code/doc/gallery | |
# This job is used to provide a single requirement for branch merge conditions. | |
tests_complete: | |
name: Unit test | |
if: always() | |
needs: [build_test] | |
runs-on: ubuntu-latest | |
steps: | |
- run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}' | |
- name: Done | |
run: echo "Done." |