Mention rustyscript #65
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
env: | |
CARGO_TERM_COLOR: always | |
CARGO_INCREMENTAL: 0 | |
RUST_BACKTRACE: 1 | |
#concurrency: | |
# group: ${{ github.head_ref }} | |
# cancel-in-progress: true | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: "Initialize cache" | |
uses: Swatinem/rust-cache@v2 | |
- name: "Build" | |
run: cargo build | |
- name: "Run tests" | |
run: cargo test | |
rustfmt: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: "Format code" | |
run: cargo fmt -- --check | |
clippy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: "Check clippy" | |
run: | | |
cargo clippy --all-targets -- \ | |
-D warnings -D clippy::style -D clippy::complexity -D clippy::suspicious -D clippy::dbg_macro -A clippy::tabs_in_doc_comments | |
sync-readme: | |
needs: build-and-test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: "Install cargo-readme" | |
#run: cargo install cargo-readme | |
uses: baptiste0928/cargo-install@v2 | |
with: | |
crate: cargo-readme | |
- name: "Sync js-sandbox/lib.rs with ReadMe.md" | |
id: prepareCommit | |
run: | | |
cd js-sandbox | |
cargo readme --no-license --template ../cfg/ReadMe.in > ../ReadMe.md | |
sed -i $'s/\t/ /g' ../ReadMe.md | |
git diff --exit-code || echo "docsChanged=true" >> $GITHUB_OUTPUT | |
- name: "Commit changes if needed" | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
# If not specified, author is the one of prev commit (but with @users.noreply.github.com) | |
commit_message: "Auto-sync ReadMe.md" | |
#commit_author: "GitHub Actions <[email protected]>" | |
if: ${{ steps.prepareCommit.outputs.docsChanged == 'true' }} |