-
Notifications
You must be signed in to change notification settings - Fork 0
ci: add CI workflow for lint, typecheck and tests #35
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 all commits
Commits
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 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,58 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [main] | ||
|
|
||
| concurrency: | ||
| group: ci-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| lint-and-test: | ||
| runs-on: ubuntu-22.04 | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v6 | ||
| with: | ||
| node-version: lts/* | ||
| cache: npm | ||
|
|
||
| - name: Install Rust stable | ||
| uses: dtolnay/rust-toolchain@stable | ||
| with: | ||
| components: clippy | ||
|
|
||
| - name: Rust cache | ||
| uses: swatinem/rust-cache@v2 | ||
| with: | ||
| workspaces: ./src-tauri -> target | ||
|
|
||
| - name: Install Linux dependencies | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf | ||
|
|
||
| - name: Install frontend dependencies | ||
| run: npm ci | ||
|
|
||
| - name: Biome lint | ||
| run: npx biome check . | ||
|
|
||
| - name: TypeScript check | ||
| run: npx tsc -b --noEmit | ||
|
|
||
| - name: Frontend tests | ||
| run: npx vitest run | ||
|
|
||
| - name: Rust clippy | ||
| working-directory: src-tauri | ||
| run: cargo clippy -- -D warnings | ||
|
|
||
| - name: Rust tests | ||
| working-directory: src-tauri | ||
| run: cargo test | ||
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.
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Copilot Autofix
AI 3 months ago
In general, the fix is to add an explicit
permissions:block that restricts theGITHUB_TOKENto the minimal scopes required. Because this workflow only checks out code and runs local tools (lint, tests, TypeScript, Rust tooling) and does not appear to modify repository contents, create releases, or otherwise need write access,contents: readis a safe minimal baseline. You can define this at the workflow root so it applies to all jobs, or at the job level; here, putting it at the root keeps the file concise and still allows per‑job overrides later if needed.Concretely, edit
.github/workflows/ci.ymland insert apermissions:block right after thename: CIline (line 1). The block should be:This will ensure the
GITHUB_TOKENis limited to read‑only repository contents for all jobs that do not override permissions. No additional imports, methods, or other definitions are required, as this is pure workflow configuration.