|
| 1 | +name: Build wheels |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + pull_request: |
| 8 | + branches: |
| 9 | + - main |
| 10 | + |
| 11 | +jobs: |
| 12 | + build_wheels: |
| 13 | + name: Build wheels on ${{ matrix.os }} |
| 14 | + runs-on: ${{ matrix.os }} |
| 15 | + strategy: |
| 16 | + max-parallel: 6 |
| 17 | + matrix: |
| 18 | + python-version: ["3.9","3.10","3.11", "3.12"] |
| 19 | + os: |
| 20 | + - macOS-latest |
| 21 | + - ubuntu-latest |
| 22 | + - windows-latest |
| 23 | + include: |
| 24 | + - os: ubuntu-latest |
| 25 | + path: ~/.cache/pip |
| 26 | + - os: macos-latest |
| 27 | + path: ~/Library/Caches/pip |
| 28 | + - os: windows-latest |
| 29 | + path: ~\AppData\Local\pip\Cache |
| 30 | + defaults: |
| 31 | + run: |
| 32 | + shell: bash -el {0} |
| 33 | + |
| 34 | + steps: |
| 35 | + - uses: actions/checkout@v4 |
| 36 | + - uses: actions/cache@v4 |
| 37 | + with: |
| 38 | + path: ${{ matrix.path }} |
| 39 | + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} |
| 40 | + restore-keys: | |
| 41 | + ${{ runner.os }}-pip- |
| 42 | + - uses: conda-incubator/setup-miniconda@v3 |
| 43 | + with: |
| 44 | + auto-activate-base: true |
| 45 | + auto-update-conda: true |
| 46 | + python-version: ${{ matrix.python-version }} |
| 47 | + activate-environment: test |
| 48 | + - name: Install required packages |
| 49 | + run: | |
| 50 | + conda config --add channels conda-forge |
| 51 | + # conda install -yq conda-build jinja2 conda-verify |
| 52 | + conda install -yq zlib |
| 53 | + conda install h5py |
| 54 | + python -m pip install --upgrade pip |
| 55 | + # Used to host cibuildwheel |
| 56 | + - name: Pip install and build wheels |
| 57 | + run: | |
| 58 | + # python -m pip install cibuildwheel |
| 59 | + # python -m cibuildwheel --output-dir ciwheelhouse |
| 60 | + python -m pip install --upgrade wheel |
| 61 | + pip wheel --wheel-dir wheelhouse . |
| 62 | + - name: Test wheels |
| 63 | + run: | |
| 64 | + pip install wheelhouse/msmbuilder2022*.whl |
| 65 | + |
| 66 | + conda install -yq numdifftools hmmlearn |
| 67 | + pip install pytest |
| 68 | + pip install pytest-cov |
| 69 | + mkdir ../../pkgs |
| 70 | + cp -r msmbuilder/tests ../../pkgs |
| 71 | + cd ../../pkgs |
| 72 | + python tests/data_init.py |
| 73 | + pytest tests/ -v |
| 74 | +
|
| 75 | + - uses: actions/upload-artifact@v4 |
| 76 | + with: |
| 77 | + name: cibw-wheels-${{ matrix.os }}-${{ matrix.python-version }}-${{ strategy.job-index }} |
| 78 | + path: wheelhouse/msmbuilder2022*.whl |
| 79 | + |
| 80 | + |
| 81 | + - uses: actions/download-artifact@v4 |
| 82 | + with: |
| 83 | + name: cibw-wheels-${{ matrix.os }}-${{ matrix.python-version }}-${{ strategy.job-index }} |
0 commit comments