feat: editor config path placeholder #224
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: CI Check | |
| on: | |
| push: | |
| branches: | |
| - fix/** | |
| - feat/** | |
| - docs/** | |
| - chore/** | |
| pull_request: | |
| branches: | |
| - main | |
| concurrency: | |
| group: ci-${{ github.head_ref || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| ci-check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Validate commit message | |
| env: | |
| EVENT_NAME: ${{ github.event_name }} | |
| PR_SHA: ${{ github.event.pull_request.head.sha }} | |
| PUSH_SHA: ${{ github.sha }} | |
| run: | | |
| if [ "$EVENT_NAME" = "pull_request" ]; then | |
| SHA="$PR_SHA" | |
| else | |
| SHA="$PUSH_SHA" | |
| fi | |
| MSG=$(git log -1 --pretty=%s "$SHA") | |
| echo "Commit message: $MSG" | |
| if echo "$MSG" | grep -qE '^(Merge |[0-9]+\.[0-9]+\.[0-9]+$)'; then | |
| echo "Skip: merge commit or version commit" | |
| exit 0 | |
| fi | |
| if echo "$MSG" | grep -qE '^(fix|chore|docs|feat): .+$'; then | |
| echo "Valid commit message" | |
| else | |
| echo "::error::Invalid commit message: must be prefixed by fix:, chore:, docs: or feat:" | |
| exit 1 | |
| fi | |
| - name: Setup Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt, clippy | |
| - name: Cache Cargo | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| save-if: "true" | |
| - name: Check formatting | |
| run: cargo fmt --all -- --check | |
| - name: Run tests | |
| run: cargo test | |
| - name: Run clippy | |
| run: cargo clippy --all-targets --all-features -- -D warnings | |
| - name: Install cargo-audit | |
| uses: taiki-e/install-action@cargo-audit | |
| - name: Audit dependencies | |
| run: cargo audit |