name: build
on:
push:
branches:
- trunk
- crates-io
paths-ignore:
- "COPYRIGHT"
- "LICENSE-*"
- "**.md"
- "**.txt"
- "**readme.yml"
- "**tpl"
pull_request:
branches:
- trunk
- crates-io
paths-ignore:
- "COPYRIGHT"
- "LICENSE-*"
- "**.md"
- "**.txt"
- "**readme.yml"
- "**tpl"
jobs:
rustfmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Rust
uses: hecrj/setup-rust-action@v1
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose --no-default-features
check:
name: Code coverage
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Run cargo-tarpaulin
uses: actions-rs/tarpaulin@v0.1
with:
version: '0.12.3'
args: '--count --frozen --no-default-features -- --test-threads 1'
- name: Upload to codecov.io
uses: codecov/codecov-action@v1.0.2
with:
token: ${{secrets.CODECOV_TOKEN}}
pytest:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Install Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Install python CI dependencies
run: |
python -m pip install --upgrade pip
pip install maturin pytest cobra
- name: Install with maturin
run: |
maturin build
pip install .
- name: Run tests with pytest
run: pytest