This project uses GitHub Actions to automate continuous integration tasks, including building the application, running lint checks, and executing unit tests. The workflow ensures code quality and stability with every commit and pull request.
The GitHub Actions workflow is triggered in two scenarios:
- On every push to any branch (
'**'
matches all branches). - Manually via the Actions tab using the
workflow_dispatch
event.
The workflow defines three jobs:
- Purpose: Install dependencies and build the application.
- Runs on:
ubuntu-latest
. - Steps:
- Checkout the code using
actions/checkout@v3
. - Set up the specified Node.js version (currently
20.x
) usingactions/setup-node@v3
. - Cache
npm
dependencies for faster builds. - Install dependencies with
npm ci
. - Build the project using
npm run build
, if a build script exists.
- Checkout the code using
- Purpose: Check the code for linting issues to ensure consistency and quality.
- Runs on:
ubuntu-latest
. - Steps:
- Checkout the code using
actions/checkout@v3
. - Set up the specified Node.js version (
20.x
) usingactions/setup-node@v3
. - Cache
npm
dependencies. - Run the linting process with
npm run lint
.
- Checkout the code using
- Purpose: Run unit tests to ensure the correctness of the application.
- Runs on:
ubuntu-latest
. - Steps:
- Checkout the code using
actions/checkout@v3
. - Set up the specified Node.js version (
20.x
) usingactions/setup-node@v3
. - Cache
npm
dependencies. - Run unit tests with
npm run test
.
- Checkout the code using
The workflow will automatically run on every push to any branch or can be triggered manually from the Actions tab. You can monitor the status of each job (Build, Lint, and Test) and view detailed logs from the GitHub Actions interface.