diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 227b71d..815525a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,38 +1,33 @@ name: CI -#on: [push, pull_request] -on: [workflow_dispatch, push] +on: [push, pull_request] jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + python-version: ["3.9", "3.10", "3.11", "3.12"] - #test: - # runs-on: ${{ matrix.os }} - # strategy: - # matrix: - # #os: [ubuntu-latest, macos-latest, windows-latest] - # #python-version: ["3.9", "3.10", "3.11", "3.12"] - # os: [macos-14] - # #python-version: ["3.9", "3.10", "3.11", "3.12"] - # python-version: ["3.11"] - - # steps: - # - uses: actions/checkout@v4 + steps: + - uses: actions/checkout@v4 - # - name: Setup Conda Environment - # uses: conda-incubator/setup-miniconda@v2 - # with: - # miniforge-variant: Mambaforge - # miniforge-version: latest - # use-mamba: true - # python-version: ${{ matrix.python-version }} - # environment-file: ci/environment.yaml - # activate-environment: test-environment + - name: Setup Conda Environment + uses: conda-incubator/setup-miniconda@v2 + with: + miniforge-variant: Mambaforge + miniforge-version: latest + use-mamba: true + python-version: ${{ matrix.python-version }} + environment-file: ci/environment.yaml + activate-environment: test-environment - # - name: Run tests - # shell: bash -l {0} - # run: | - # pip install -e . - # python selftest.py + - name: Run tests + shell: bash -l {0} + run: | + pip install -e . + python selftest.py build: name: "Build wheels on ${{ matrix.os }} ${{ matrix.cibw_archs }}" @@ -41,18 +36,16 @@ jobs: fail-fast: false matrix: include: - #- os: windows-2019 - # cibw_archs: "AMD64 ARM64" - #- os: macos-12 - # cibw_archs: "x86_64" - #- os: macos-13 - # cibw_archs: "arm64" - - os: macos-14 - cibw_archs: "x86_64 arm64" - #- os: "ubuntu-20.04" - # cibw_archs: "aarch64" - #- os: "ubuntu-20.04" - # cibw_archs: "x86_64" + - os: windows-2019 + cibw_archs: "AMD64 ARM64" + - os: macos-11 + cibw_archs: "x86_64" + - os: macos-14 # The macos-14 runner is arm64, while up until macos-13 the runners are x86_64. + cibw_archs: "arm64" + - os: "ubuntu-20.04" + cibw_archs: "aarch64" + - os: "ubuntu-20.04" + cibw_archs: "x86_64" steps: - uses: actions/checkout@v4 @@ -64,7 +57,7 @@ jobs: platforms: all # See discussion here: https://github.com/actions/runner-images/issues/9256 - - name: Maker sure pipx is installed for the arm64 macOS for which it is not installed by default. + - name: Maker sure pipx is installed for the arm64 macOS runners. if: runner.os == 'macOS' && runner.arch == 'ARM64' run: | brew install pipx @@ -87,29 +80,29 @@ jobs: name: wheelhouse path: "./wheelhouse/*.whl" -# publish: -# runs-on: ubuntu-latest -# needs: -# - build -# steps: -# - uses: actions/checkout@v4 -# -# - uses: actions/setup-python@v4 -# -# - name: sdist -# run: | -# python -m pip install -U build pip -# python -m build -s -# -# - name: download -# uses: actions/download-artifact@v3 -# with: -# name: wheelhouse -# path: dist -# -# - name: Publish package to PyPI -# if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') -# uses: pypa/gh-action-pypi-publish@v1.8.10 -# with: -# user: __token__ -# password: ${{ secrets.pypi_password }} + publish: + runs-on: ubuntu-latest + needs: + - build + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v4 + + - name: sdist + run: | + python -m pip install -U build pip + python -m build -s + + - name: download + uses: actions/download-artifact@v3 + with: + name: wheelhouse + path: dist + + - name: Publish package to PyPI + if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v') + uses: pypa/gh-action-pypi-publish@v1.8.10 + with: + user: __token__ + password: ${{ secrets.pypi_password }}