Add GitHub Actions CI for backend and frontend#2
Conversation
Co-authored-by: mangod12 <140415797+mangod12@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR adds GitHub Actions CI/CD workflows to validate backend Python syntax and frontend build integrity on push and pull requests. The implementation addresses the "CI/CD Pipeline" item mentioned in the project's technical debt section (README.md:299).
Changes:
- Added
.github/workflows/ci.ymlwith parallel backend (Python 3.12 syntax validation via py_compile, optional pytest) and frontend (Node 20 build verification) jobs - Added CI status badge to README.md header
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
.github/workflows/ci.yml |
New CI workflow with backend Python compilation checks and frontend build validation, includes caching for pip and node_modules |
README.md |
Added CI status badge linking to workflow runs |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| uses: actions/cache@v4 | ||
| with: | ||
| path: skydash/frontend/node_modules | ||
| key: ${{ runner.os }}-node-${{ hashFiles('skydash/frontend/package-lock.json', 'skydash/frontend/package.json') }} |
There was a problem hiding this comment.
The cache key includes 'package-lock.json', but this file does not exist in the repository. The cache key will fail to generate a hash for the missing file. Consider either generating a package-lock.json file by running 'npm install' locally and committing it, or update the cache key to only use 'package.json'. Using package-lock.json is recommended for reproducible builds.
| key: ${{ runner.os }}-node-${{ hashFiles('skydash/frontend/package-lock.json', 'skydash/frontend/package.json') }} | |
| key: ${{ runner.os }}-node-${{ hashFiles('skydash/frontend/package.json') }} |
|
|
||
| - name: Cache node_modules | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: skydash/frontend/node_modules | ||
| key: ${{ runner.os }}-node-${{ hashFiles('skydash/frontend/package-lock.json', 'skydash/frontend/package.json') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-node- | ||
|
|
There was a problem hiding this comment.
The setup-node action (v4) has built-in caching support when you specify the 'cache' parameter. This manual cache action is redundant and can be removed. Instead, add 'cache: npm' to the setup-node step and specify 'cache-dependency-path: skydash/frontend/package-lock.json' (or just package.json if package-lock.json doesn't exist). This simplifies the workflow and follows GitHub Actions best practices.
| - name: Cache node_modules | |
| uses: actions/cache@v4 | |
| with: | |
| path: skydash/frontend/node_modules | |
| key: ${{ runner.os }}-node-${{ hashFiles('skydash/frontend/package-lock.json', 'skydash/frontend/package.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-node- | |
| cache: npm | |
| cache-dependency-path: skydash/frontend/package-lock.json |
No CI existed to validate backend syntax or frontend build integrity on push/PR.
Changes
.github/workflows/ci.yml— two parallel jobs:backend/requirements.txt,py_compilevalidation of all.pyfiles, optionalpytestif tests directory is presentnode_modulescache keyed onpackage-lock.json+package.json,npm install,npm run build— fails job on build errorpermissions: contents: readto minimizeGITHUB_TOKENscopeREADME.md— CI status badge added to the header badge row.💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.