Skip to content
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

ci: add github CI #99

Merged
merged 4 commits into from
Feb 21, 2025
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
48 changes: 48 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: CI

on:
workflow_dispatch:
push:
branches:
- v6
pull_request:
merge_group:

jobs:
test:
strategy:
matrix:
include:
- os: ubuntu-22.04
target: x86_64-unknown-linux-gnu
# - os: ubuntu-22.04
# target: x86_64-unknown-linux-musl
# - os: ubuntu-22.04
# target: aarch64-unknown-linux-gnu
# - os: ubuntu-22.04
# target: aarch64-unknown-linux-musl
- os: macos-14
target: x86_64-apple-darwin
- os: macos-14
target: aarch64-apple-darwin
- os: windows-2022
target: x86_64-pc-windows-msvc
- os: windows-2022
target: x86_64-pc-windows-gnu
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
components: clippy,rustfmt
- uses: Swatinem/rust-cache@v2
with:
prefix-key: ${{ matrix.os }}-${{ matrix.target }}-rust
cache-targets: true
cache-on-failure: false
- name: Install native dependencies
if: runner.os == 'Linux'
run: sudo apt update -y && sudo apt install -y libasound2-dev binutils-aarch64-linux-gnu gcc-aarch64-linux-gnu
- run: cargo test --verbose --target ${{ matrix.target }}
62 changes: 35 additions & 27 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
name: Build and Publish to PyPI
name: Python Wheel
on:
push:
branches:
- v6
tags:
- v[0-9]+.*
- test-release.*
workflow_dispatch:
pull_request:
merge_group:

jobs:
windows-build:
Expand All @@ -13,12 +18,9 @@ jobs:
runs-on: "windows-latest"
steps:
- uses: actions/checkout@v3
- name: Install latests stable Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: actions/setup-python@v4
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.pyversion }}
architecture: x64
Expand All @@ -40,47 +42,52 @@ jobs:
- name: Install wheel
run: pip install aspeak --no-index --find-links dist --no-deps --force-reinstall
- name: Save Artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: wheels
name: wheels-windows-x86_64
path: dist

macos-build:
strategy:
matrix:
pyversion: ["3.11"]
runs-on: "macos-latest"
include:
- pyversion: "3.11"
runner: macos-13
arch: "x86_64"
abbr-arch: x64
- pyversion: "3.11"
runner: macos-14
arch: "aarch64"
abbr-arch: arm64
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v3
- name: Install latests stable Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: actions/setup-python@v4
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.pyversion }}
architecture: x64
architecture: ${{ matrix.abbr-arch }}
- name: Build Wheel (PyO3 Binding)
uses: messense/maturin-action@v1
with:
target: x86_64
target: ${{ matrix.arch }}
command: build
args: --release --strip -F python --bindings pyo3 --interpreter python --manifest-path Cargo.toml --out dist-pyo3
- name: Build Wheel (Bin Binding)
uses: messense/maturin-action@v1
with:
target: x86_64
target: ${{ matrix.arch }}
command: build
args: --release --strip -F binary --bindings bin --interpreter python --manifest-path Cargo.toml --out dist-bin
- name: Merge Wheels
run: bash merge-wheel.bash
- name: Install wheel
run: pip install aspeak --no-index --find-links dist --no-deps --force-reinstall
run: pip install --no-index ./dist/aspeak-*.whl --no-deps --force-reinstall
- name: Save Artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: wheels
name: wheels-macos-${{ matrix.arch }}
path: dist

# linux-build:
Expand All @@ -96,7 +103,7 @@ jobs:
# with:
# toolchain: stable
# override: true
# - uses: actions/setup-python@v4
# - uses: actions/setup-python@v5
# with:
# python-version: ${{ matrix.pyversion }}
# architecture: x64
Expand Down Expand Up @@ -124,7 +131,7 @@ jobs:
# - name: Install wheel
# run: pip install aspeak --no-index --find-links dist --no-deps --force-reinstall
# - name: Save Artifacts
# uses: actions/upload-artifact@v3
# uses: actions/upload-artifact@v4
# with:
# name: wheels
# path: dist
Expand All @@ -135,10 +142,11 @@ jobs:
if: "startsWith(github.ref, 'refs/tags/')"
steps:
- name: Download Artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: wheels
pattern: wheels-*
path: dist
merge-multiple: true
- name: Publish Wheels
uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ jobs:
# target: aarch64-unknown-linux-gnu
# - os: ubuntu-22.04
# target: aarch64-unknown-linux-musl
- os: macos-12
- os: macos-14
target: x86_64-apple-darwin
- os: macos-12
- os: macos-14
target: aarch64-apple-darwin
- os: windows-2022
target: x86_64-pc-windows-msvc
Expand All @@ -44,9 +44,10 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
targets: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
with:
prefix-key: ${{ matrix.os }}-${{ matrix.target }}-rust
Expand Down