ci: bump crate-ci/typos from 1.28.3 to 1.29.3 #862
Workflow file for this run
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, pull_request] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
skip_check: | |
runs-on: ubuntu-latest | |
outputs: | |
should_skip: ${{ steps.skip_check.outputs.should_skip }} | |
steps: | |
- id: skip_check | |
uses: fkirc/skip-duplicate-actions@v5 | |
with: | |
concurrent_skipping: "same_content_newer" | |
skip_after_successful_duplicate: "true" | |
commitlint: | |
needs: skip_check | |
if: needs.skip_check.outputs.should_skip != 'true' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install NodeJS | |
uses: actions/setup-node@v4 | |
with: | |
cache: "npm" | |
- name: Install commitlint | |
run: | | |
npm install conventional-changelog-conventionalcommits | |
npm install commitlint@latest | |
- name: Versions | |
run: | | |
git --version | |
node --version | |
npm --version | |
npx commitlint --version | |
- name: Validate current commit (last commit) with commitlint | |
if: github.event_name == 'push' | |
run: npx commitlint --from HEAD~1 --to HEAD --verbose | |
- name: Validate PR commits with commitlint | |
if: github.event_name == 'pull_request' | |
run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose | |
- name: README IF FAILED | |
if: failure() | |
run: echo 'Your commit message(s) does not conform to convention. See https://github.com/smve-rs/smve/blob/master/CONTRIBUTING.md#commits for more information.' | |
clippy_skip_check: | |
needs: commitlint | |
runs-on: ubuntu-latest | |
outputs: | |
should_skip: ${{ steps.skip_check.outputs.should_skip }} | |
steps: | |
- id: skip_check | |
uses: fkirc/skip-duplicate-actions@v5 | |
with: | |
paths: '["**/Cargo.lock", "**/Cargo.toml", "**/*.rs"]' | |
clippy: | |
needs: clippy_skip_check | |
if: needs.clippy_skip_check.outputs.should_skip != 'true' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-rust-clippy-${{ hashFiles('**/Cargo.toml') }} | |
restore-keys: ${{ runner.os }}-rust- | |
- uses: dtolnay/rust-toolchain@nightly | |
with: | |
components: clippy | |
- run: cargo clippy --workspace -- -Dwarnings | |
- name: README IF FAILED | |
if: failure() | |
run: echo "Please fix clippy's suggestions with cargo clippy --workspace --fix" | |
docs_skip_check: | |
needs: commitlint | |
runs-on: ubuntu-latest | |
outputs: | |
should_skip: ${{ steps.skip_check.outputs.should_skip }} | |
steps: | |
- id: skip_check | |
uses: fkirc/skip-duplicate-actions@v5 | |
with: | |
paths: '["**/*.rs"]' | |
docs: | |
needs: docs_skip_check | |
if: needs.docs_skip_check.outputs.should_skip != 'true' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-rust-docs-${{ hashFiles('**/Cargo.toml') }} | |
restore-keys: ${{ runner.os }}-rust- | |
- name: Cargo doc | |
run: cargo doc --no-deps | |
- name: Upload docs | |
uses: actions/[email protected] | |
with: | |
name: Docs | |
path: target/doc/**/* | |
- name: README IF FAILED | |
if: failure() | |
run: echo 'Docs failed to build. Please fix the errors.' | |
test_skip_check: | |
needs: commitlint | |
runs-on: ubuntu-latest | |
outputs: | |
should_skip: ${{ steps.skip_check.outputs.should_skip }} | |
steps: | |
- id: skip_check | |
uses: fkirc/skip-duplicate-actions@v5 | |
with: | |
paths: '["**/Cargo.lock", "**/Cargo.toml", "**/*.rs"]' | |
test: | |
needs: test_skip_check | |
if: needs.test_skip_check.outputs.should_skip != 'true' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-rust-test-${{ hashFiles('**/Cargo.toml') }} | |
restore-keys: ${{ runner.os }}-rust- | |
- uses: dtolnay/rust-toolchain@nightly | |
- run: cargo t --workspace | |
# build: | |
# needs: clippy | |
# strategy: | |
# fail-fast: false | |
# matrix: | |
# os: ["windows", "macos", "ubuntu"] | |
# configuration: ["debug", "release"] | |
# runs-on: ${{ matrix.os }}-latest | |
# steps: | |
# - uses: actions/cache@v4 | |
# with: | |
# path: | | |
# ~/.cargo/bin/ | |
# ~/.cargo/registry/index/ | |
# ~/.cargo/registry/cache/ | |
# ~/.cargo/git/db/ | |
# target/ | |
# key: ${{ runner.os }}-rust-build-${{ hashFiles('**/Cargo.toml') }} | |
# restore-keys: ${{ runner.os }}-rust- | |
# - uses: dtolnay/rust-toolchain@nightly | |
# - name: Install LLD on Windows | |
# if: matrix.os == 'windows' | |
# run: | | |
# cargo install -f cargo-binutils | |
# rustup component add llvm-tools-preview | |
# - name: Install LLD on macOS | |
# if: matrix.os == 'macos' | |
# run: brew install llvm | |
# - name: Install LLD on Ubuntu | |
# if: matrix.os == 'ubuntu' | |
# run: sudo apt-get install lld | |
# - uses: actions/checkout@v4 | |
# - name: Cargo build | |
# run: cargo build --verbose ${{ matrix.configuration == 'release' && '--release' || '' }} | |
# - name: Upload binary | |
# uses: actions/[email protected] | |
# with: | |
# name: smve-${{ matrix.os }}-${{ matrix.configuration }} | |
# path: target/${{ matrix.configuration }}/smve${{ matrix.os == 'windows' && '.exe' || '' }} | |
# - name: README IF FAILED | |
# if: failure() | |
# run: echo 'Build failed for ${{ matrix.os }}-${{ matrix.configuration }}. Please fix the compile errors.' | |
format_skip_check: | |
needs: commitlint | |
runs-on: ubuntu-latest | |
outputs: | |
should_skip: ${{ steps.skip_check.outputs.should_skip }} | |
steps: | |
- id: skip_check | |
uses: fkirc/skip-duplicate-actions@v5 | |
with: | |
paths: '["**/*.rs"]' | |
format: | |
needs: format_skip_check | |
permissions: | |
contents: write | |
pull-requests: write | |
if: needs.format_skip_check.outputs.should_skip != 'true' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-rust-format-${{ hashFiles('**/Cargo.toml') }} | |
restore-keys: ${{ runner.os }}-rust- | |
- uses: dtolnay/rust-toolchain@nightly | |
with: | |
components: rustfmt | |
- run: echo "${HOME}/.cargo/bin" >> $GITHUB_PATH | |
- name: Rust format on commit | |
if: github.event_name == 'push' | |
uses: mbrobbel/rustfmt-check@master | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
commit-message: | | |
style: auto format | |
Automated commit from Github Actions | |
- name: Rust format on pull request | |
if: github.event_name == 'pull_request' | |
uses: mbrobbel/rustfmt-check@master | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
mode: review | |
toml_skip_check: | |
needs: commitlint | |
runs-on: ubuntu-latest | |
outputs: | |
should_skip: ${{ steps.skip_check.outputs.should_skip }} | |
steps: | |
- id: skip_check | |
uses: fkirc/skip-duplicate-actions@v5 | |
with: | |
paths: '["**.toml"]' | |
toml: | |
needs: toml_skip_check | |
if: needs.toml_skip_check.outputs.should_skip != 'true' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install taplo | |
run: | | |
curl -fsSL https://github.com/tamasfe/taplo/releases/latest/download/taplo-full-linux-x86_64.gz \ | |
| gzip -d - \ | |
| install -m 755 /dev/stdin /usr/local/bin/taplo | |
- name: Run Taplo | |
id: taplo | |
run: taplo fmt --check --diff | |
- name: Taplo info | |
if: failure() | |
run: | | |
echo 'To fix toml fmt, please run taplo fmt' | |
echo 'Or if you use VSCode, use the Even Better Toml extension' | |
update_line_of_code: | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/master' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download cloc | |
run: | | |
sudo apt-get update -y && sudo apt-get install -y cloc | |
- name: Count lines of code | |
run: | | |
echo "CODE_LINES=$( ./scripts/cloc.sh --loc)" >> $GITHUB_ENV | |
- name: Create Lines-of-Code-Badge | |
uses: schneegans/[email protected] | |
with: | |
auth: ${{ secrets.CI_GIST_TOKEN }} | |
gistID: a488eb0391a5fc6a2918d13184cd0a26 | |
filename: smve_loc.json | |
label: Lines of Code | |
message: ${{ env.CODE_LINES }} | |
logoColor: cdd6f4 | |
labelColor: 313244 | |
color: 94e2d5 | |
namedLogo: googledocs | |
style: for-the-badge | |
typos: | |
needs: commitlint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Check for typos | |
uses: crate-ci/[email protected] | |
- name: Typos info | |
if: failure() | |
run: | | |
echo 'To fix typos, please run `typos -w`' | |
echo 'To check for a diff, run `typos`' | |
echo 'You can find typos here: https://crates.io/crates/typos' | |
echo 'if you use VSCode, you can also install `Typos Spell Checker' | |
echo 'You can find the extension here: https://marketplace.visualstudio.com/items?itemName=tekumara.typos-vscode' | |
# markdown_lint_skip_check: | |
# needs: commitlint | |
# runs-on: ubuntu-latest | |
# outputs: | |
# should_skip: ${{ steps.skip_check.outputs.should_skip }} | |
# steps: | |
# - id: skip_check | |
# uses: fkirc/skip-duplicate-actions@v5 | |
# with: | |
# paths: '["**.md"]' | |
# | |
# markdown_lint: | |
# needs: markdown_lint_skip_check | |
# if: needs.markdown_lint_skip_check.outputs.should_skip != 'true' | |
# runs-on: ubuntu-latest | |
# | |
# permissions: | |
# contents: read | |
# packages: read | |
# # To report GitHub Actions status checks | |
# statuses: write | |
# | |
# steps: | |
# - name: Checkout code | |
# uses: actions/checkout@v4 | |
# with: | |
# # super-linter needs the full git history to get the | |
# # list of files that changed across commits | |
# fetch-depth: 0 | |
# | |
# - name: Super-linter | |
# uses: super-linter/super-linter/[email protected] # x-release-please-version | |
# env: | |
# MULTI_STATUS: false | |
# VALIDATE_MARKDOWN: true | |
# | |
# - name: README IF FAILED | |
# if: failure() | |
# run: echo 'Please fix the formatting errors in markdown files as suggested.' |