|
| 1 | +name: Dev checks |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + types: [opened, synchronize, reopened, ready_for_review] |
| 6 | + paths-ignore: |
| 7 | + - "assets/**" |
| 8 | + - "**.md" |
| 9 | + - ".gitignore" |
| 10 | + - "docker/**" |
| 11 | + push: |
| 12 | + branches: |
| 13 | + - main |
| 14 | + paths-ignore: |
| 15 | + - "assets/**" |
| 16 | + - "**.md" |
| 17 | + - ".gitignore" |
| 18 | + - "docker/**" |
| 19 | + workflow_dispatch: |
| 20 | + |
| 21 | +concurrency: |
| 22 | + group: dev-checks-${{ github.event_name }}-${{ github.ref }} |
| 23 | + cancel-in-progress: true |
| 24 | + |
| 25 | +jobs: |
| 26 | + commit-check: |
| 27 | + runs-on: ubuntu-22.04 |
| 28 | + if: ${{ github.event_name == 'push' }} |
| 29 | + timeout-minutes: 5 |
| 30 | + steps: |
| 31 | + - name: Check Commit Type |
| 32 | + uses: gsactions/commit-message-checker@v2 |
| 33 | + with: |
| 34 | + pattern: '^(feat|fix|docs|style|refactor|chore|perf|test|build|ci|revert)(\(\S+\))?: .+' |
| 35 | + error: "Invalid commit type" |
| 36 | + excludeDescription: "true" |
| 37 | + excludeTitle: "false" |
| 38 | + checkAllCommitMessages: "true" |
| 39 | + accessToken: ${{ secrets.GITHUB_TOKEN }} |
| 40 | + |
| 41 | + - name: Check Commit Message |
| 42 | + uses: gsactions/commit-message-checker@v2 |
| 43 | + with: |
| 44 | + pattern: '^.+: [^A-Z].+[^\.](\n.*)*$' |
| 45 | + error: 'Invalid commit message: first letter capitalized, less than 3 letter, end with "."' |
| 46 | + excludeDescription: "true" |
| 47 | + excludeTitle: "true" |
| 48 | + checkAllCommitMessages: "true" |
| 49 | + accessToken: ${{ secrets.GITHUB_TOKEN }} |
| 50 | + |
| 51 | + format-check: |
| 52 | + runs-on: ubuntu-22.04 |
| 53 | + timeout-minutes: 5 |
| 54 | + container: |
| 55 | + image: ghcr.io/${{ github.repository }}/runner:latest |
| 56 | + steps: |
| 57 | + - run: git config --global --add safe.directory '*' |
| 58 | + - uses: actions/checkout@v4 |
| 59 | + - name: Check Go format |
| 60 | + working-directory: go |
| 61 | + run: | |
| 62 | + if [ -n "$(gofmt -d .)" ]; then |
| 63 | + echo "Formatting issues found. Please run gofmt." |
| 64 | + exit 1 |
| 65 | + fi |
| 66 | + - name: Check Python format |
| 67 | + working-directory: python |
| 68 | + run: | |
| 69 | + black --check . |
| 70 | + - name: Check Rust format |
| 71 | + working-directory: rust |
| 72 | + run: | |
| 73 | + cargo fmt --check 2>/dev/null |
| 74 | +
|
| 75 | + typo-check: |
| 76 | + runs-on: ubuntu-22.04 |
| 77 | + container: |
| 78 | + image: ghcr.io/${{ github.repository }}/runner:latest |
| 79 | + timeout-minutes: 5 |
| 80 | + steps: |
| 81 | + - run: git config --global --add safe.directory '*' |
| 82 | + - uses: actions/checkout@v4 |
| 83 | + - uses: crate-ci/typos@master |
| 84 | + |
| 85 | + deny-check: |
| 86 | + runs-on: ubuntu-22.04 |
| 87 | + timeout-minutes: 5 |
| 88 | + steps: |
| 89 | + - run: git config --global --add safe.directory '*' |
| 90 | + - uses: actions/checkout@v4 |
| 91 | + - run: cd rust |
| 92 | + - uses: EmbarkStudios/cargo-deny-action@v1 |
| 93 | + with: |
| 94 | + manifest-path: rust/Cargo.toml |
| 95 | + arguments: --all-features |
| 96 | + command: check licenses sources bans |
| 97 | + |
| 98 | + toml-check: |
| 99 | + runs-on: ubuntu-22.04 |
| 100 | + timeout-minutes: 10 |
| 101 | + container: |
| 102 | + image: ghcr.io/${{ github.repository }}/runner:latest |
| 103 | + steps: |
| 104 | + - run: git config --global --add safe.directory '*' |
| 105 | + - uses: actions/checkout@v4 |
| 106 | + - run: taplo format --check --diff |
| 107 | + |
| 108 | + clippy-check: |
| 109 | + runs-on: |
| 110 | + group: github-amd64-8c32g |
| 111 | + timeout-minutes: 15 |
| 112 | + container: |
| 113 | + image: ghcr.io/${{ github.repository }}/runner:latest |
| 114 | + steps: |
| 115 | + - run: git config --global --add safe.directory '*' |
| 116 | + - uses: actions/checkout@v4 |
| 117 | + - run: ls |
| 118 | + - run: pwd |
| 119 | + - run: rustup toolchain list |
| 120 | + - working-directory: rust |
| 121 | + run: cargo clippy --workspace --all-targets --all-features -- -D warnings |
0 commit comments