Skip to content

Commit

Permalink
chore(CI): fix CI and linter warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
mgrachev committed Dec 25, 2024
1 parent 209fe89 commit 8a7bb85
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 26 deletions.
3 changes: 0 additions & 3 deletions .github/actions-rs/grcov.yml

This file was deleted.

35 changes: 18 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,29 +40,30 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
toolchain: nightly
components: llvm-tools-preview
# https://github.com/dtolnay/rust-toolchain/issues/29
- run: rustup override set nightly
- name: Set grcov version
run: echo "GRCOV_VERSION=$(cargo search --limit 1 grcov | head -n1 | cut -d '"' -f2)" >> $GITHUB_ENV
- run: cargo install --version $GRCOV_VERSION grcov
- name: Clean coverage
run: |
rm -f target/debug/deps/*.gcda
rm -f target/debug/deps/*.gcno
- uses: Swatinem/[email protected]
# - name: Set grcov version
# run: echo "GRCOV_VERSION=$(cargo search --limit 1 grcov | head -n1 | cut -d '"' -f2)" >> $GITHUB_ENV
# - run: cargo install --version $GRCOV_VERSION grcov
- uses: baptiste0928/cargo-install@v3
with:
key: ${{ env.GRCOV_VERSION }}
- run: cargo test --no-fail-fast --no-default-features --features ${{ matrix.all_registries }},${{ matrix.http_client }}
crate: grcov
- run: cargo clean
- uses: Swatinem/rust-cache@v2
- run: cargo +nightly test --no-fail-fast --no-default-features --features ${{ matrix.all_registries }},${{ matrix.http_client }}
env:
CARGO_INCREMENTAL: '0'
RUSTFLAGS: |
-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off
RUSTDOCFLAGS: |
-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off
- uses: actions-rs/[email protected]
- uses: codecov/codecov-action@v4
LLVM_PROFILE_FILE: 'target/debug/coverage/update-informer-%p-%m.profraw'
RUSTFLAGS: '-Cinstrument-coverage'
# - uses: actions-rs/[email protected]
- run: grcov . -s . --binary-path ./target/debug/ -t lcov --branch --ignore-not-existing -o ./target/debug/coverage/
- uses: codecov/codecov-action@v5
with:
file: ./lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
files: target/debug/coverage/lcov

cargo-sort:
runs-on: ubuntu-latest
Expand Down
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
[codecov-badge]: https://codecov.io/gh/mgrachev/update-informer/branch/main/graph/badge.svg?token=A4XD1DGFGJ
[codecov-url]: https://codecov.io/gh/mgrachev/update-informer
[downloads-badge]: https://img.shields.io/crates/d/update-informer
[etcetera]: https://github.com/lunacookies/etcetera
[etcetera]: https://github.com/lunacookies/etcetera
[ureq]: https://github.com/algesten/ureq
[semver]: https://github.com/dtolnay/semver
[serde]: https://github.com/serde-rs/serde
Expand All @@ -35,8 +35,8 @@
[![Downloads][downloads-badge]][crates-url]

<img align="right"
alt="update-informer"
src="https://raw.githubusercontent.com/mgrachev/update-informer/main/logo.svg?sanitize=true">
alt="update-informer"
src="https://raw.githubusercontent.com/mgrachev/update-informer/main/logo.svg?sanitize=true">

Update informer for applications written in Rust 🦀

Expand All @@ -47,7 +47,8 @@ It checks for a new version on Crates.io, GitHub, Npm and PyPI. 🚀
- Support of **Crates.io**, **GitHub**, **Npm** and **PyPI**.
- Configurable [check frequency](#interval) and [request timeout](#request-timeout).
- [Caching](#caching) the results of checking updates.
- Ability to implement your own [registry](#implementing-your-own-registry) or [http client](#using-your-own-http-client).
- Ability to implement your own [registry](#implementing-your-own-registry)
or [http client](#using-your-own-http-client).
- **Minimum dependencies** - only [etcetera], [semver], [serde] and an HTTP client ([ureq] or [reqwest]).

## Idea
Expand Down Expand Up @@ -204,7 +205,8 @@ informer.check_version();

## Tests

In order not to check for updates in tests, you can use the `FakeUpdateInformer::check_version` function, which returns the desired version:
In order not to check for updates in tests, you can use the `FakeUpdateInformer::check_version` function, which returns
the desired version:

```rust
use update_informer::{registry, Check};
Expand All @@ -225,7 +227,8 @@ if let Some(version) = informer.check_version().ok().flatten() {

## Integration tests

To use the `FakeUpdateInformer::check_version` function in integration tests, you must first add the feature flag to `Cargo.toml`:
To use the `FakeUpdateInformer::check_version` function in integration tests, you must first add the feature flag to
`Cargo.toml`:

```toml
[features]
Expand Down

0 comments on commit 8a7bb85

Please sign in to comment.