62 lines
1.1 KiB
Markdown
62 lines
1.1 KiB
Markdown
# GitHub Actions Workflows
|
|
|
|
## Angular CI Pipeline
|
|
|
|
### Triggers
|
|
- **Push**: Runs on all branches when changes are made to `ui/` folder
|
|
- **Pull Request**: Runs when PR targets `main` branch
|
|
|
|
### Pipeline Stages
|
|
|
|
1. **Checkout** - Clone repository
|
|
2. **Setup Node.js** - Install Node 20.x with npm cache
|
|
3. **Install Dependencies** - Run `npm ci`
|
|
4. **Type Check** - Run `npx tsc --noEmit`
|
|
5. **Lint** - Run `npm run lint`
|
|
6. **Format Check** - Run `npm run format:check`
|
|
7. **Build Dev** - Build development configuration
|
|
8. **Build Prod** - Build production configuration
|
|
9. **Test** - Run unit tests with coverage
|
|
10. **Upload Artifacts** - Save build outputs and coverage reports
|
|
|
|
|
|
### Local Testing
|
|
|
|
Before pushing, run locally:
|
|
```bash
|
|
cd ui
|
|
npm ci
|
|
npx tsc --noEmit
|
|
npm run lint
|
|
npm run format:check
|
|
npm run build
|
|
```
|
|
|
|
### Troubleshooting
|
|
|
|
**Node version mismatch:**
|
|
```bash
|
|
# Use Node 20.x locally
|
|
nvm use 20
|
|
```
|
|
|
|
**Cache issues:**
|
|
```bash
|
|
# Clear npm cache
|
|
npm cache clean --force
|
|
rm -rf node_modules package-lock.json
|
|
npm install
|
|
```
|
|
|
|
**Lint errors:**
|
|
```bash
|
|
# Auto-fix
|
|
npm run lint -- --fix
|
|
```
|
|
|
|
**Format errors:**
|
|
```bash
|
|
# Auto-format
|
|
npm run format
|
|
```
|