Skip to content

Commit

Permalink
Merge pull request #49 from pluots/project-refactor
Browse files Browse the repository at this point in the history
Reorganize crates and update workflows
  • Loading branch information
tgross35 authored Oct 17, 2023
2 parents 71ae779 + 5f98142 commit b7edd42
Show file tree
Hide file tree
Showing 90 changed files with 3,193 additions and 367 deletions.
31 changes: 20 additions & 11 deletions .github/workflows/release-python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,53 +6,63 @@ on:
- 'v*'

jobs:
# Allow our jobs to block on validation steps
validation_rust:
uses: ./.github/workflows/validation-rust.yaml

validation_py:
uses: ./.github/workflows/validation-python.yaml

linux_wheels:
runs-on: ubuntu-latest
needs: [validation_rust, validation_py]
steps:
- uses: actions/checkout@v3
- name: Build libc wheels
- name: build libc wheels
uses: messense/maturin-action@v1
with:
manylinux: auto
command: build
# container default is manylinux
args: --release -o dist -i 3.7 3.8 3.9 3.10 3.11 --manifest-path crates/zspell-py/Cargo.toml
- name: Build musl wheels
args: --release -o dist -i 3.7 3.8 3.9 3.10 3.11 3.12 --manifest-path zspell-py/Cargo.toml
- name: build musl wheels
uses: messense/maturin-action@v1
with:
target: x86_64-unknown-linux-musl
manylinux: musllinux_1_1
command: build
args: --release -o dist -i 3.7 3.8 3.9 3.10 3.11 --manifest-path crates/zspell-py/Cargo.toml
- name: Upload wheels
args: --release -o dist -i 3.7 3.8 3.9 3.10 3.11 3.12 --manifest-path zspell-py/Cargo.toml
- name: upload wheels
uses: actions/upload-artifact@v2
with:
name: wheels
path: dist

windows_wheels:
runs-on: windows-latest
needs: [validation_rust, validation_py]
steps:
- uses: actions/checkout@v3
- uses: messense/maturin-action@v1
with:
command: build
args: --release -o dist -i 3.7 3.8 3.9 3.10 3.11 --manifest-path crates/zspell-py/Cargo.toml
- name: Upload wheels
args: --release -o dist -i 3.7 3.8 3.9 3.10 3.11 3.12 --manifest-path zspell-py/Cargo.toml
- name: upload wheels
uses: actions/upload-artifact@v2
with:
name: wheels
path: dist

macos_wheels:
runs-on: macos-latest
needs: [validation_rust, validation_py]
steps:
- uses: actions/checkout@v3
- uses: messense/maturin-action@v1
with:
command: build
args: --release -o dist -i 3.7 3.8 3.9 3.10 3.11 --universal2 --manifest-path crates/zspell-py/Cargo.toml
- name: Upload wheels
args: --release -o dist -i 3.7 3.8 3.9 3.10 3.11 3.12 --universal2 --manifest-path zspell-py/Cargo.toml
- name: upload wheels
uses: actions/upload-artifact@v2
with:
name: wheels
Expand All @@ -61,8 +71,7 @@ jobs:
release_all_wheels:
name: Release wheels
runs-on: ubuntu-latest
# needs: [ linux ]
needs: [ linux_wheels, macos_wheels, windows_wheels ]
needs: [linux_wheels, macos_wheels, windows_wheels]
steps:
- uses: actions/download-artifact@v2
with:
Expand Down
41 changes: 15 additions & 26 deletions .github/workflows/release-rust.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
---
name: "Rust Build & Release"

# This configuration largely comes from ripgrep
name: Rust Release

on:
push:
tags:
- 'v*'
# on:
# pull_request:

jobs:
# Allow our jobs to block on validation steps
validation_rust:
uses: ./.github/workflows/validation-rust.yaml

validation_py:
uses: ./.github/workflows/validation-python.yaml

build_release:
name: "Build ${{ matrix.build }} binaries (cargo build)"
name: "build & deploy ${{ matrix.build }} binaries (cargo build)"
needs: [validation_rust, validation_py]
runs-on: ${{ matrix.os }}
if: ${{ github.event.workflow_run.conclusion == 'success' }}
strategy:
matrix:
include:
Expand Down Expand Up @@ -43,27 +48,10 @@ jobs:
steps:
# Retreive git files
- uses: actions/checkout@v3
# Set cache configuration
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
# - name: Install System Requirements
# run: |
# if [ "${{ matrix.os }}" = "ububtu-latest" ]; then
# sudo apt-get install musl-tools libssl-dev
# fi
- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: stable
override: true
target: ${{ matrix.target }}
targets: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
# Debugging aid
- name: Show commands
run: |
Expand Down Expand Up @@ -148,6 +136,7 @@ jobs:
deploy_book:
runs-on: ubuntu-latest
needs: [validation_rust, validation_py]
steps:
- uses: actions/checkout@v3
with:
Expand Down
26 changes: 9 additions & 17 deletions .github/workflows/validation-python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,30 @@ on:
branches:
- main
pull_request:
workflow_call: # allow this to be run from other workflows

jobs:
verify:
name: Verify
name: pytest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: actions/cache@v3
with:
path: ~/.local/share/virtualenvs
key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }}
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install pipenv
run: python -m pip install --upgrade pipenv wheel
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Install dependencies
run: |
pipenv install --dev
pipenv run maturin develop --manifest-path crates/zspell-py/Cargo.toml
pipenv run maturin develop --manifest-path zspell-py/Cargo.toml
- name: Pytest
run: pipenv run pytest
- name: Validate docs
run: pipenv run make -C crates/zspell-py/docs html
run: pipenv run make -C zspell-py/docs html
Loading

0 comments on commit b7edd42

Please sign in to comment.