-
Notifications
You must be signed in to change notification settings - Fork 0
Add Frontend CI workflow for quality validation #71
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
Open
Copilot
wants to merge
8
commits into
main
Choose a base branch
from
copilot/add-frontend-ci-workflow
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
4c3f2a4
Initial plan
Copilot 98f443d
Add frontend configuration files and basic React app structure
Copilot c0b9e60
Add frontend CI workflow with comprehensive quality checks
Copilot 4b449ce
Update documentation with Frontend CI workflow details
Copilot 5b468b2
Address code review feedback
Copilot 4a5da52
Resolve README conflicts by merging with main branch updates
Copilot 711d725
Fix ESM compatibility and optimize CI workflow
Copilot 312cd0a
Resolve merge conflicts with main branch
Copilot 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,96 @@ | ||
| name: Frontend CI | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: ["main"] | ||
| paths: | ||
| - 'frontend/**' | ||
| - '.github/workflows/frontend-ci.yml' | ||
| push: | ||
| branches: ["main"] | ||
| paths: | ||
| - 'frontend/**' | ||
| - '.github/workflows/frontend-ci.yml' | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| frontend-quality: | ||
| name: Frontend Quality Checks | ||
| runs-on: ubuntu-latest | ||
| defaults: | ||
| run: | ||
| working-directory: frontend | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
| cache: 'npm' | ||
| cache-dependency-path: frontend/package-lock.json | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| if [ -f package-lock.json ]; then | ||
| echo "✓ Using npm ci for reproducible installs" | ||
| npm ci | ||
| else | ||
| echo "⚠ No package-lock.json found, using npm install" | ||
| npm install | ||
| fi | ||
|
|
||
| - name: Run ESLint | ||
| run: npm run lint | ||
|
|
||
| - name: Build application | ||
| run: npm run build | ||
|
|
||
| - name: Run tests with coverage | ||
| run: npm run test:coverage -- --run | ||
|
|
||
| - name: Upload coverage to Codecov | ||
| uses: codecov/codecov-action@b9fd7d16f6d7d1b5d2bec1a2887e65ceed900238 # v4.6.0 | ||
| with: | ||
| files: ./frontend/coverage/lcov.info | ||
| flags: frontend | ||
| name: frontend-coverage | ||
| fail_ci_if_error: false | ||
| continue-on-error: true | ||
|
|
||
| - name: Upload coverage to Codacy | ||
| if: ${{ secrets.CODACY_PROJECT_TOKEN != '' }} | ||
| uses: codacy/codacy-coverage-reporter-action@89d6c85cfafaec52c72b6c5e8b2878d33104c699 # v1.3.0 | ||
| with: | ||
| project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} | ||
| coverage-reports: frontend/coverage/lcov.info | ||
| continue-on-error: true | ||
|
|
||
| summary: | ||
| name: Quality Summary | ||
| runs-on: ubuntu-latest | ||
| needs: frontend-quality | ||
| if: always() | ||
| steps: | ||
| - name: Generate summary | ||
| run: | | ||
| echo "## Frontend CI Results 🚀" >> $GITHUB_STEP_SUMMARY | ||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
| if [ "${{ needs.frontend-quality.result }}" == "success" ]; then | ||
| echo "✅ ESLint passed" >> $GITHUB_STEP_SUMMARY | ||
| echo "✅ TypeScript type checking passed" >> $GITHUB_STEP_SUMMARY | ||
| echo "✅ Build successful" >> $GITHUB_STEP_SUMMARY | ||
| echo "✅ Tests passed" >> $GITHUB_STEP_SUMMARY | ||
| echo "✅ Coverage generated" >> $GITHUB_STEP_SUMMARY | ||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
| echo "All frontend quality checks completed! 🎉" >> $GITHUB_STEP_SUMMARY | ||
| else | ||
| echo "❌ Some quality checks failed" >> $GITHUB_STEP_SUMMARY | ||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
| echo "Please review the logs above for details." >> $GITHUB_STEP_SUMMARY | ||
| fi | ||
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
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.
In other workflows (e.g.
ci.yml), third-party actions like Codecov and Codacy coverage reporter are pinned to a specific commit SHA. Here they’re referenced by floating tags (codecov/codecov-action@v4,codacy/codacy-coverage-reporter-action@v1), which increases supply-chain risk. Consider pinning these to known-good SHAs (optionally with a comment noting the upstream version).