ci: split ci and build workflow #43
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: | |
branches: | |
- main | |
tags: | |
- '*' | |
pull_request: | |
permissions: | |
contents: read | |
jobs: | |
quality: | |
name: ${{ matrix.os }} / ${{ matrix.python-version }} | |
runs-on: ${{ matrix.os }}-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ["ubuntu", "macos", "windows"] | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Set up python environment | |
run: | | |
pip install pipenv | |
pipenv install -r requirements-dev.txt --python=${{ matrix.python-version }} | |
- name: Lint | |
run: | | |
pipenv run pre-commit run --all-files | |
- name: Build | |
run: | | |
pipenv run maturin develop | |
- name: Install cargo-llvm-cov | |
uses: taiki-e/install-action@cargo-llvm-cov | |
- name: Test with coverage | |
run: | | |
cargo llvm-cov --lcov --output-path coverage.lcov | |
pipenv run pytest --cov=bionic_writer --cov-report xml | |
- name: Publish Coverage | |
uses: codecov/codecov-action@v1 | |
if: | | |
matrix.os == 'ubuntu' && | |
matrix.python-version == '3.10' |