Skip to content

Update github actions #218

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 53 additions & 27 deletions .github/workflows/dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,34 @@ jobs:
pip --disable-pip-version-check install -e .
pip --disable-pip-version-check install -r docs/requirements.txt
cd docs && make clean html SPHINXOPTS="-W --keep-going"


build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0

- uses: actions/setup-python@v4
with:
python-version: 3.8

- name: Install build
run: python -m pip --disable-pip-version-check install build

- name: Build sdist + wheel
run: python -m build

- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: dist
path: dist

test:
runs-on: ${{ matrix.os }}
needs: [setup_concurrency]
needs: [setup_concurrency, build]
strategy:
max-parallel: ${{ fromJSON(needs.setup_concurrency.outputs.max-parallel).v }}
matrix:
Expand All @@ -88,6 +112,12 @@ jobs:
with:
python-version: ${{ matrix.python_version }}
architecture: ${{ matrix.architecture }}

- name: Download build artifacts
uses: actions/download-artifact@v3
with:
name: dist
path: dist

- name: Set ccache variant
shell: bash
Expand All @@ -105,12 +135,6 @@ jobs:
key: ${{ matrix.os }}-${{ matrix.architecture }}-${{ matrix.python_version }}
variant: ${{ steps.ccache.outputs.variant }}

- name: Install build
run: python -m pip --disable-pip-version-check install build

- name: Build wheel
run: python -m build --wheel

- name: Install
shell: bash
working-directory: dist
Expand All @@ -133,7 +157,7 @@ jobs:

cross-build:
runs-on: ubuntu-latest
needs: [setup_concurrency]
needs: [setup_concurrency, build]
strategy:
max-parallel: ${{ fromJSON(needs.setup_concurrency.outputs.max-parallel).v }}
matrix:
Expand All @@ -155,11 +179,11 @@ jobs:
with:
key: ${{ matrix.container }}

- name: Install build
run: /build/venv/bin/build-pip --disable-pip-version-check install build

- name: Build wheel
run: /build/venv/bin/build-python -m build --wheel
- name: Download build artifacts
uses: actions/download-artifact@v3
with:
name: dist
path: dist

- name: Install
working-directory: dist
Expand All @@ -168,6 +192,14 @@ jobs:
/build/venv/bin/build-pip --disable-pip-version-check install *.whl
/build/venv/bin/cross-pip --disable-pip-version-check install *.whl

- name: Install test dependencies
shell: bash
working-directory: tests
run: |
# install to both cross and build in case things get mixed up
/build/venv/bin/build-pip --disable-pip-version-check install -r requirements.txt
/build/venv/bin/cross-pip --disable-pip-version-check install -r requirements.txt

- name: Build cross wheel
env:
RPYBUILD_PARALLEL: 1
Expand All @@ -179,22 +211,16 @@ jobs:
publish:
runs-on: ubuntu-latest
needs: [check, check-doc, test]
permissions:
id-token: write
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')

steps:
- uses: actions/checkout@v3
- name: Download build artifacts
uses: actions/download-artifact@v3
with:
submodules: true

- uses: actions/setup-python@v4

- run: pip --disable-pip-version-check install build

- name: Build packages
run: python -m build
name: dist
path: dist

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.pypi_password }}
uses: pypa/gh-action-pypi-publish@release/v1
1 change: 1 addition & 0 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
build
pytest
wheel