Skip to content

Commit 443b134

Browse files
geofmureithiautotakerrobjtederenovate[bot]utterstep
authored
Introducing v1 as solo crate (#1)
* Introducing Apalis * Readme Changes * Make release ready * Lower version * Renaming imports * Up the version * Setup the version * Add license and description * Introducing tower, major changes, refactoring * Updated docs * Improvements on Extensions and Storages * Standardize core + redis + sqlite * Introducing prometheus, mysql, and axum * Added More Improvements esp to features * Moved from Actix * Stabilized parts of Worker API * Added more fixes, Migrations for sqlx and more documentation * Features + introduce twitter example * Minor fixes and added examples * Bump up to v0.3 * Improvements in Docs and bump up to v0.3.1 * Fixes by Rustfmt * Bump up version * Bumping up versions * add once_cell to dev-dependencies * Bump up to v0.3.4 * Bump up version * Remove time 0.1 from dependency tree * Bump up version * Updates getting ready for 0.4.0-alpha * Bump up version * Bump up version * Fixes in changing features * Bump version * Fixed concrete types, for worker and jobs * Minor improvements, fixes on failing tests * Improved layers and added beats * Added expose feature, and worker config * Bump up version * Minor updates on cargo.toml * Bump up version * Bump version * Fix Ack and bump up version * Update Rust crate async-trait to 0.1.68 * Update Rust crate async-std to 1.12.0 * Update Rust crate futures-lite to 1.13.0 * Update Rust crate once_cell to 1.17.1 * Bump up version * Added improvements and simplified * Prep release version 0.4.0-alpha.9 * Bump up version * Update Rust crate once_cell to 1.17.2 * Bump up version * Added improvements to postgres storage * Update Rust crate once_cell to 1.18.0 * Bump up version to v0.4.2 * Update Rust crate async-trait to 0.1.72 * Bump up version * update: sqlx to v0.7 * bump: to version v0.4.4 * fix(deps): update rust crate async-trait to 0.1.73 * fix(deps): update rust crate sqlx to 0.7.2 * bump: v0.4.5 * fix(deps): update rust crate async-trait to 0.1.74 * fix(deps): update rust crate futures-lite to v2 (#192) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Add option to use `time` crate instead of `chrono` (#185) * Add option to use `time` crate instead of `chrono` This is useful for users who are already working with `sqlx` and `time`, bc `sqlx` doesn't allow you to use `chrono` and `time` together. * leaves the default as `chrono` but allows users to opt-in to using `time` instead * adds a `time` feature to `apalis-core`, `apalis-sql` and `apalis-redis` * enabling both `cron` and `time` features now triggers a compile error because `apalis-cron` uses `cron` and `cron` depends on `chrono` * adds `time` to the CI matrix * (subjective) use `datetime - duration` instead of `datetime.sub(duration)` * [fix] include CI changes * [fix] use correct timestamping method in `apalis-redis` * fix tests * rustfmt * Bump to version 0.4.6 (#197) * docs: minor updates * fix: update to latest version of cargo-get * bump: up to version 0.4.6 * Bump to v0.4.7 (#210) * fix(deps): update rust crate http to v1 * fix: update for http 1.x * bump: to v0.4.7 --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update rust crate sqlx to 0.7.3 (#212) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update rust crate futures-lite to 2.1.0 (#214) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * chore(deps): update rust crate once_cell to 1.19.0 (#217) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update rust crate async-trait to 0.1.77 (#225) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * bump: to v0.4.8 (#229) * fix(deps): update rust crate futures-lite to 2.2.0 (#230) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * bump: to v0.4.9 (#232) * Introducing v0.5! (#234) * Introducing v0.5! * fix: api and other fixes * Fix: improvements on backends * fix: improve api * fix: remove utils and simplify crates * lint: fmt issues * lint: clippy fixes * fix: moved files * clippy: fixes * tests: updates on tests * fixes: on internal api * ci: update the test features * test: remove some assertions * docs: updated docs for tests * fix: minor clippy and fixes * bench: fixes on bench: * bench: fixes on bench: * bench: ! * bench: ! * fix: version for test * fix: add vacuuming and other apis * fix: improve benches * fix: benches and worker * fix: typo * fix: prepared statement * lint: clippy * fix: redis test * add: use ulid without jid * add: improve the Readme.md * fix: tower link * bump: to 0.5 * fix(deps): update rust crate sqlx to 0.7.4 (#262) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * bump: to version 0.5.1 (#265) * fix(deps): update rust crate futures-lite to 2.3.0 (#276) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update rust crate futures to 0.3.30 (#307) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update rust crate async-stream to 0.3.5 (#304) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * fix(deps): update rust crate log to 0.4.21 (#308) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * bump: to version 0.5.2 (#322) * bump: to version 0.5.3 (#328) * chore: Add repository to metadata (#345) * Update sqlx to 0.8.1 (#403) * bump: 0.5.4 (#405) * bump: to 0.5.5 (#408) * [bump] introduce new version: 0.6 (#459) * fix: improve external api for redis * fix: improve exports for redis * fix: expose redis codec * Feature: v0.6.0-alpha.0 version of apalis Breaking Changes: - Dropped traits Job and Message, please use namespace * fix: minor fixes on some failures * lint: cargo fmt * fix: remove Job impl * lint: cargo fmt * bench: improve polling * fix: introduce namespace and codec config (#339) * fix: introduce namespace and codec config * fix: missing apis * Version: 0.6.0-alpha.1 (#342) * api: for redis and sqlite * Version: 0.6.0-alpha.1 Changelog: - Redis storage doesnt require pool to be clone. Allows use of deadpool-redis among others. - Namespace is picked by default for `new` methods. * fix: docs and tests * lint: cargo clippy and fmt * postgres: add a listener example * bump: to v0.6.0-alpha.1 (#343) * api: for redis and sqlite * Version: 0.6.0-alpha.1 Changelog: - Redis storage doesnt require pool to be clone. Allows use of deadpool-redis among others. - Namespace is picked by default for `new` methods. * fix: docs and tests * lint: cargo clippy and fmt * postgres: add a listener example * bump: to v0.6.0-alpha.1 * fix: allow cd for prereleases (#349) * Remove `Clone` constraints and buffer the service (#348) * feat: remove the `Clone` requirements for services * test save * fix: get buffered layer working * update: remove clone & update api * fix: tests and api * lint: clippy fixes * lint: cargo fmt * bump: to 0.6.0-rc.1 (#350) * feat: add rsmq example (#353) * Fix: load layer from poller (#354) * fix: backend layers were not loaded * fix: handle clone * Fix: mq example (#355) * fix: mq ack * lint: fmt * fix: handle unwraps in storages (#356) * fix: handle unwraps in storages * fix: ensure no unwrap * fix: better apalis deps allowing tree shaking for backends (#357) * fix: better apalis deps allowing tree shaking for backends * fix: remove backend features in the root crate * standardize backend for storage and mq (#358) * fix: standardize backend for storage and mq * fix: minor fixes * feat: standardize cron as backend (#359) * fix: remove non-working restapi example (#360) * fix: expose the missing apis (#361) * bump: to new version (#362) * Make Config accessible publicly (#364) * fix: add missing exposed config * fix: add getters * fix: die if retries is zero (#365) * Feature: Add a layer that catches panics (#366) * Feature: Add a layer that catches panics This allows preventing job execution from killing workers and returns an error containing the backtrace * fix: backtrace as it may be different * add: example for catch-panic * fix: make not default * Feature: Save results for storages (#369) * Feature: Save results for storages Currently just the status is stored, this PR adds the ability to save the result * fix: result from storage * fix: kill and abort issue * Bump: to 0.6.0-rc.3 (#370) * fix: serde for sql request (#371) * fix: serde for sql request * fix: serde for attempts * lint: fmt * fix: handle attempts in storages (#373) * fix: handle attempts in storages * fix: chrono serialization * fix: tests failing because of tests * add: test utils that allow backend polling during tests (#374) * add: test utils that allow backend polling during tests * fix: introduce testwrapper and add more tests * fix: add sample for testing * fix: more fixes and actions fixes * fix: more fixes on vacuuming * tests: improve cleanup and generic testing * fix: improve testing and fix some found bugs * fix: postgres query and remove incompatible tests * fix: remove redis incompatible check * fix: minor fixes * fix: postgres json elements * bump: to 0.6.0-rc.4 (#377) * fix: handle 0 retries (#378) * fix: ack api to allow backend to handle differently (#383) * fix: ack api to allow backend to handle differently * fix: related to storage tests * fix: calculate status for postgres * fix(deps): update rust crate sqlx to 0.8.0 (#380) * chore: fix typos (#346) * chore: Add repository to metadata (#345) * fix(deps): update rust crate sqlx to 0.8.0 * fix: sqlite example --------- Co-authored-by: John Vandenberg <jayvdb@gmail.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: geofmureithi <mureithinjuguna@gmail.com> Co-authored-by: Geoffrey Mureithi <95377562+geofmureithi@users.noreply.github.com> * bump: to v0.6.0-rc.5 (#385) * chore: standardize codec usage (#388) * bump: to v0.6.0-rc.5 * fix: standardize codec usage * lint: cargo fmt * Chore/more examples (#389) * add: catch-panic example * add: graceful shutdown example * add: unmonitored example * add: arguments example * fix: minor updates * fix: sql tests * fix: minor updates * fix: improve on benches (#379) * fix: improve on benches * fix: bench trigger * fix: include tokio for sqlx * fix: improve the benching approach * fix: mysql api * fix: redis api * fix: improve bench approach, remove counter * remove: setup * remove: pg * fix: pg * fix: pg * fix(deps): update rust crate sqlx to 0.8.1 [security] (#400) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Geoffrey Mureithi <95377562+geofmureithi@users.noreply.github.com> * fix: add some missing data required for dependency injection (#409) * fix: add some missing data required for dependency injection * lint: clippy and fmt * remove: benchmarks (#410) They will be moved to https://github.com/geofmureithi/apalis-benchmarks * bump: to 0.6.0-rc.6 (#412) * Update async-std to 1.13 (#413) * Feature: Introducing Request Context (#416) * wip: introduce context to request * fix: get request context working * lint: cargo fmt * fix: get tests compiling * add: push_request and shedule_request * fix: task_id for Testwrapper * fix: minor checks and fixes on postgres tests * fix: bug on postgres fetch_next * bump: to 0.6.0-rc.7 (#418) * fix: apply `FromRequest` for items in `Parts` (#425) Problem: We are missing crucial `FromRequest` impls for: - TaskId - Attempt - Namespace Also removed `Context<E>` Solution: Implement `FromRequest` for these Types. * fix:[bug] include backend provided layer in service layers. (#426) * fix:[bug] include backend provided layer in service layers. Problem: The current worker logic is missing an implementation where the backend provided layer should be added to the service's layer. This is a critical issue that affects all v0.6.0-rc-7 users and they should update as soon as a new release is done. Solution: - Add backend layers to service's layer. - Add worker_consume tests on the storages to prevent regression on this. * chore: comment an enforcement rule not yet followed by redis * chore: bump to 0.6.0-rc.8 (#430) * fix: apply max_attempts set via SqlContext (#447) So that a custom number of attempts can be configured: let mut ctx = SqlContext::new(); ctx.set_max_attempts(2); let req = Request::new_with_ctx(job, ctx); storage.push_request(req).await.unwrap(); While the default is still to try up to 25 times: storage.push(job).await.unwrap(); * Bump redis (#442) * feat: re-export sqlx (#451) Making sqlx accessible to users of apalis without requiring them to explicitly add it as a dependency. * feat: Improve Worker management and drop Executor (#428) * feat: introducing WorkerBuilderExt which makes the work of building a new worker way easier. * improve: worker api almost there * fix: radical improvements and updates. Removed executor and got graceful shutdown working * chore: deprecate register with count and force builder order * chore: more improvements on the worker * fix: allow DI for Worker * add: get the task count by a worker * lint: fmt and clippy * fix: allow worker stopping * Chore/better api (#452) * fix: relax the api provided for sqlx req * lint: clippy and fmt * feat: add recovery of abandoned jobs to backend heartbeats (#453) * feat: add recovery of abandoned jobs to backend heartbeats * lint: fmt * fix: attempt to get tests passing * fix: attempt to get tests passing * fix: minor fix typo * fix: minor different solutions * fix: better handle attempts * handle postgres edge case * fix: better handling * feat: allow backends to emit errors (#454) * feat: allow backends to emit errors * lint: fmt * fix: pass in a reference to prevent mutation * Feat: Introduce simple ability to pipe cron jobs to any backend (#455) * Feat: Introduce simple ability to pipe cron jobs to any backend This feature allows you to quickly persist cron jobs guaranteeing they will be run and can be distributed * lint: cargo fmt * chore/dev-branch * feat: return of exposing backends to help in building apis (#457) (#458) * fmt: Cargo.toml * fix: removed features * fix: run only specific tests --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: John Vandenberg <jayvdb@gmail.com> Co-authored-by: Mathias Lafeldt <mathias.lafeldt@gmail.com> Co-authored-by: zakstucke <44890343+zakstucke@users.noreply.github.com> * bump: to v0.6.1 (#479) * bump: to v0.6.2 (#482) * bump: to v0.6.3 (#490) * bump: to v0.6.4 (#500) * feat: add `native-tls` feature flags (#525) Co-authored-by: Geoffrey Mureithi <95377562+geofmureithi@users.noreply.github.com> * Support priority in SQL storage backends (#533) * Add support for optional job priority to postgres storage * add migration * revert postgres changes * update mysql and postgres code to use sqlcontext priority * WIP * finish (hopefully) mysql and sqlite job fetch * add priority tests * update changelog * Update CHANGELOG.md * test * cleanup and add missing priority in FromRow impls * fix mysql implementation * bump: to 0.7.0 (#536) * bump: to v0.7.1 (#559) * changelog: bump to v0.7.1 * bump: to v0.7.1 * bump: apalis to v0.7.2 (#580) * more: fixes on updates * fix: more improvements * introduce custom backends * feat: remove task_id constrain as ulid * bump: apalis to v0.7.3 (#595) * wip: generic sinks and fetchers * improve metadata * docs: improvement * bump: version * chore: initial split * get backends working * fix: improve shared setup * cliipy:lint * cliipy:lint * cargo: sqlx prep * improvements on queries * checkpoint: features working * checkpoint: refactor * add bytes support * chore: ready for CI * lib cleanup * chore: minor fixes --------- Co-authored-by: autotaker <autotaker@gmail.com> Co-authored-by: Rob Ede <robjtede@icloud.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Vlad Stepanov <8uk.8ak@gmail.com> Co-authored-by: John Vandenberg <jayvdb@gmail.com> Co-authored-by: Michael Brogdon <michael.brogdon@monotype.com> Co-authored-by: Mathias Lafeldt <mathias.lafeldt@gmail.com> Co-authored-by: zakstucke <44890343+zakstucke@users.noreply.github.com> Co-authored-by: Daniëlle Huisman <danielle@huisman.me> Co-authored-by: Derek Leverenz <derek@yurts.ai>
1 parent 88e5512 commit 443b134

80 files changed

Lines changed: 5930 additions & 1 deletion

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: Bug Report
2+
description: File a bug report to help us improve
3+
title: "[Bug]: "
4+
labels: ["bug"]
5+
assignees: []
6+
7+
body:
8+
- type: markdown
9+
attributes:
10+
value: |
11+
Thanks for taking the time to fill out this bug report!
12+
13+
- type: textarea
14+
id: what-happened
15+
attributes:
16+
label: What happened?
17+
description: A clear and concise description of what the bug is.
18+
placeholder: Tell us what you see!
19+
validations:
20+
required: true
21+
22+
- type: textarea
23+
id: expected
24+
attributes:
25+
label: Expected behavior
26+
description: A clear and concise description of what you expected to happen.
27+
validations:
28+
required: true
29+
30+
- type: textarea
31+
id: reproduce
32+
attributes:
33+
label: Steps to reproduce
34+
description: Steps to reproduce the behavior
35+
placeholder: |
36+
1. Go to '...'
37+
2. Click on '....'
38+
3. Scroll down to '....'
39+
4. See error
40+
validations:
41+
required: true
42+
43+
- type: textarea
44+
id: code
45+
attributes:
46+
label: Minimal code example
47+
description: If applicable, add a minimal code example that reproduces the issue
48+
render: rust
49+
50+
- type: dropdown
51+
id: version
52+
attributes:
53+
label: Version
54+
description: What version of apalis-sqlite are you running?
55+
options:
56+
- 1.0.0-alpha.1
57+
- main branch
58+
- Other (specify in additional context)
59+
validations:
60+
required: true
61+
62+
- type: textarea
63+
id: environment
64+
attributes:
65+
label: Environment
66+
description: |
67+
Please provide information about your environment:
68+
- OS: [e.g. Ubuntu 20.04, macOS 12.0, Windows 11]
69+
- Rust version: [e.g. 1.70.0]
70+
- Cargo version: [e.g. 1.70.0]
71+
value: |
72+
- OS:
73+
- Rust version:
74+
- Cargo version:
75+
validations:
76+
required: true
77+
78+
- type: textarea
79+
id: logs
80+
attributes:
81+
label: Relevant log output
82+
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
83+
render: shell
84+
85+
- type: textarea
86+
id: context
87+
attributes:
88+
label: Additional context
89+
description: Add any other context about the problem here.
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Feature Request
2+
description: Suggest an idea for this project
3+
title: "[Feature]: "
4+
labels: ["enhancement"]
5+
assignees: []
6+
7+
body:
8+
- type: markdown
9+
attributes:
10+
value: |
11+
Thanks for taking the time to suggest a new feature!
12+
13+
- type: textarea
14+
id: problem
15+
attributes:
16+
label: Is your feature request related to a problem?
17+
description: A clear and concise description of what the problem is.
18+
placeholder: I'm always frustrated when...
19+
validations:
20+
required: true
21+
22+
- type: textarea
23+
id: solution
24+
attributes:
25+
label: Describe the solution you'd like
26+
description: A clear and concise description of what you want to happen.
27+
validations:
28+
required: true
29+
30+
- type: textarea
31+
id: alternatives
32+
attributes:
33+
label: Describe alternatives you've considered
34+
description: A clear and concise description of any alternative solutions or features you've considered.
35+
36+
- type: textarea
37+
id: use-case
38+
attributes:
39+
label: Use case
40+
description: Describe your specific use case and how this feature would help.
41+
validations:
42+
required: true
43+
44+
- type: textarea
45+
id: implementation
46+
attributes:
47+
label: Additional context
48+
description: Add any other context, screenshots, or implementation ideas about the feature request here.
49+
50+
- type: checkboxes
51+
id: terms
52+
attributes:
53+
label: Code of Conduct
54+
description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/apalis-dev/apalis-sqlite/blob/main/CODE_OF_CONDUCT.md)
55+
options:
56+
- label: I agree to follow this project's Code of Conduct
57+
required: true

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
## Description
2+
3+
Brief description of what this PR does.
4+
5+
## Type of Change
6+
7+
- [ ] Bug fix (non-breaking change which fixes an issue)
8+
- [ ] New feature (non-breaking change which adds functionality)
9+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
10+
- [ ] Documentation update
11+
- [ ] Performance improvement
12+
- [ ] Refactoring (no functional changes)
13+
14+
## Testing
15+
16+
- [ ] I have added tests that prove my fix is effective or that my feature works
17+
- [ ] I have run the existing tests and they pass
18+
- [ ] I have run `cargo fmt` and `cargo clippy`
19+
20+
## Checklist
21+
22+
- [ ] My code follows the code style of this project
23+
- [ ] I have performed a self-review of my own code
24+
- [ ] I have commented my code, particularly in hard-to-understand areas
25+
- [ ] I have made corresponding changes to the documentation
26+
- [ ] My changes generate no new warnings
27+
- [ ] I have added tests that prove my fix is effective or that my feature works
28+
- [ ] New and existing unit tests pass locally with my changes
29+
30+
## Additional Notes
31+
32+
Any additional information, context, or screenshots about the pull request here.

.github/dependabot.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
version: 2
2+
updates:
3+
# Enable version updates for Cargo
4+
- package-ecosystem: "cargo"
5+
directory: "/"
6+
schedule:
7+
interval: "weekly"
8+
day: "monday"
9+
time: "06:00"
10+
open-pull-requests-limit: 10
11+
reviewers:
12+
- "geofmureithi"
13+
assignees:
14+
- "geofmureithi"
15+
commit-message:
16+
prefix: "deps"
17+
include: "scope"
18+
labels:
19+
- "dependencies"
20+
- "rust"
21+
22+
# Enable version updates for GitHub Actions
23+
- package-ecosystem: "github-actions"
24+
directory: "/"
25+
schedule:
26+
interval: "weekly"
27+
day: "monday"
28+
time: "06:00"
29+
open-pull-requests-limit: 5
30+
reviewers:
31+
- "geofmureithi"
32+
assignees:
33+
- "geofmureithi"
34+
commit-message:
35+
prefix: "ci"
36+
include: "scope"
37+
labels:
38+
- "dependencies"
39+
- "github-actions"

.github/workflows/bench.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Benchmarks
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
benchmark:
14+
name: Performance Benchmarks
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout sources
18+
uses: actions/checkout@v4
19+
20+
- name: Install Rust toolchain
21+
uses: dtolnay/rust-toolchain@stable
22+
23+
- name: Cache cargo registry
24+
uses: actions/cache@v4
25+
with:
26+
path: |
27+
~/.cargo/registry
28+
~/.cargo/git
29+
target
30+
key: ${{ runner.os }}-cargo-bench-${{ hashFiles('**/Cargo.lock') }}
31+
32+
- name: Run benchmarks
33+
run: |
34+
if find . -name "*.rs" -exec grep -l "#\[bench\]" {} \; | grep -q .; then
35+
echo "Found benchmark tests, running cargo bench"
36+
cargo bench
37+
else
38+
echo "No benchmark tests found, skipping"
39+
fi
40+
41+
- name: Install cargo-criterion (if criterion benchmarks exist)
42+
run: |
43+
if find . -name "*.rs" -exec grep -l "criterion::" {} \; | grep -q .; then
44+
echo "Found criterion benchmarks, installing cargo-criterion"
45+
cargo install cargo-criterion
46+
cargo criterion
47+
else
48+
echo "No criterion benchmarks found, skipping"
49+
fi
50+
51+
msrv:
52+
name: Minimum Supported Rust Version
53+
runs-on: ubuntu-latest
54+
steps:
55+
- name: Checkout sources
56+
uses: actions/checkout@v4
57+
58+
- name: Get MSRV from Cargo.toml
59+
id: msrv
60+
run: |
61+
MSRV=$(grep "rust-version" Cargo.toml | sed 's/.*rust-version.*=.*"\(.*\)".*/\1/' || echo "1.70.0")
62+
echo "msrv=$MSRV" >> $GITHUB_OUTPUT
63+
echo "Detected MSRV: $MSRV"
64+
65+
- name: Install MSRV Rust toolchain
66+
uses: dtolnay/rust-toolchain@master
67+
with:
68+
toolchain: ${{ steps.msrv.outputs.msrv }}
69+
70+
- name: Cache cargo registry
71+
uses: actions/cache@v4
72+
with:
73+
path: |
74+
~/.cargo/registry
75+
~/.cargo/git
76+
target
77+
key: ${{ runner.os }}-cargo-msrv-${{ steps.msrv.outputs.msrv }}-${{ hashFiles('**/Cargo.lock') }}
78+
79+
- name: Test with MSRV
80+
run: cargo test --all-features

0 commit comments

Comments
 (0)