Skip to content

Fix/ci workflow#463

Closed
Harxhit wants to merge 12 commits into
Dev-Card:mainfrom
Harxhit:fix/ci-workflow
Closed

Fix/ci workflow#463
Harxhit wants to merge 12 commits into
Dev-Card:mainfrom
Harxhit:fix/ci-workflow

Conversation

@Harxhit
Copy link
Copy Markdown
Collaborator

@Harxhit Harxhit commented Jun 3, 2026

Summary

Runs targeted checks only on files changed in a pull request — nothing untouched is re-tested.

Workflow

pull_request_target (opened / synchronize / reopened)
│
▼
detect-changes          ← reads PR file list via GitHub API
┌──────────────────────────────────────────────┐
│ Categorises changed files into               │
│   apps/backend  apps/mobile  apps/web        │
│ Derives test file paths from source files    │
└──────────────────────────────────────────────┘
│
┌─────┼─────┐
▼     ▼     ▼
backend  web  mobile        ← run only if their files changed
└─────┼─────┘
▼
comment-results         ← always runs, posts/updates a PR comment

Jobs

detect-changes

Calls .github/scripts/ciScript.js via actions/github-script.

Outputs:

Output Description
backendChanged true if any apps/backend file changed
mobileChanged true if any apps/mobile file changed
webChanged true if any apps/web file changed
backendFiles Space-separated list of changed backend files (stripped of apps/backend/ prefix)
mobileFiles Same for mobile
webFiles Same for web
backendTestFiles Derived test file paths for changed backend files
mobileTestFiles Derived test file paths for changed mobile files

backend-ci

Runs when backendChanged == 'true'.

Step Command Notes
Lint pnpm eslint <changed files> Runs only on changed files
Test pnpm test --passWithNoTests <derived test files> Skips silently if no tests exist
Typecheck pnpm typecheck Always runs against full tsconfig

web-ci

Runs when webChanged == 'true'.

Step Command
Check pnpm check
Build pnpm build

mobile-ci

Runs when mobileChanged == 'true'.

Step Command Notes
Lint pnpm eslint <changed files> Runs only on changed files
Test pnpm test --passWithNoTests <derived test files> Skips silently if no tests exist

comment-results

Always runs. Posts or updates a single comment on the PR with a results table.
If lint failed, a collapsible block shows the exact file paths and error messages.

Scripts

ciScript.js

Reads the PR's changed files from the GitHub API and categorises them by app.

Test file derivation:
For each changed source file src/routes/cards.ts it looks for a corresponding test at src/__tests__/cards.test.ts. If the changed file is already a test file it is used as-is. No filesystem access — path is derived by convention.

commentResults.js

Builds and posts (or updates) the CI results comment. Accepts per-job and per-step
statuses plus raw lint output. Lint errors are shown in a collapsible block so the
comment stays readable when there are no failures.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 3, 2026

CI Results — ✅ CI completed

🖥️ Backend (⏭️ skipped)

Check Status
Lint ⚪ unknown
Test ⚪ unknown
Typecheck ⚪ unknown

📱 Mobile (⏭️ skipped)

Check Status
Lint ⚪ unknown
Test ⚪ unknown

🌐 Web (⏭️ skipped)

Check Status
Check ⚪ unknown
Build ⚪ unknown

🕐 Last updated: Wed, 03 Jun 2026 10:51:21 GMT

@Harxhit Harxhit closed this Jun 3, 2026
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.

1 participant