chore: add rust CI and pre-commit checks (#396)

* chore: add rust CI and pre-commit checks

- Rename Justfile → justfile for Linux case sensitivity
- Add cargo check pre-commit hooks for moderation + transcoder
- Add check-rust.yml CI workflow (cargo check + docker build on PRs)
- Include moderation/static/** in deploy trigger paths

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: correct rust-toolchain action name

---------

Co-authored-by: Claude <noreply@anthropic.com>

authored by zzstoatzz.io Claude and committed by GitHub ec39e0be 4486cff9

Changed files
+68
.github
moderation
transcoder
+53
.github/workflows/check-rust.yml
···
··· 1 + name: check rust services 2 + 3 + on: 4 + pull_request: 5 + paths: 6 + - "moderation/**" 7 + - "transcoder/**" 8 + - ".github/workflows/check-rust.yml" 9 + 10 + permissions: 11 + contents: read 12 + 13 + jobs: 14 + check: 15 + name: cargo check 16 + runs-on: ubuntu-latest 17 + timeout-minutes: 15 18 + 19 + strategy: 20 + matrix: 21 + service: [moderation, transcoder] 22 + 23 + steps: 24 + - uses: actions/checkout@v4 25 + 26 + - name: install rust toolchain 27 + uses: dtolnay/rust-toolchain@stable 28 + 29 + - name: cache cargo 30 + uses: Swatinem/rust-cache@v2 31 + with: 32 + workspaces: ${{ matrix.service }} 33 + 34 + - name: cargo check 35 + working-directory: ${{ matrix.service }} 36 + run: cargo check --release 37 + 38 + docker-build: 39 + name: docker build 40 + runs-on: ubuntu-latest 41 + timeout-minutes: 10 42 + needs: check 43 + 44 + strategy: 45 + matrix: 46 + service: [moderation, transcoder] 47 + 48 + steps: 49 + - uses: actions/checkout@v4 50 + 51 + - name: build docker image 52 + working-directory: ${{ matrix.service }} 53 + run: docker build -t ${{ matrix.service }}:ci-test .
+1
.github/workflows/deploy-moderation.yml
··· 6 - main 7 paths: 8 - "moderation/src/**" 9 - "moderation/Cargo.toml" 10 - "moderation/Cargo.lock" 11 - "moderation/Dockerfile"
··· 6 - main 7 paths: 8 - "moderation/src/**" 9 + - "moderation/static/**" 10 - "moderation/Cargo.toml" 11 - "moderation/Cargo.lock" 12 - "moderation/Dockerfile"
+14
.pre-commit-config.yaml
··· 43 files: ^frontend/.*\.(ts|svelte)$ 44 pass_filenames: false 45 46 - repo: https://github.com/pre-commit/pre-commit-hooks 47 rev: v6.0.0 48 hooks:
··· 43 files: ^frontend/.*\.(ts|svelte)$ 44 pass_filenames: false 45 46 + - id: cargo-check-moderation 47 + name: cargo check (moderation) 48 + entry: bash -c 'cd moderation && cargo check --quiet' 49 + language: system 50 + files: ^moderation/.*\.rs$ 51 + pass_filenames: false 52 + 53 + - id: cargo-check-transcoder 54 + name: cargo check (transcoder) 55 + entry: bash -c 'cd transcoder && cargo check --quiet' 56 + language: system 57 + files: ^transcoder/.*\.rs$ 58 + pass_filenames: false 59 + 60 - repo: https://github.com/pre-commit/pre-commit-hooks 61 rev: v6.0.0 62 hooks:
moderation/Justfile moderation/justfile
transcoder/Justfile transcoder/justfile