Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix codecov coverage #141

Merged
merged 5 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading