Skip to content

Update rust version #111

Update rust version

Update rust version #111

Workflow file for this run

name: Python package
on:
push:
branches: [master]
tags:
- v1.*
pull_request:
branches: [master]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
default: true
components: rustfmt, clippy
- name: Lint with rustfmt
uses: actions-rs/cargo@v1
with:
command: fmt
- name: Lint with clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-targets --all-features
build:
runs-on: ubuntu-latest
needs: lint
steps:
- uses: actions/checkout@v2
- name: rust-toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
default: true
- name: Set up Python 3.x
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[test]
- name: Test with pytest
run: pytest
- name: Benchmarks
run: pytest benchmark.py --benchmark-json output.json
- name: Store benchmark result
uses: rhysd/github-action-benchmark@v1
with:
tool: 'pytest'
output-file-path: output.json
comment-on-alert: true
github-token: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
# Push and deploy GitHub pages branch automatically
auto-push: true
macos:
runs-on: macos-latest
needs: build
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.7
architecture: x64
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
default: true
- name: Build wheels - x86_64
uses: messense/maturin-action@v1
with:
target: x86_64
# We do source distribution here too
args: --release --out dist
- name: Install built wheel - x86_64
run: |
pip install milagro_bls_binding --no-index --find-links dist --force-reinstall
python -c "import milagro_bls_binding"
- name: Build wheels - universal2
uses: messense/maturin-action@v1
with:
args: --release --universal2 --out dist --no-sdist
- name: Install built wheel - universal2
run: |
pip install milagro_bls_binding --no-index --find-links dist --force-reinstall
python -c "import milagro_bls_binding"
- name: Upload wheels
uses: actions/upload-artifact@v2
with:
name: wheels
path: dist
windows:
runs-on: windows-latest
needs: build
strategy:
matrix:
target: [x64, x86]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.7
architecture: ${{ matrix.target }}
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
default: true
- name: Build wheels
uses: messense/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist --no-sdist
- name: Install built wheel
run: |
pip install milagro_bls_binding --no-index --find-links dist --force-reinstall
python -c "import milagro_bls_binding"
- name: Upload wheels
uses: actions/upload-artifact@v2
with:
name: wheels
path: dist
linux:
runs-on: ubuntu-latest
needs: build
strategy:
matrix:
target: [x86_64, i686, aarch64]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.7
architecture: x64
- name: Build Wheels
uses: messense/maturin-action@v1
with:
target: ${{ matrix.target }}
manylinux: auto
args: --release --out dist --no-sdist
- name: Install built wheel
if: matrix.target == 'x86_64'
run: |
pip install milagro_bls_binding --no-index --find-links dist --force-reinstall
python -c "import milagro_bls_binding"
- name: Upload wheels
uses: actions/upload-artifact@v2
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@v2
with:
name: wheels
- name: PyPi publish
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_PASSWORD }}
uses: messense/maturin-action@v1
with:
command: upload
args: --skip-existing *