Skip to content

Commit 9600053

Browse files
committed
ci: agregar validación de compilación TypeScript en workflow
1 parent e08d9f4 commit 9600053

1 file changed

Lines changed: 70 additions & 0 deletions

File tree

.github/workflows/test-build.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: 🧪 Test Build & Dependencies
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
push:
7+
branches: [main]
8+
9+
permissions:
10+
contents: read
11+
pull-requests: write
12+
13+
jobs:
14+
test-build:
15+
name: 🔨 Build & Validate
16+
runs-on: ubuntu-latest
17+
18+
strategy:
19+
matrix:
20+
node-version: [25.x]
21+
22+
steps:
23+
- name: 📥 Checkout code
24+
uses: actions/checkout@v4
25+
26+
- name: 📦 Setup Node.js ${{ matrix.node-version }}
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: ${{ matrix.node-version }}
30+
cache: "npm"
31+
32+
- name: 📚 Install dependencies
33+
run: npm ci
34+
35+
- name: 📦 Install TypeScript (if not present)
36+
run: npm install --save-dev typescript
37+
38+
- name: 🔍 Check TypeScript compilation
39+
run: npx tsc --noEmit
40+
41+
- name: ✨ Dependencies validation passed!
42+
if: success()
43+
run: echo "✅ All dependencies are compatible and the app compiles correctly!"
44+
45+
dependabot-auto-merge:
46+
name: 🤖 Auto-merge Dependabot PRs
47+
runs-on: ubuntu-latest
48+
needs: test-build
49+
if: github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'
50+
51+
permissions:
52+
pull-requests: write
53+
contents: write
54+
55+
steps:
56+
- name: 🔓 Dependabot metadata
57+
id: metadata
58+
uses: dependabot/fetch-metadata@v2
59+
60+
- name: ✅ Approve PR
61+
run: gh pr review --approve "$PR_URL"
62+
env:
63+
PR_URL: ${{ github.event.pull_request.html_url }}
64+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
65+
66+
- name: 🚀 Enable auto-merge for Dependabot PRs
67+
run: gh pr merge --auto --squash "$PR_URL"
68+
env:
69+
PR_URL: ${{ github.event.pull_request.html_url }}
70+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)