From 7aa6c06c3682231f8973b075551182d12a42968e Mon Sep 17 00:00:00 2001 From: Gautier Dagan Date: Thu, 14 Dec 2023 19:46:03 +0000 Subject: [PATCH] split workflow --- .github/workflows/CI.yml | 59 ++++------------------------------ .github/workflows/test.yml | 65 ++++++++++++++++++++++++++++++++++++++ README.md | 2 +- 3 files changed, 72 insertions(+), 54 deletions(-) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index d3cb5b0..d70e37f 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -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/rust-cache@v2.7.0 - 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: @@ -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: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..b9549e0 --- /dev/null +++ b/.github/workflows/test.yml @@ -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/rust-cache@v2.7.0 + 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 }} diff --git a/README.md b/README.md index 4c8de23..caf21b7 100644 --- a/README.md +++ b/README.md @@ -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)