Fix CI build errors #87
Workflow file for this run
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: | |
release: | |
types: [created] | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Install latest nightly | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
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 | |
test: | |
runs-on: ${{ matrix.os }} | |
needs: lint | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ['3.8', '3.9', '3.10', '3.11'] | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: rust-toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
default: true | |
- name: Run rust tests | |
uses: actions-rs/cargo@v1 | |
with: | |
command: test | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements-dev.txt | |
pip install . | |
- name: Run Python tests | |
run: pytest python_tests.py | |
release: | |
runs-on: ${{ matrix.os }} | |
needs: test | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ['3.8', '3.9', '3.10', '3.11'] | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: rust-toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
default: true | |
- name: Run rust tests | |
uses: actions-rs/cargo@v1 | |
with: | |
command: test | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements-dev.txt | |
pip install . | |
- name: Build Python package | |
run: maturin build --release --strip --interpreter python | |
# We run this job until here for every build so that we notice early if there's anything | |
# that would prevent to publish a release. But the actual publishing only happens when we | |
# create an actual Github release. | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: target/wheels/rusty_rlp*.whl | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: PyPi publish | |
if: github.event_name == 'release' && github.event.action == 'created' | |
env: | |
MATURIN_PASSWORD: ${{ secrets.PYPI }} | |
run: maturin publish --no-sdist --username __token__ --interpreter python |