Skip to content

Commit

Permalink
Large update
Browse files Browse the repository at this point in the history
  • Loading branch information
konstin committed Feb 18, 2024
1 parent 77a4ae5 commit 52ea1de
Show file tree
Hide file tree
Showing 12 changed files with 1,655 additions and 1,012 deletions.
23 changes: 8 additions & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Push to crates.io
- name: Publish to crates.io
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: cargo publish
Expand All @@ -21,24 +20,19 @@ jobs:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: 3.9
architecture: x64
- uses: dtolnay/rust-toolchain@stable
- name: Build wheels - x86_64
uses: PyO3/maturin-action@v1
with:
target: x86_64
args: --release --strip --out dist --sdist
env:
RUSTFLAGS: "-C link-arg=-undefined -C link-arg=dynamic_lookup"
- name: Build wheels - universal2
uses: PyO3/maturin-action@v1
with:
args: --release --strip --target --target universal2-apple-darwin --out dist
env:
RUSTFLAGS: "-C link-arg=-undefined -C link-arg=dynamic_lookup"
args: --release --strip --target universal2-apple-darwin --out dist
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
Expand All @@ -49,10 +43,9 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: 3.9
- uses: dtolnay/rust-toolchain@stable
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
Expand All @@ -70,7 +63,7 @@ jobs:
target: [ x86_64 ]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: 3.9
architecture: x64
Expand All @@ -92,7 +85,7 @@ jobs:
target: [ aarch64, armv7, s390x, ppc64le, ppc64 ]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Build wheels
Expand All @@ -116,7 +109,7 @@ jobs:
- i686-unknown-linux-musl
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: 3.9
architecture: x64
Expand All @@ -143,7 +136,7 @@ jobs:
arch: armv7
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Build wheels
Expand Down
48 changes: 29 additions & 19 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,43 @@ env:
CARGO_TERM_COLOR: always

jobs:
test:
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- run: rustup toolchain install stable --profile minimal
- uses: Swatinem/rust-cache@v2
- name: Run tests
run: cargo test

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- uses: actions/setup-python@v5
- name: Install clippy and rustfmt
run: rustup component add clippy rustfmt
- uses: Swatinem/rust-cache@v2
- name: Ruff check
run: pipx run "ruff<0.2.0" check --output-format github .
- name: Ruff format
run: pipx run "ruff<0.2.0" format --diff .
- name: Ruff
run: pipx run ruff check
- name: Rustfmt
run: cargo fmt --all -- --check
- name: Clippy (pure rust)
run: cargo clippy --tests -- -D warnings
- name: Clippy (pyo3)
run: cargo clippy --tests --all-features -- -D warnings

test-rust:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- run: cargo test

test-python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: Swatinem/rust-cache@v2
- name: Install pytest
run: |
pip install --upgrade pip
pip install pytest
- uses: PyO3/maturin-action@v1
with:
command: build
- name: Install pep440_rs
run: pip install --no-index --find-links target/wheels pep440_rs
- run: pytest
Loading

0 comments on commit 52ea1de

Please sign in to comment.