Skip to content

Commit

Permalink
fix codecov coverage (#141)
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelcolvin committed Sep 17, 2024
1 parent 20b950f commit b5cb25d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 35 deletions.
54 changes: 20 additions & 34 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ on:

jobs:
resolve:

runs-on: ubuntu-latest
outputs:
MSRV: ${{ steps.resolve-msrv.outputs.MSRV }}
Expand Down Expand Up @@ -44,10 +43,10 @@ jobs:
RUST_VERSION: ${{ matrix.rust-version }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: set up python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.12'

Expand All @@ -60,35 +59,29 @@ jobs:
with:
prefix-key: "v1-rust"

- run: cargo install rustfilt coverage-prepare cargo-careful
- run: cargo install cargo-careful
if: steps.cache-rust.outputs.cache-hit != 'true'

- run: rustup component add llvm-tools-preview

- run: cargo test -F python
env:
RUST_BACKTRACE: 1
RUSTFLAGS: '-C instrument-coverage'

- run: coverage-prepare --ignore-filename-regex '/tests/' lcov $(find ../../target/debug/deps -regex '.*/main[^.]*')
working-directory: crates/jiter

- run: cargo test --doc

- run: cargo careful t -F python
if: matrix.rust-version == 'nightly'

- uses: taiki-e/install-action@cargo-llvm-cov
- run: cargo llvm-cov -F python --codecov --output-path codecov.json

- uses: codecov/codecov-action@v4
with:
env_vars: RUNS_ON,RUST_VERSION
files: codecov.json
token: ${{ secrets.CODECOV_TOKEN }}

test-macos:
name: test on ${{ matrix.runs-on }}
strategy:
fail-fast: false
matrix:
runs-on: [macos-latest, macos-latest]
runs-on: [macos-latest, macos-latest-xlarge]

runs-on: ${{ matrix.runs-on }}

Expand All @@ -97,10 +90,10 @@ jobs:
RUST_VERSION: stable

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: set up python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.12'

Expand All @@ -109,24 +102,17 @@ jobs:
- id: cache-rust
uses: Swatinem/rust-cache@v2

- run: cargo install rustfilt coverage-prepare
if: steps.cache-rust.outputs.cache-hit != 'true'

- run: rustup component add llvm-tools-preview

- run: cargo test -F python
env:
RUST_BACKTRACE: 1
RUSTFLAGS: '-C instrument-coverage'

- run: coverage-prepare --ignore-filename-regex '/tests/' lcov $(find ../../target/debug/deps -regex '.*/main[^.]*')
working-directory: crates/jiter

- run: cargo test --doc
- uses: taiki-e/install-action@cargo-llvm-cov
- run: cargo llvm-cov -F python --codecov --output-path codecov.json

- uses: codecov/codecov-action@v4
with:
env_vars: RUNS_ON,RUST_VERSION
files: codecov.json
token: ${{ secrets.CODECOV_TOKEN }}

test-python:
Expand All @@ -138,10 +124,10 @@ jobs:
RUNS_ON: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: set up python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.12'

Expand Down Expand Up @@ -176,7 +162,7 @@ jobs:
bench:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: moonrepo/setup-rust@v1
with:
Expand All @@ -198,12 +184,12 @@ jobs:
strategy:
fail-fast: false
matrix:
runs-on: [ubuntu-latest, macos-latest]
runs-on: [ubuntu-latest, macos-latest-xlarge]

runs-on: ${{ matrix.runs-on }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: moonrepo/setup-rust@v1
with:
Expand All @@ -223,7 +209,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: moonrepo/setup-rust@v1
with:
Expand All @@ -239,7 +225,7 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: moonrepo/setup-rust@v1
with:
Expand Down
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ keywords = ["JSON", "parsing", "deserialization", "iter"]
categories = ["parser-implementations", "parsing"]
homepage = "https://github.com/pydantic/jiter/"
repository = "https://github.com/pydantic/jiter/"
rust-version = "1.74.0"
# MSRV should match pydantic-core
rust-version = "1.75"

[profile.bench]
debug = true
Expand Down

0 comments on commit b5cb25d

Please sign in to comment.