feat: module example #17
Workflow file for this run
This file contains hidden or 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: Pull Request | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| - "releases/*" | |
| # Cancel in-progress workflow runs if a newer run for the same PR is triggered | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| code-quality: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: true | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| depth: 0 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: "22" | |
| - name: Install commitlint and conventional config | |
| run: | | |
| npm install -g @commitlint/cli @commitlint/config-conventional | |
| - name: Commitlint check for commits | |
| run: | | |
| git fetch origin main | |
| git log origin/main..HEAD --pretty=format:%H | xargs -I {} sh -c 'git show --quiet --format=%B {} | commitlint' | |
| - name: Format check | |
| run: cargo fmt -- --check | |
| - name: Install cspell | |
| run: | | |
| npm install -g [email protected] | |
| npm install -g @cspell/dict-de-de | |
| - name: Run cspell | |
| run: cspell "**/*" --config cspell.json --quiet | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: true | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install rust toolchain | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: stable | |
| components: rustfmt, clippy | |
| - name: Run Clippy | |
| run: cargo clippy --all-targets --all -- --allow=unknown-lints --deny=warnings | |
| - name: Cargo audit | |
| run: cargo install cargo-audit && cargo audit | |
| - name: Cache Cargo registry | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo- | |
| - name: Build | |
| run: cargo build --release | |
| - name: Run tests | |
| run: cargo test --verbose |