CEFAnaT #41
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
| # Adapted from https://github.com/RalfG/python-wheels-manylinux-build/blob/master/full_workflow_example.yml | |
| name: libmcphase | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| types: [opened, reopened, synchronize] | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| concurrency : | |
| group: ${{ github.workflow }}-${{ github.ref == 'refs/head/main' && github.run_number || github.ref }} | |
| cancel-in-progress: true | |
| defaults: | |
| run: | |
| shell: bash -l {0} | |
| jobs: | |
| build_and_test: | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-14, macos-15-intel] | |
| name: Build and test, ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: mamba-org/setup-micromamba@v1 | |
| with: | |
| cache-downloads: true | |
| - name: Build wheels | |
| run: | | |
| $MAMBA_EXE create -n cibuildwheel python=3.12 eigen pybind11 | |
| eval "$($MAMBA_EXE shell activate cibuildwheel)" | |
| python -m pip install cibuildwheel | |
| if [[ $OSTYPE == "linux-gnu" ]] | |
| then | |
| export CIBW_ENVIRONMENT="CONDA_PREFIX=/host/$CONDA_PREFIX" | |
| fi | |
| python -m cibuildwheel --output-dir wheelhouse | |
| env: | |
| CIBW_BUILD: "cp310-* cp311-* cp312-* cp313-* cp314-*" | |
| CIBW_SKIP: "*musllinux* *win32* *i686*" | |
| CIBW_ARCHS_MACOS: "native" | |
| CIBW_BUILD_VERBOSITY: 1 | |
| - name: Install wheels and run test | |
| run: | | |
| # set -e makes sure the script fails if any command in the loop fails | |
| set -e | |
| for pyver in 3.10 3.11 3.12 3.13 3.14 | |
| do | |
| $MAMBA_EXE create -n py$pyver -c conda-forge python=$pyver numpy | |
| eval "$($MAMBA_EXE shell activate py$pyver)" | |
| python -m pip install wheelhouse/*cp$(echo $pyver | sed s/\\.//)* | |
| cd tests | |
| python -m unittest | |
| cd .. | |
| done | |
| - name: Build Pyodide wheel | |
| if: matrix.os == 'ubuntu-latest' | |
| run: | | |
| eval "$($MAMBA_EXE shell activate cibuildwheel)" | |
| CIBW_BUILD="cp312*" python -m cibuildwheel --output-dir wheelhouse --platform pyodide | |
| - name: Upload release wheels | |
| if: | | |
| contains(github.event.pull_request.title, 'RELEASE') && | |
| github.event.pull_request.merged | |
| run: | | |
| python -m pip install requests numpy | |
| python release.py --notest --github --create_tag --token=${{ secrets.GH_TOKEN }} | |
| - uses: actions/upload-artifact@v4 | |
| if: | | |
| ${{ github.event_name == 'pull_request' }} && | |
| contains(github.event.pull_request.labels.*.name, 'save_wheels') | |
| with: | |
| name: ${{ matrix.os }}_artifacts.zip | |
| path: wheelhouse/* | |
| - name: Setup tmate | |
| if: ${{ failure() }} | |
| uses: mxschmitt/action-tmate@v3 |