Pass explicit build dir to test workflow #6
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 | ||
| build_dir: build/x86_64-conda-linux-gnu-x86_64 | ||
| - label: macos-arm64 | ||
| os: macos-14 | ||
| arch: arm64 | ||
| make_cmd: gmake | ||
| build_dir: build/arm64-apple-darwin20.0.0-arm64 | ||
| 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: | | ||
| python - <<'PY' | ||
| from pathlib import Path | ||
| p = Path("site_scons/libobjcrystbuildutils.py") | ||
| txt = p.read_text() | ||
| old = """ afb = FALLBACK_VERSION | ||
| gfb = gi['version'].split('.post')[0] + '.post0' | ||
| if gfb != afb: | ||
| raise RuntimeError(EMSG_BAD_FALLBACK_VERSION.format(afb, gfb)) | ||
| """ | ||
| new = """ afb = FALLBACK_VERSION | ||
| gfb = gi['version'].split('.post')[0] + '.post0' | ||
| """ | ||
| if old not in txt: | ||
| raise SystemExit("Expected fallback-version consistency block not found") | ||
| txt = txt.replace(old, new) | ||
| p.write_text(txt) | ||
| PY | ||
| PREFIX="$CONDA_PREFIX" python -m SCons -Q lib | ||
| - name: Run standalone unit tests | ||
| shell: bash -el {0} | ||
| run: | | ||
| CONDA_PREFIX="$CONDA_PREFIX" ${{ matrix.make_cmd }} -C test BUILD_DIR="${{ matrix.build_dir }}" | ||