Skip to content

chore(deps): Bump codecov/codecov-action from 3 to 4 #323

chore(deps): Bump codecov/codecov-action from 3 to 4

chore(deps): Bump codecov/codecov-action from 3 to 4 #323

Workflow file for this run

name: test
on:
pull_request:
push:
branches:
- main
jobs:
pre_commit:
name: "pre-commit"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- run: pip install pre-commit
- uses: actions/cache@v3
id: pre-commit-cache
with:
path: ~/.cache/pre-commit
key: key-0
- run: pre-commit run --all-files
python_test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [ "3.9", "3.10", "3.11.1" ]
services:
redis:
image: redis:6.2.5-alpine
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- '127.0.0.1:6389:6379'
steps:
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: minimal
components: llvm-tools-preview
- uses: taiki-e/install-action@cargo-llvm-cov
- uses: actions/setup-python@v4
id: python-setup
with:
python-version: "${{ matrix.python-version }}"
- uses: actions/cache@v3
id: cache-venv-and-cargo
with:
path: |
.venv
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ hashFiles('**/dev-requirements.txt') }}-${{ steps.python-setup.outputs.python-version }}-${{ hashFiles('**/Cargo.lock') }}-0
- run: |
python -m venv .venv
source .venv/bin/activate
pip install -U pip setuptools wheel
pip install -r dev-requirements.txt
if: steps.cache-venv-and-cargo.outputs.cache-hit != 'true'
- name: Run tests
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
coverage run -m pytest tests
coverage xml
cargo llvm-cov report --lcov --output-path coverage.lcov --ignore-filename-regex "_errors|_tests|lib"
- name: Run benchmarks
run: |
source .venv/bin/activate
maturin build --release --locked --out ./ --strip --find-interpreter --no-default-features
pip install ./self_limiters-* --force-reinstall
python bench.py tb --count 30 --iterations 30 --target 0.25
python bench.py s --count 30 --iterations 30 --target 1.5
if: matrix.python-version == '3.11'
- uses: codecov/codecov-action@v4
with:
files: coverage.lcov,coverage.xml
if: matrix.python-version == '3.11'