diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index af67860..293ee1c 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -39,8 +39,20 @@ jobs: run: | min_version="$(docker run --rm -t -v "$PWD/":/app/ foresterre/cargo-msrv find --no-log --output-format minimal)" echo "result=$min_version" >> "$GITHUB_OUTPUT" - - name: echo - run: echo ${{ steps.run-msrv.outputs.result }} + - name: find version mentioned in readme + id: readme-version + run: | + readme_version="$(cat README.md | cargo run -- '# Development | P: "Requires rustc >=" ' | awk '{print $NF}')" + echo "result=$readme_version" >> "$GITHUB_OUTPUT" + - name: compare versions + run: | + 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 }} check: runs-on: ubuntu-latest diff --git a/README.md b/README.md index f44fe01..0d23b28 100644 --- a/README.md +++ b/README.md @@ -177,3 +177,15 @@ cat oncall.md | mdq ':-: * :-: 2024-01-15' |:----------:|:-----:|:---:|:---:|----:| | 2024-01-15 | | | x | | ``` + +# Development + +Requires rustc >= 1.20.0 + +```bash +cargo build +``` + +```bash +cargo test +```