Skip to content

Commit 590622a

Browse files
committed
fix: implement devtooling automation 1014-1017
- #1014: add changelog workflow, tighten commitlint rules, update CHANGELOG.md with conventional commits docs - #1015: enable size-limit regression prevention, update bundle-analysis workflow with alerts and reporting - #1017: add renovate.json dependency automation config, enhance dependabot grouping and labels - #1016: add jest coverage thresholds, create codecov.yml, add coverage workflow with PR comments
1 parent 4a62952 commit 590622a

9 files changed

Lines changed: 428 additions & 22 deletions

File tree

Lines changed: 52 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,62 @@
1-
name: Bundle Size Analysis
1+
name: Bundle Size Monitoring
22

33
on:
4-
workflow_dispatch:
4+
push:
5+
branches: [main, dev, develop]
56
pull_request:
6-
branches: [main]
7+
branches: [main, dev, develop]
8+
workflow_dispatch:
9+
10+
env:
11+
EXPO_NO_TELEMETRY: 1
712

813
jobs:
9-
analyze:
14+
bundle-size:
15+
name: Bundle Size Check & Regression Alert
1016
runs-on: ubuntu-latest
1117
steps:
12-
- uses: actions/checkout@v7
13-
- uses: ./.github/actions/setup-node
18+
- name: Checkout code
19+
uses: actions/checkout@v7
20+
21+
- name: Setup Node.js
22+
uses: actions/setup-node@v7
23+
with:
24+
node-version: ${{ env.NODE_VERSION }}
25+
cache: 'npm'
26+
27+
- name: Install dependencies
28+
run: npm ci --legacy-peer-deps
29+
1430
- name: Install web dependencies
1531
run: npm install react-dom@19.0.0 react-native-web@0.20.0 @expo/metro-runtime@5.0.5 --no-save --legacy-peer-deps
16-
- run: npx expo export --platform web --output-dir dist
17-
continue-on-error: true
18-
- name: Analyze bundle
32+
33+
- name: Build web bundle
34+
run: npx expo export --platform web --output-dir dist
35+
36+
- name: Run size-limit with regression prevention
37+
run: npx size-limit
38+
39+
- name: Generate bundle size report
40+
run: npx size-limit --json > bundle-size-report.json
41+
42+
- name: Comment PR with bundle size changes
43+
if: github.event_name == 'pull_request'
44+
uses: andresz1/size-limit-action@v1
45+
with:
46+
github_token: ${{ secrets.GITHUB_TOKEN }}
47+
build_script: 'build'
48+
49+
- name: Upload bundle size report
50+
if: always()
51+
uses: actions/upload-artifact@v4
52+
with:
53+
name: bundle-size-report-${{ github.sha }}
54+
path: bundle-size-report.json
55+
retention-days: 30
56+
57+
- name: Alert on bundle size regression
58+
if: failure()
1959
run: |
20-
npx size-limit || true
21-
echo "Bundle size analysis complete"
60+
echo "::warning::Bundle size regression detected!"
61+
echo "::error::Bundle size exceeds configured limits. Review the bundle-size-report artifact for details."
62+
exit 1

.github/workflows/changelog.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Changelog & Release Notes
2+
3+
on:
4+
push:
5+
branches: [main, dev, develop]
6+
pull_request:
7+
branches: [main, dev, develop]
8+
workflow_dispatch:
9+
10+
jobs:
11+
changelog:
12+
name: Generate Changelog from Conventional Commits
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v7
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Setup Node.js
21+
uses: actions/setup-node@v7
22+
with:
23+
node-version: 20
24+
cache: 'npm'
25+
26+
- name: Install dependencies
27+
run: npm ci --legacy-peer-deps
28+
29+
- name: Validate conventional commits
30+
if: github.event_name == 'pull_request'
31+
run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.sha }} --verbose
32+
33+
- name: Generate changelog preview
34+
run: |
35+
npx conventional-changelog-cli -p angular -i CHANGELOG.md -s -r 0 || true
36+
echo "Changelog preview generated"
37+
cat CHANGELOG.md || true
38+
39+
- name: Upload changelog preview
40+
if: always()
41+
uses: actions/upload-artifact@v4
42+
with:
43+
name: changelog-preview
44+
path: CHANGELOG.md
45+
if-no-files-found: ignore
46+
47+
semantic-release-dry-run:
48+
name: Semantic Release Dry Run
49+
runs-on: ubuntu-latest
50+
needs: changelog
51+
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
52+
steps:
53+
- name: Checkout repository
54+
uses: actions/checkout@v7
55+
with:
56+
fetch-depth: 0
57+
58+
- name: Setup Node.js
59+
uses: actions/setup-node@v7
60+
with:
61+
node-version: 20
62+
cache: 'npm'
63+
64+
- name: Install dependencies
65+
run: npm ci --legacy-peer-deps
66+
67+
- name: Run semantic-release dry-run
68+
env:
69+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
70+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
71+
run: npx semantic-release --dry-run || true

.github/workflows/coverage.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Code Coverage Reporting
2+
3+
on:
4+
push:
5+
branches: [main, dev, develop]
6+
pull_request:
7+
branches: [main, dev, develop]
8+
workflow_dispatch:
9+
10+
env:
11+
NODE_VERSION: '20'
12+
13+
jobs:
14+
coverage:
15+
name: Code Coverage with Thresholds
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v7
20+
21+
- name: Setup Node.js
22+
uses: actions/setup-node@v7
23+
with:
24+
node-version: ${{ env.NODE_VERSION }}
25+
cache: 'npm'
26+
27+
- name: Cache node modules
28+
uses: actions/cache@v4
29+
id: cache-node-modules
30+
with:
31+
path: node_modules
32+
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-${{ hashFiles('package-lock.json') }}
33+
34+
- name: Install dependencies
35+
if: steps.cache-node-modules.outputs.cache-hit != 'true'
36+
run: npm ci --legacy-peer-deps
37+
38+
- name: Run tests with coverage
39+
run: npm run test:coverage
40+
env:
41+
NODE_ENV: test
42+
43+
- name: Upload coverage to Codecov
44+
uses: codecov/codecov-action@v4
45+
with:
46+
files: ./coverage/lcov.info
47+
flags: unittests
48+
name: codecov-umbrella
49+
fail_ci_if_error: false
50+
token: ${{ secrets.CODECOV_TOKEN }}
51+
continue-on-error: true
52+
53+
- name: Upload coverage report
54+
if: always()
55+
uses: actions/upload-artifact@v4
56+
with:
57+
name: coverage-report-${{ github.sha }}
58+
path: coverage/
59+
retention-days: 30
60+
61+
- name: Comment coverage on PR
62+
if: github.event_name == 'pull_request'
63+
uses: romeovs/lcov-coverage-report-action@v0.4.0
64+
with:
65+
lcov-file: ./coverage/lcov.info
66+
minimum-coverage: 80
67+
fail-on-coverage-decrease: true

.size-limit.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,28 @@
33
"name": "Web JS Bundle",
44
"path": ["dist/_expo/static/js/**/*.js"],
55
"limit": "420 KB",
6-
"gzip": true
6+
"gzip": true,
7+
"preventRegression": true
78
},
89
{
910
"name": "Web Total Assets",
1011
"path": ["dist/**/*.{js,css}"],
1112
"limit": "630 KB",
12-
"gzip": true
13+
"gzip": true,
14+
"preventRegression": true
1315
},
1416
{
1517
"name": "Native iOS Bundle",
1618
"path": ["dist/bundles/ios-*.js", "dist/bundles/*.ios.js"],
1719
"limit": "1.4 MB",
18-
"gzip": true
20+
"gzip": true,
21+
"preventRegression": true
1922
},
2023
{
2124
"name": "Native Android Bundle",
2225
"path": ["dist/bundles/android-*.js", "dist/bundles/*.android.js"],
2326
"limit": "1.4 MB",
24-
"gzip": true
27+
"gzip": true,
28+
"preventRegression": true
2529
}
2630
]

CHANGELOG.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,87 @@
11
# Changelog
22

33
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html)
7+
and [Conventional Commits](https://www.conventionalcommits.org/).
8+
9+
## [Unreleased]
10+
11+
### Added
12+
- Automated changelog generation from conventional commits via semantic-release.
13+
- GitHub Actions workflow for changelog preview and validation.
14+
- Conventional commit validation in CI with strict commitlint rules.
15+
16+
### Changed
17+
- Enforced conventional commit format for all PRs and pushes.
18+
- Updated `.releaserc` to generate `CHANGELOG.md` on release.
19+
20+
### Documentation
21+
- Added changelog generation examples and usage instructions.
22+
23+
---
24+
25+
## Automated Changelog Process
26+
27+
This repository uses [semantic-release](https://github.com/semantic-release/semantic-release)
28+
with the [conventional commits](https://www.conventionalcommits.org/) specification.
29+
30+
### How It Works
31+
32+
1. Contributors write commits following the conventional commit format:
33+
- `feat: add new feature`
34+
- `fix: resolve bug in billing cycle`
35+
- `docs: update README`
36+
- `chore: update dependencies`
37+
38+
2. On every push to `main`, the Release workflow triggers semantic-release.
39+
40+
3. semantic-release:
41+
- Analyzes commit messages since the last release.
42+
- Determines the next version (`patch`, `minor`, or `major`).
43+
- Generates release notes from conventional commits.
44+
- Updates `CHANGELOG.md` automatically.
45+
- Creates a GitHub Release.
46+
- Publishes to npm (if configured).
47+
48+
### Commit Format Examples
49+
50+
```bash
51+
# Feature
52+
feat(subscription): add grace period support
53+
54+
# Bug fix
55+
fix(billing): resolve double-charge edge case
56+
57+
# Documentation
58+
docs(api): add payment webhook examples
59+
60+
# Breaking change
61+
feat(api)!: change subscription status enum
62+
63+
# Chore
64+
chore(deps): upgrade react-native to 0.73
65+
```
66+
67+
### Release Workflow
68+
69+
| Trigger | Action |
70+
|---------|--------|
71+
| Push to `main` | semantic-release analyzes commits and may publish |
72+
| PR to `main` | commitlint validates commit messages |
73+
| Manual dispatch | semantic-release dry-run preview |
74+
75+
### Local Development
76+
77+
Preview the changelog locally:
78+
79+
```bash
80+
npx conventional-changelog-cli -p angular -i CHANGELOG.md -s -r 0
81+
```
82+
83+
Validate commit messages locally:
84+
85+
```bash
86+
npx commitlint --from HEAD~1 --to HEAD --verbose
87+
```

codecov.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
codecov:
2+
require_ci_to_pass: yes
3+
4+
coverage:
5+
status:
6+
project:
7+
default:
8+
target: 80%
9+
threshold: 2%
10+
informational: false
11+
patch:
12+
default:
13+
target: 80%
14+
threshold: 5%
15+
informational: false
16+
changes:
17+
default:
18+
target: 80%
19+
threshold: 5%
20+
informational: false
21+
22+
parsers:
23+
gcov:
24+
branch_detection:
25+
conditional: yes
26+
loop: yes
27+
method: no
28+
macro: no
29+
30+
comment:
31+
layout: "reach,diff,flags,tree"
32+
behavior: default
33+
require_changes: yes
34+
require_base: yes
35+
require_head: yes
36+
37+
ignore:
38+
- "src/**/*.d.ts"
39+
- "src/**/index.ts"
40+
- "src/**/*.stories.tsx"
41+
- "src/**/*.test.tsx"
42+
- "src/**/*.test.ts"
43+
- "e2e/**"
44+
- "backend/**"
45+
- "contracts/**"
46+
- "app/**"
47+
- "src/animations/**"

0 commit comments

Comments
 (0)