Skip to content

Commit

Permalink
add macos and windows build to ci and release actions
Browse files Browse the repository at this point in the history
  • Loading branch information
bastiscode committed Nov 11, 2023
1 parent 4db782f commit fcc05cc
Show file tree
Hide file tree
Showing 2 changed files with 143 additions and 7 deletions.
69 changes: 66 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,75 @@ on:
pull_request:

jobs:
macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.10"
architecture: x64
- uses: dtolnay/rust-toolchain@stable
- name: "Rust: Check and test"
run: |
cargo fmt --all -- --check
cargo check
cargo clippy -- -D warnings
cargo test
- name: Build wheels - x86_64
uses: PyO3/maturin-action@v1
with:
target: x86_64
args: --release --out dist
- name: "Python: Install wheels and test import - x86_64"
run: |
pip install patchelf
pip install dist/*.whl --force-reinstall
python -c "import text_utils"
- name: Build wheels - universal2
uses: PyO3/maturin-action@v1
with:
target: universal2-apple-darwin
args: --release --out dist
- name: "Python: Install wheels and test import - universal2"
run: |
pip install patchelf
pip install dist/*.whl --force-reinstall
python -c "import text_utils"
windows:
runs-on: windows-latest
strategy:
matrix:
target: [x64, x86]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.10"
target: ${{ matrix.target }}
- uses: dtolnay/rust-toolchain@stable
- name: "Rust: Check and test"
run: |
cargo fmt --all -- --check
cargo check
cargo clippy -- -D warnings
cargo test
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist
- name: "Python: Install wheels and test import"
run: |
pip install patchelf
pip install dist/*.whl --force-reinstall
python -c "import text_utils"
linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.10"
Expand All @@ -31,5 +96,3 @@ jobs:
pip install patchelf
pip install dist/*.whl --force-reinstall
python -c "import text_utils"
# pip install pytest
# python -m pytest -W ignore -v
81 changes: 77 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,85 @@ on:
- "v[0-9]+.[0-9]+.[0-9]+"

jobs:
macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.10"
architecture: x64
- uses: dtolnay/rust-toolchain@stable
- name: "Rust: Check and test"
run: |
cargo fmt --all -- --check
cargo check
cargo clippy -- -D warnings
cargo test
- name: Build wheels - x86_64
uses: PyO3/maturin-action@v1
with:
target: x86_64
args: --release --out dist
- name: "Python: Install wheels and test import - x86_64"
run: |
pip install patchelf
pip install dist/*.whl --force-reinstall
python -c "import text_utils"
- name: Build wheels - universal2
uses: PyO3/maturin-action@v1
with:
target: universal2-apple-darwin
args: --release --out dist
- name: "Python: Install wheels and test import - universal2"
run: |
pip install patchelf
pip install dist/*.whl --force-reinstall
python -c "import text_utils"
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist

windows:
runs-on: windows-latest
strategy:
matrix:
target: [x64, x86]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.10"
target: ${{ matrix.target }}
- uses: dtolnay/rust-toolchain@stable
- name: "Rust: Check and test"
run: |
cargo fmt --all -- --check
cargo check
cargo clippy -- -D warnings
cargo test
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist
- name: "Python: Install wheels and test import"
run: |
pip install patchelf
pip install dist/*.whl --force-reinstall
python -c "import text_utils"
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist

linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.10"
Expand All @@ -30,8 +105,6 @@ jobs:
pip install patchelf
pip install dist/*.whl --force-reinstall
python -c "import text_utils"
# pip install pytest
# python -m pytest -W ignore -v
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
Expand All @@ -41,7 +114,7 @@ jobs:
release:
name: Release
runs-on: ubuntu-latest
needs: [linux]
needs: [linux, windows, macos]
steps:
- uses: actions/download-artifact@v3
with:
Expand Down

0 comments on commit fcc05cc

Please sign in to comment.