name: CI
on:
pull_request:
push: branches:
- master
jobs:
ci:
strategy:
matrix:
os: ["ubuntu-20.04", "macos-latest"]
runs-on: ${{ matrix.os }}
env:
RUSTFLAGS: --deny warnings
steps:
- uses: actions/checkout@v2
- name: Cache
id: rust-cache
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}-cargo-deny-0-12-2
- name: Check for forbidden words
run: "! grep --include='*.rs' -RE 'to_be_bytes|from_be_bytes|dbg!' ."
- name: Install packages
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt update
sudo apt install -y python3 python3-pip python3-dev python3-venv gcc-multilib libclang-dev
- name: Install packages
if: startsWith(matrix.os, 'macos')
run: |
brew install python3 make
echo "/usr/local/opt/make/libexec/gnubin" >> $GITHUB_PATH
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: i686-unknown-linux-gnu
components: rustfmt, clippy
- name: Install cargo-deny
if: steps.rust-cache.outputs.cache-hit != 'true'
run: cargo install --force --version 0.12.2 cargo-deny --locked
- name: Compile x64
run: cargo build --all-targets --all-features
- name: Compile 32bit
if: startsWith(matrix.os, 'ubuntu')
run: cargo build --target i686-unknown-linux-gnu
- name: Run tests
run: make build test
- name: Clippy
run: cargo clippy --all --all-targets
- name: Format
run: cargo fmt --all -- --check
- name: Run CPython wrapper tests
run: |
python3 -m venv venv
source venv/bin/activate
pip3 install --upgrade pip
pip3 install maturin
make test_py