Skip to content
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
52 changes: 52 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: build

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

env:
CARGO_TERM_COLOR: always

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: actions-rs/toolchain@v1
with:
toolchain: stable

- name: Cache cargo dir
uses: actions/cache@v4
env:
cache-name: cache-cargo-dir
with:
path: ~/.cargo
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-

- name: Cache target dir
uses: actions/cache@v4
env:
cache-name: cache-target-dir
with:
path: ./target
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-

- run: cargo install cargo-readme
- run: ./readme.sh check
- run: cargo fmt --check
# todo: fix clippy lints and run `clippy -- -Dwarnings` instead of cargo check
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will need a pinned Rust toolchain for that

- run: cargo check
14 changes: 13 additions & 1 deletion readme.sh
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
cargo readme --no-indent-headings > README.md

CHECK="${1:-}"
if [[ "$CHECK" == "check" ]]; then
echo "checking README.md..."
cargo readme --no-indent-headings > _tmp_readme.md
cmp README.md _tmp_readme.md
rc=$?
rm -f _tmp_readme.md
exit $rc
else
echo "generating README.md..."
cargo readme --no-indent-headings > README.md
fi
Loading