Sync objcryst upstream and add standalone unit-test workflow #28
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: Unit tests | |
| on: | |
| pull_request: | |
| workflow_dispatch: | |
| concurrency: | |
| group: unit-tests-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| unit-tests: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - label: ubuntu-x64 | |
| os: ubuntu-latest | |
| arch: x64 | |
| make_cmd: make | |
| - label: macos-arm64 | |
| os: macos-14 | |
| arch: arm64 | |
| make_cmd: gmake | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 45 | |
| name: ${{ matrix.label }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| submodules: recursive | |
| - name: Set up Miniconda | |
| uses: conda-incubator/setup-miniconda@v3 | |
| with: | |
| activate-environment: test-env | |
| auto-activate-base: false | |
| python-version: "3.13" | |
| - name: Install build dependencies (Ubuntu) | |
| if: startsWith(matrix.os, 'ubuntu-') | |
| shell: bash -el {0} | |
| run: | | |
| conda install -y -c conda-forge scons compilers boost | |
| - name: Install build dependencies (macOS) | |
| if: startsWith(matrix.os, 'macos-') | |
| shell: bash -el {0} | |
| run: | | |
| brew install make | |
| conda install -y -c conda-forge scons compilers boost | |
| - name: Build libobjcryst | |
| shell: bash -el {0} | |
| run: | | |
| sed -i.bak '/if gfb != afb:/,+1d' site_scons/libobjcrystbuildutils.py | |
| PREFIX="$CONDA_PREFIX" python -m SCons -Q lib | |
| - name: Locate built library | |
| shell: bash -el {0} | |
| run: | | |
| libpath="$(find "$PWD/build" -type f \( -name 'libObjCryst.so' -o -name 'libObjCryst.dylib' \) | head -n 1)" | |
| if [ -z "$libpath" ]; then | |
| echo "No built libObjCryst library found under build/" | |
| exit 1 | |
| fi | |
| echo "LIBOBJCRYST_PATH=$libpath" >> "$GITHUB_ENV" | |
| echo "Using LIBOBJCRYST_PATH=$libpath" | |
| - name: Run standalone unit tests | |
| shell: bash -el {0} | |
| run: | | |
| CONDA_PREFIX="$CONDA_PREFIX" ${{ matrix.make_cmd }} -C test LIBOBJCRYST="$LIBOBJCRYST_PATH" |