Merge pull request #60 from ermakov-oleg/int-enum-fix #252
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
tags: | |
- '**' | |
branches: | |
- main | |
- master | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
linux: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: messense/maturin-action@v1 | |
with: | |
manylinux: auto | |
command: build | |
args: --release --sdist -o dist --find-interpreter | |
sccache: 'true' | |
- name: Upload wheels | |
uses: actions/upload-artifact@v2 | |
with: | |
name: wheels | |
path: dist | |
windows: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- uses: messense/maturin-action@v1 | |
with: | |
command: build | |
args: --release -o dist --find-interpreter | |
sccache: 'true' | |
- name: Upload wheels | |
uses: actions/upload-artifact@v2 | |
with: | |
name: wheels | |
path: dist | |
macos: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- uses: messense/maturin-action@v1 | |
with: | |
command: build | |
args: --release -o dist --universal2 --find-interpreter | |
sccache: 'true' | |
- name: Upload wheels | |
uses: actions/upload-artifact@v2 | |
with: | |
name: wheels | |
path: dist | |
test: | |
needs: [ macos, windows, linux ] | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ ubuntu-latest, macos-latest, windows-latest ] | |
python-version: ["3.9", "3.10", "3.11"] | |
name: Test on ${{ matrix.os}} ${{ matrix.python-version }} | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- uses: actions/download-artifact@v2 | |
with: | |
name: wheels | |
path: wheels | |
- name: install dependencies | |
run: | | |
python -m pip install --upgrade pip nox | |
- name: tests | |
run: nox -s test | |
env: | |
CI: true | |
- name: lint | |
run: nox -s lint | |
env: | |
CI: true | |
- name: check types | |
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.10' | |
run: nox -s type_check | |
env: | |
CI: true | |
benchmark: | |
needs: [ linux ] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: set up Python 3.11 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11 | |
- uses: actions/download-artifact@v2 | |
with: | |
name: wheels | |
path: wheels | |
- name: install dependencies | |
run: | | |
python -m pip install --upgrade pip nox | |
- name: bench | |
run: nox -s bench | |
env: | |
CI: true | |
benchmark-codespeed: | |
needs: [ linux ] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: set up Python 3.11 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11 | |
- uses: actions/download-artifact@v2 | |
with: | |
name: wheels | |
path: wheels | |
- name: install dependencies | |
run: | | |
python -m pip install --upgrade pip nox | |
- name: Run benchmarks | |
uses: CodSpeedHQ/action@v1 | |
with: | |
token: ${{ secrets.CODSPEED_TOKEN }} | |
run: nox -s bench_codespeed | |
env: | |
CI: true | |
fmt: | |
name: rustfmt | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
components: rustfmt | |
- run: cargo fmt --all -- --check | |
clippy: | |
name: clippy | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
components: clippy | |
- run: cargo clippy --all-targets --all-features -- -D warnings | |
release: | |
name: release | |
runs-on: ubuntu-latest | |
if: startsWith(github.event.ref, 'refs/tags') | |
needs: [ macos, windows, linux, test ] | |
steps: | |
- uses: actions/download-artifact@v2 | |
with: | |
name: wheels | |
- name: Publish to PyPI | |
uses: messense/maturin-action@v1 | |
env: | |
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} | |
with: | |
command: upload | |
args: --skip-existing * |