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

add msrv check #224

Merged
merged 7 commits into from
Feb 28, 2025
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
44 changes: 44 additions & 0 deletions .github/workflows/readme-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: rust

on:
push:
branches: [ "main" ]
workflow_dispatch: {}

env:
CARGO_TERM_COLOR: always

jobs:
check msrv:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- name: find version mentioned in readme
id: readme-version
run: |
set -euo pipefail
pwd
mkdir -p target/debug
cargo build
readme_version="$(cat README.md | ./target/debug/mdq '# Development | P: "Requires rustc >=" ' | awk '{print $NF}')"
echo "result=$readme_version" >> "$GITHUB_OUTPUT"
- name: pull cargo-msrv from docker hub
run: docker pull foresterre/cargo-msrv
- name: find minimum supported rust version
id: run-msrv
run: |
set -euo pipefail
min_version="$(docker run --rm -t -v "$PWD/":/app/ foresterre/cargo-msrv find --no-log --output-format minimal | tr -d $'\r\n')"
echo "result=$min_version" >> "$GITHUB_OUTPUT"
- name: compare versions
run: |
echo "::notice title=cargo-msrv::$MSRV_VERSION"
echo "::notice title=README.md-msrv::$README_VERSION"
if [[ "$MSRV_VERSION" != "$README_VERSION" ]]; then
echo "::error title=msrv-mismatch::cargo-msrv was $MSRV_VERSION but README.md says rustc >= $README_VERSION"
exit 1
fi
env:
MSRV_VERSION: ${{ steps.run-msrv.outputs.result }}
README_VERSION: ${{ steps.readme-version.outputs.result }}
1 change: 1 addition & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
echo "::error file=$file_path,title=git-status::<$status_code> $file_path"
done <<<"$(git status --porcelain)"
exit "$exit_code"

check:
runs-on: ubuntu-latest
needs: build
Expand Down
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Any of these will work:

1. ```shell
cargo install --git https://github.com/yshavit/mdq
```
2. ```shell
brew install mdq
```
Expand Down Expand Up @@ -179,3 +180,15 @@ cat oncall.md | mdq ':-: * :-: 2024-01-15'
|:----------:|:-----:|:---:|:---:|----:|
| 2024-01-15 | | | x | |
```

# Development

Requires rustc >= 1.20.0

```bash
cargo build
```

```bash
cargo test
```
Loading