Skip to content

Commit

Permalink
Tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
Rigidity committed Jul 15, 2024
1 parent 5deb71c commit 4a59372
Showing 1 changed file with 11 additions and 19 deletions.
30 changes: 11 additions & 19 deletions .github/workflows/python-wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,25 +128,18 @@ jobs:

- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: Chia-Network/actions/setup-python@main
with:
python-version: ${{ matrix.python.major-dot-minor }}

- name: Update pip
run: |
python -m pip install --upgrade pip
- name: Set up rust
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable

- name: Install dependencies
run: |
python -m pip install maturin
run: python -m pip install maturin

- name: Build MacOs with maturin on Python ${{ matrix.python }}
- name: Build MacOS wheel (Python ${{ matrix.python }})
if: matrix.os.matrix == 'macos'
env:
MACOSX_DEPLOYMENT_TARGET: "11.0"
Expand All @@ -155,7 +148,7 @@ jobs:
. venv/bin/activate
maturin build -i python --release -m wheel/Cargo.toml
- name: Build Linux with maturin on Python ${{ matrix.python }}
- name: Build Linux wheel (Python ${{ matrix.python }})
if: matrix.os.matrix == 'ubuntu'
run: |
docker run --rm --pull always \
Expand All @@ -172,7 +165,7 @@ jobs:
CC=gcc maturin build --release --manylinux ${{ matrix.python.by-arch[matrix.arch.matrix].manylinux-version }} -m wheel/Cargo.toml \
'
- name: Build Windows with maturin on Python ${{ matrix.python }}
- name: Build Windows wheel (Python ${{ matrix.python }})
if: matrix.os.matrix == 'windows'
env:
CC: "clang"
Expand All @@ -189,7 +182,7 @@ jobs:
with:
directories: ${{ steps.create-venv.outputs.activate-venv-directories }}

- name: Install chia_rs wheel
- name: Install wheel
run: |
pip install --no-index --find-links target/wheels/ chia_rs
Expand Down Expand Up @@ -217,7 +210,7 @@ jobs:
git diff --exit-code
build-sdist:
name: sdist - ${{ matrix.os.name }} ${{ matrix.python.major-dot-minor }} ${{ matrix.arch.name }}
name: Build sdist (${{ matrix.os.name }} ${{ matrix.python.major-dot-minor }} ${{ matrix.arch.name }})
runs-on: ${{ matrix.os.runs-on[matrix.arch.matrix] }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -259,12 +252,12 @@ jobs:
name: packages-sdist-${{ matrix.os.name }}-${{ matrix.python.major-dot-minor }}-${{ matrix.arch.name }}
path: ./target/wheels/

unit_tests:
unit-tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
name: Unit tests
name: Python tests
steps:
# the test files are read verbatim, making it problematic if git is
# allowed to insert \r when checking out files
Expand All @@ -276,7 +269,7 @@ jobs:

- uses: dtolnay/rust-toolchain@stable

- name: Continue with coverage
- name: Pytest
if: matrix.os == 'ubuntu-latest'
run: |
python -m venv venv
Expand All @@ -286,15 +279,14 @@ jobs:
pip install colorama maturin pytest pytest-xdist chia-blockchain==2.1.2 clvm==0.9.8
maturin develop --release -m wheel/Cargo.toml
pytest tests
python -c 'with open("rust_cov.info") as f: lines = [l for l in f if not (l.startswith("DA:") and int(l.split(",")[1].strip()) >= 2**63)]; open("lcov.info", "w").writelines(lines)'
upload:
name: Upload to PyPI - ${{ matrix.os.name }} ${{ matrix.python.major-dot-minor }} ${{ matrix.arch.name }}
runs-on: ${{ matrix.os.runs-on[matrix.arch.matrix] }}
needs:
- build-wheels
- build-sdist
- unit_tests
- unit-tests
strategy:
fail-fast: false
matrix:
Expand Down

0 comments on commit 4a59372

Please sign in to comment.