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

Try CI.yml modified from cramjam project #54

Merged
merged 8 commits into from
Mar 25, 2023
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
146 changes: 146 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
name: CI

on:
pull_request:
release:
types:
- released
- prereleased

jobs:
macos:
runs-on: macos-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-apple-darwin
- name: Build
run: cargo build --release
- name: Tests
run: cargo test --no-default-features --release
- name: Build wheels - x86_64
uses: PyO3/maturin-action@v1
with:
target: x86_64
args: -i python --release --out dist --sdist
- name: Install built wheel - x86_64
run: |
pip install -r requirements.txt
pip uninstall fastrank -y
pip install fastrank --no-index --find-links dist
- name: Build wheels - universal2
if: ${{ matrix.python-version >= '3.8' || contains(fromJson('["3.10", "3.11"]'), matrix.python-version) }}
uses: PyO3/maturin-action@v1
with:
args: -i python --release --universal2 --out dist
- name: Install built wheel - universal2
if: ${{ matrix.python-version >= '3.8' || contains(fromJson('["3.10", "3.11"]'), matrix.python-version) }}
run: |
pip install -r requirements.txt
pip uninstall fastrank -y
pip install fastrank --no-index --find-links dist
- name: Python UnitTest
run: |
python -I -m unittest discover -s tests -v
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist
windows:
runs-on: windows-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
target: [x64]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.target }}
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Build
run: cargo build --release
- name: Tests
run: cargo test --release
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: -i python --release --out dist
- name: Install built wheel
run: |
pip install -r requirements.txt
pip uninstall fastrank -y
pip install fastrank --no-index --find-links dist
- name: Python UnitTest
run: |
python -I -m unittest discover -s tests -v
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist
linux:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v3
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Build
run: cargo build --release
- name: Tests
run: cargo test --release
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Build Wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
manylinux: auto
before-script-linux: python${{ matrix.python-version }} -m pip install cffi
args: -i python${{ matrix.python-version }} --release --out dist
- name: Python UnitTest
run: |
pip install -r requirements.txt
pip uninstall fastrank -y
pip install fastrank --no-index --find-links dist
python -I -m unittest discover -s tests -v
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist
release:
name: Release
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/')"
needs: [macos, windows, linux]
steps:
- uses: actions/download-artifact@v3
with:
name: wheels
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
pip install --upgrade twine
twine upload --skip-existing *
107 changes: 0 additions & 107 deletions .github/workflows/main.yml

This file was deleted.