Add GitHub Actions workflow for Node.js with Webpack#98
Add GitHub Actions workflow for Node.js with Webpack#98zubinqayam wants to merge 1 commit intoperplexityai:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new GitHub Actions workflow intended to build the project on pushes and PRs to main using a Node.js version matrix.
Changes:
- Introduces
.github/workflows/webpack.ymlto run a CI build job onubuntu-latest - Configures a Node.js matrix (18.x, 20.x, 22.x)
- Installs dependencies and runs a Webpack build command
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Use Node.js ${{ matrix.node-version }} | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ matrix.node-version }} | ||
|
|
||
| - name: Build | ||
| run: | | ||
| npm install | ||
| npx webpack |
There was a problem hiding this comment.
steps: is defined, but the list items below it are not indented under the steps key (the - uses: lines are aligned with steps:). This makes the YAML invalid and the workflow will fail to parse. Indent all step entries so the - items are nested under steps: (matching the indentation style used in .github/workflows/test.yml:12-27).
| - uses: actions/checkout@v4 | |
| - name: Use Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| - name: Build | |
| run: | | |
| npm install | |
| npx webpack | |
| - uses: actions/checkout@v4 | |
| - name: Use Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| - name: Build | |
| run: | | |
| npm install | |
| npx webpack |
| - name: Build | ||
| run: | | ||
| npm install | ||
| npx webpack |
There was a problem hiding this comment.
The build step runs npx webpack, but this repository doesn't appear to include Webpack (no webpack dependency in package.json and no webpack config file found). As-is, the workflow will fail at runtime. Either add/configure Webpack as part of this PR, or change the workflow to run the project's existing build script (e.g., npm run build).
|
|
||
| - name: Build | ||
| run: | | ||
| npm install |
There was a problem hiding this comment.
This workflow uses npm install even though the repo has a package-lock.json. For CI builds, npm ci is deterministic and typically faster, and it matches existing CI usage in .github/workflows/test.yml:21-22. Consider switching to npm ci here as well to avoid lockfile drift and non-reproducible installs.
| npm install | |
| npm ci |
No description provided.