-
Notifications
You must be signed in to change notification settings - Fork 0
ci: add GitHub Actions workflow with split lint/type/build/test jobs #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
349537b
ci: add GitHub Actions workflow with split lint/type/build/test jobs
claude 7948ba4
fix: resolve all CI failures from initial run
claude 7293995
fix(rust): resolve clippy warnings exposed by CI
claude 351b1fc
ci: address PR review feedback
claude 74e2eff
fix: address CodeRabbit review feedback (round 2)
claude File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,221 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| pull_request: | ||
| push: | ||
| branches: [main] | ||
| workflow_dispatch: | ||
|
|
||
| concurrency: | ||
| group: ci-${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | ||
|
|
||
| env: | ||
| NODE_VERSION: "20" | ||
| PYTHON_VERSION: "3.12" | ||
| RUST_TOOLCHAIN: "stable" | ||
|
|
||
| jobs: | ||
| # ---------- Lint ---------- | ||
| lint-ts: | ||
| name: Lint (TypeScript) | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ env.NODE_VERSION }} | ||
| cache: npm | ||
| - run: npm ci | ||
| - run: npm run lint | ||
| - run: npx prettier --check "src/**/*.{ts,tsx,css,json}" | ||
|
|
||
| lint-rust: | ||
| name: Lint (Rust) | ||
| runs-on: ubuntu-latest | ||
| defaults: | ||
| run: | ||
| working-directory: src-tauri | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: dtolnay/rust-toolchain@stable | ||
| with: | ||
| components: rustfmt, clippy | ||
| - uses: Swatinem/rust-cache@v2 | ||
| with: | ||
| workspaces: src-tauri | ||
| - name: Install Tauri system deps | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y \ | ||
| libwebkit2gtk-4.1-dev \ | ||
| libappindicator3-dev \ | ||
| librsvg2-dev \ | ||
| patchelf \ | ||
| libgtk-3-dev \ | ||
| libsoup-3.0-dev \ | ||
| libjavascriptcoregtk-4.1-dev | ||
| - run: cargo fmt --all -- --check | ||
| - run: cargo clippy --all-targets -- -D warnings | ||
|
|
||
| lint-python: | ||
| name: Lint (Python) | ||
| runs-on: ubuntu-latest | ||
| defaults: | ||
| run: | ||
| working-directory: python | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: astral-sh/setup-uv@v3 | ||
| with: | ||
| enable-cache: true | ||
| cache-dependency-glob: python/uv.lock | ||
| - run: uv sync --extra dev | ||
| - run: uv run ruff check . | ||
| - run: uv run black --check . | ||
|
|
||
| # ---------- Type check ---------- | ||
| typecheck-ts: | ||
| name: Typecheck (TypeScript) | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ env.NODE_VERSION }} | ||
| cache: npm | ||
| - run: npm ci | ||
| - run: npx tsc -b | ||
|
|
||
| typecheck-python: | ||
| name: Typecheck (Python) | ||
| runs-on: ubuntu-latest | ||
| defaults: | ||
| run: | ||
| working-directory: python | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: astral-sh/setup-uv@v3 | ||
| with: | ||
| enable-cache: true | ||
| cache-dependency-glob: python/uv.lock | ||
| - run: uv sync --extra dev | ||
| # mortal は torch 依存のため CI では除外 | ||
| - run: uv run mypy recognition common | ||
|
|
||
| # ---------- Build ---------- | ||
| build-web: | ||
| name: Build (Web) | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ env.NODE_VERSION }} | ||
| cache: npm | ||
| - run: npm ci | ||
| - run: npm run build | ||
| - uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: web-dist | ||
| path: dist | ||
| retention-days: 7 | ||
|
|
||
| build-rust-check: | ||
| name: Build (Rust check) | ||
| runs-on: ubuntu-latest | ||
| defaults: | ||
| run: | ||
| working-directory: src-tauri | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: dtolnay/rust-toolchain@stable | ||
| - uses: Swatinem/rust-cache@v2 | ||
| with: | ||
| workspaces: src-tauri | ||
| - name: Install Tauri system deps | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y \ | ||
| libwebkit2gtk-4.1-dev \ | ||
| libappindicator3-dev \ | ||
| librsvg2-dev \ | ||
| patchelf \ | ||
| libgtk-3-dev \ | ||
| libsoup-3.0-dev \ | ||
| libjavascriptcoregtk-4.1-dev | ||
| - run: cargo check --all-targets | ||
|
|
||
| build-tauri: | ||
| name: Build (Tauri Windows bundle) | ||
| # PR では実行しない (cargo check で代替)。main push か手動のみ。 | ||
| # tauri.conf.json の bundle.targets が ["msi","nsis"] (Windows 専用) のため | ||
| # 現状は Windows だけビルドする。macOS/Linux 配布が必要になったら matrix 化する。 | ||
| if: github.event_name != 'pull_request' | ||
| needs: [build-web, build-rust-check] | ||
| runs-on: windows-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ env.NODE_VERSION }} | ||
| cache: npm | ||
| - uses: dtolnay/rust-toolchain@stable | ||
| - uses: Swatinem/rust-cache@v2 | ||
| with: | ||
| workspaces: src-tauri | ||
| - run: npm ci | ||
| - run: npm run tauri:build | ||
|
|
||
| # ---------- Test ---------- | ||
| test-ts: | ||
| name: Test (TypeScript / Vitest) | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ env.NODE_VERSION }} | ||
| cache: npm | ||
| - run: npm ci | ||
| - run: npm test | ||
|
|
||
| test-rust: | ||
| name: Test (Rust / cargo test) | ||
| runs-on: ubuntu-latest | ||
| defaults: | ||
| run: | ||
| working-directory: src-tauri | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: dtolnay/rust-toolchain@stable | ||
| - uses: Swatinem/rust-cache@v2 | ||
| with: | ||
| workspaces: src-tauri | ||
| - name: Install Tauri system deps | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y \ | ||
| libwebkit2gtk-4.1-dev \ | ||
| libappindicator3-dev \ | ||
| librsvg2-dev \ | ||
| patchelf \ | ||
| libgtk-3-dev \ | ||
| libsoup-3.0-dev \ | ||
| libjavascriptcoregtk-4.1-dev | ||
| - run: cargo test --all-targets | ||
|
|
||
| test-python: | ||
| name: Test (Python / pytest) | ||
| runs-on: ubuntu-latest | ||
| defaults: | ||
| run: | ||
| working-directory: python | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: astral-sh/setup-uv@v3 | ||
| with: | ||
| enable-cache: true | ||
| cache-dependency-glob: python/uv.lock | ||
| - run: uv sync --extra dev | ||
| - run: uv run pytest -q | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,6 +25,7 @@ dist-ssr/ | |
| .parcel-cache/ | ||
| .turbo/ | ||
| *.local | ||
| *.tsbuildinfo | ||
|
|
||
| # Testing | ||
| coverage/ | ||
|
|
||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| import js from "@eslint/js"; | ||
| import globals from "globals"; | ||
| import tseslint from "typescript-eslint"; | ||
| import reactHooks from "eslint-plugin-react-hooks"; | ||
| import reactRefresh from "eslint-plugin-react-refresh"; | ||
|
|
||
| export default tseslint.config( | ||
| { | ||
| ignores: [ | ||
| "dist", | ||
| "src-tauri/target", | ||
| "node_modules", | ||
| "vite.config.ts", | ||
| "eslint.config.js", | ||
| "scripts", | ||
| ], | ||
| }, | ||
| js.configs.recommended, | ||
| ...tseslint.configs.recommended, | ||
| { | ||
| files: ["src/**/*.{ts,tsx}"], | ||
| languageOptions: { | ||
| ecmaVersion: 2022, | ||
| sourceType: "module", | ||
| globals: { | ||
| ...globals.browser, | ||
| ...globals.node, | ||
| }, | ||
| parserOptions: { | ||
| project: "./tsconfig.json", | ||
| tsconfigRootDir: import.meta.dirname, | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| }, | ||
| }, | ||
| plugins: { | ||
| "react-hooks": reactHooks, | ||
| "react-refresh": reactRefresh, | ||
| }, | ||
| rules: { | ||
| ...reactHooks.configs.recommended.rules, | ||
| "react-refresh/only-export-components": [ | ||
| "warn", | ||
| { allowConstantExport: true }, | ||
| ], | ||
| "@typescript-eslint/no-unused-vars": [ | ||
| "warn", | ||
| { argsIgnorePattern: "^_" }, | ||
| ], | ||
| }, | ||
| }, | ||
| ); | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: otomatty/jantama-ai
Length of output: 1191
uses:ステートメントを commit SHA にピン留めしてください21 個の
uses:ステートメント(actions/checkout@v4、dtolnay/rust-toolchain@stableなど)がバージョンタグで参照されており、上流の予期しない変更に影響を受けるリスクがあります。再現性と改ざん耐性のため、commit SHA へピン留めしてください。Dependabot のgithub-actionsで定期的な更新推奨です。修正例
🧰 Tools
🪛 YAMLlint (1.38.0)
[error] 158-158: too many spaces inside braces
(braces)
[error] 158-158: too many spaces inside braces
(braces)
[error] 159-159: too many spaces inside braces
(braces)
[error] 159-159: too many spaces inside braces
(braces)
[error] 160-160: too many spaces inside braces
(braces)
[error] 160-160: too many spaces inside braces
(braces)
🤖 Prompt for AI Agents