From 5ad13154eb101a37febb4a72c92dfac3201c6c1e Mon Sep 17 00:00:00 2001 From: Micha Reiser Date: Fri, 5 May 2023 17:50:48 +0200 Subject: [PATCH] Add ruff --help smoketest after building --- .github/workflows/release.yaml | 97 +++++++++++++++++++--------------- 1 file changed, 55 insertions(+), 42 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 4d31e24540d8ce..d058afcf4b5025 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -33,9 +33,10 @@ jobs: with: target: x86_64 args: --release --out dist --sdist - - name: "Install built wheel - x86_64" + - name: "Test wheel - x86_64" run: | pip install dist/${{ env.PACKAGE_NAME }}-*.whl --force-reinstall + ruff --help - name: "Upload wheels" uses: actions/upload-artifact@v3 with: @@ -68,9 +69,10 @@ jobs: uses: PyO3/maturin-action@v1 with: args: --release --universal2 --out dist - - name: "Install built wheel - universal2" + - name: "Test wheel - universal2" run: | pip install dist/${{ env.PACKAGE_NAME }}-*universal2.whl --force-reinstall + ruff --help - name: "Upload wheels" uses: actions/upload-artifact@v3 with: @@ -113,11 +115,12 @@ jobs: with: target: ${{ matrix.platform.target }} args: --release --out dist - - name: "Install built wheel" + - name: "Test wheel" if: ${{ !startsWith(matrix.platform.target, 'aarch64') }} shell: bash run: | python -m pip install dist/${{ env.PACKAGE_NAME }}-*.whl --force-reinstall + ruff --help - name: "Upload wheels" uses: actions/upload-artifact@v3 with: @@ -158,10 +161,11 @@ jobs: target: ${{ matrix.target }} manylinux: auto args: --release --out dist - - name: "Install built wheel" + - name: "Test wheel" if: ${{ startsWith(matrix.target, 'x86_64') }} run: | pip install dist/${{ env.PACKAGE_NAME }}-*.whl --force-reinstall + ruff --help - name: "Upload wheels" uses: actions/upload-artifact@v3 with: @@ -187,6 +191,7 @@ jobs: platform: - target: aarch64-unknown-linux-gnu arch: aarch64 + maturin_docker_options: -e JEMALLOC_SYS_WITH_LG_PAGE=3 - target: armv7-unknown-linux-gnueabihf arch: armv7 - target: s390x-unknown-linux-gnu @@ -195,6 +200,7 @@ jobs: arch: ppc64le - target: powerpc64-unknown-linux-gnu arch: ppc64 + steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 @@ -207,10 +213,11 @@ jobs: with: target: ${{ matrix.platform.target }} manylinux: auto + docker-options: ${{ matrix.platform.maturin_docker_options }} args: --release --out dist - uses: uraimo/run-on-arch-action@v2 if: matrix.platform.arch != 'ppc64' - name: Install built wheel + name: Test wheel with: arch: ${{ matrix.platform.arch }} distro: ubuntu20.04 @@ -221,6 +228,7 @@ jobs: pip3 install -U pip run: | pip3 install ${{ env.PACKAGE_NAME }} --no-index --find-links dist/ --force-reinstall + ruff --help - name: "Upload wheels" uses: actions/upload-artifact@v3 with: @@ -260,7 +268,7 @@ jobs: target: ${{ matrix.target }} manylinux: musllinux_1_2 args: --release --out dist - - name: "Install built wheel" + - name: "Test wheel" if: matrix.target == 'x86_64-unknown-linux-musl' uses: addnab/docker-run-action@v3 with: @@ -269,6 +277,7 @@ jobs: run: | apk add py3-pip pip3 install ${{ env.PACKAGE_NAME }} --no-index --find-links /io/dist/ --force-reinstall + ruff --help - name: "Upload wheels" uses: actions/upload-artifact@v3 with: @@ -294,8 +303,10 @@ jobs: platform: - target: aarch64-unknown-linux-musl arch: aarch64 + maturin_docker_options: -e JEMALLOC_SYS_WITH_LG_PAGE=3 - target: armv7-unknown-linux-musleabihf arch: armv7 + steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 @@ -309,8 +320,9 @@ jobs: target: ${{ matrix.platform.target }} manylinux: musllinux_1_2 args: --release --out dist + docker-options: ${{ matrix.platform.maturin_docker_options }} - uses: uraimo/run-on-arch-action@v2 - name: Install built wheel + name: Test wheel with: arch: ${{ matrix.platform.arch }} distro: alpine_latest @@ -319,6 +331,7 @@ jobs: apk add py3-pip run: | pip3 install ${{ env.PACKAGE_NAME }} --no-index --find-links dist/ --force-reinstall + ruff check --help - name: "Upload wheels" uses: actions/upload-artifact@v3 with: @@ -337,38 +350,38 @@ jobs: *.tar.gz *.sha256 - release: - name: Release - runs-on: ubuntu-latest - needs: - - macos-universal - - macos-x86_64 - - windows - - linux - - linux-cross - - musllinux - - musllinux-cross - if: "startsWith(github.ref, 'refs/tags/')" - steps: - - uses: actions/download-artifact@v3 - with: - name: wheels - - uses: actions/setup-python@v4 - - name: "Publish to PyPi" - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.RUFF_TOKEN }} - run: | - pip install --upgrade twine - twine upload --skip-existing * - - name: "Update pre-commit mirror" - run: | - curl -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.RUFF_PRE_COMMIT_PAT }}" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/charliermarsh/ruff-pre-commit/dispatches --data '{"event_type": "pypi_release"}' - - uses: actions/download-artifact@v3 - with: - name: binaries - path: binaries - - name: Release - uses: softprops/action-gh-release@v1 - with: - files: binaries/* +# release: +# name: Release +# runs-on: ubuntu-latest +# needs: +# - macos-universal +# - macos-x86_64 +# - windows +# - linux +# - linux-cross +# - musllinux +# - musllinux-cross +# if: "startsWith(github.ref, 'refs/tags/')" +# steps: +# - uses: actions/download-artifact@v3 +# with: +# name: wheels +# - uses: actions/setup-python@v4 +# - name: "Publish to PyPi" +# env: +# TWINE_USERNAME: __token__ +# TWINE_PASSWORD: ${{ secrets.RUFF_TOKEN }} +# run: | +# pip install --upgrade twine +# twine upload --skip-existing * +# - name: "Update pre-commit mirror" +# run: | +# curl -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.RUFF_PRE_COMMIT_PAT }}" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/charliermarsh/ruff-pre-commit/dispatches --data '{"event_type": "pypi_release"}' +# - uses: actions/download-artifact@v3 +# with: +# name: binaries +# path: binaries +# - name: Release +# uses: softprops/action-gh-release@v1 +# with: +# files: binaries/*