Skip to content

Commit

Permalink
split workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
gautierdag committed Dec 14, 2023
1 parent b811b8f commit 7aa6c06
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 54 deletions.
59 changes: 6 additions & 53 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,63 +6,16 @@
name: CI

on:
push:
branches:
- main
- master
tags:
- "*"
pull_request:
workflow_dispatch:
workflow_run:
workflows: ["test"]
branches: [release]
types:
- completed

permissions:
contents: read

jobs:
coverage:
name: Coverage for ${{ matrix.os }}
strategy:
matrix:
os: ["ubuntu"]
runs-on: ${{ matrix.os }}-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: "3.10"
cache: "pip"
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: minimal
components: llvm-tools-preview
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- uses: Swatinem/[email protected]
with:
key: coverage-cargo-${{ matrix.os }}
continue-on-error: true
- name: Setup virtual environment
run: |
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
- name: Run coverage
run: |
source venv/bin/activate
source <(cargo llvm-cov show-env --export-prefix)
export CARGO_TARGET_DIR=$CARGO_LLVM_COV_TARGET_DIR
export CARGO_INCREMENTAL=1
cargo llvm-cov clean --workspace
cargo test
maturin develop
pytest tests --cov=foobar --cov-report xml
cargo llvm-cov report --lcov --output-path coverage.lcov
- uses: codecov/codecov-action@v3
with:
files: coverage.lcov,coverage.xml
name: ${{ matrix.os }}
linux:
runs-on: ubuntu-latest
strategy:
Expand Down Expand Up @@ -149,8 +102,8 @@ jobs:
release:
name: Release
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/')"
needs: [linux, windows, macos, sdist]
if: "startsWith(github.ref, 'refs/tags/')"
steps:
- uses: actions/download-artifact@v3
with:
Expand Down
65 changes: 65 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# This file is autogenerated by maturin v1.3.1
# To update, run
#
# maturin generate-ci github
#
name: test

on:
push:
branches:
- main
- release
tags:
- "*"
pull_request:
workflow_dispatch:

permissions:
contents: read

jobs:
coverage:
name: Coverage for ${{ matrix.os }}
strategy:
matrix:
os: ["ubuntu"]
runs-on: ${{ matrix.os }}-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: "3.10"
cache: "pip"
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: minimal
components: llvm-tools-preview
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- uses: Swatinem/[email protected]
with:
key: coverage-cargo-${{ matrix.os }}
continue-on-error: true
- name: Setup virtual environment
run: |
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
- name: Run coverage
run: |
source venv/bin/activate
source <(cargo llvm-cov show-env --export-prefix)
export CARGO_TARGET_DIR=$CARGO_LLVM_COV_TARGET_DIR
export CARGO_INCREMENTAL=1
cargo llvm-cov clean --workspace
cargo test
maturin develop
pytest tests --cov=foobar --cov-report xml
cargo llvm-cov report --lcov --output-path coverage.lcov
- uses: codecov/codecov-action@v3
with:
files: coverage.lcov,coverage.xml
name: ${{ matrix.os }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![codecov](https://codecov.io/gh/gautierdag/bpeasy/branch/main/graph/badge.svg?token=NWHDJ22L8I)](https://codecov.io/gh/gautierdag/bpeasy)

[![tests](https://github.com/gautierdag/bpeasy/actions/workflows/CI.yml/badge.svg)](https://github.com/gautierdag/bpeasy/actions/workflows/CI.yml)
[![tests](https://github.com/gautierdag/bpeasy/actions/workflows/test.yml/badge.svg)](https://github.com/gautierdag/bpeasy/actions/workflows/test.yml)
[![image](https://img.shields.io/pypi/v/bpeasy.svg)](https://pypi.python.org/pypi/bpeasy)
[![image](https://img.shields.io/pypi/l/bpeasy.svg)](https://pypi.python.org/pypi/bpeasy)
[![image](https://img.shields.io/pypi/pyversions/bpeasy.svg)](https://pypi.python.org/pypi/bpeasy)
Expand Down

0 comments on commit 7aa6c06

Please sign in to comment.