Skip to content

ci: add CI workflow for lint, typecheck and tests#35

Merged
phmatray merged 1 commit into
mainfrom
ci/add-ci-workflow
Feb 28, 2026
Merged

ci: add CI workflow for lint, typecheck and tests#35
phmatray merged 1 commit into
mainfrom
ci/add-ci-workflow

Conversation

@phmatray
Copy link
Copy Markdown
Contributor

Summary

  • Add .github/workflows/ci.yml with lint (Biome), typecheck (tsc), frontend tests (Vitest), Rust clippy, and Rust tests
  • Runs on push/PR to main with concurrency group to cancel stale runs
  • Installs Linux dependencies for Tauri builds, caches Rust artifacts

Conventions

Part of org-wide CI/CD standardization effort.

Comment thread .github/workflows/ci.yml
Comment on lines +15 to +58
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

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI 3 months ago

In general, the fix is to add an explicit permissions: block that restricts the GITHUB_TOKEN to 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: read is 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.yml and insert a permissions: block right after the name: CI line (line 1). The block should be:

permissions:
  contents: read

This will ensure the GITHUB_TOKEN is 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.

Suggested changeset 1
.github/workflows/ci.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -1,4 +1,6 @@
 name: CI
+permissions:
+  contents: read
 
 on:
   push:
EOF
@@ -1,4 +1,6 @@
name: CI
permissions:
contents: read

on:
push:
Copilot is powered by AI and may make mistakes. Always verify output.
@phmatray phmatray merged commit 8ae580b into main Feb 28, 2026
4 of 5 checks passed
@phmatray phmatray deleted the ci/add-ci-workflow branch March 9, 2026 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants