-
-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (46 loc) · 1.43 KB
/
ci-workflow.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: CI Workflow
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
steps:
- name: 🔄 Checkout code
uses: actions/checkout@v4
- name: 🔧 Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: 📦 Install dependencies
run: npm install
- name: 🖋️ Check formatting
run: |
npx prettier --check . || (
echo "Formatting issues detected. Running Prettier to fix..." &&
npx prettier --write . &&
git config --local user.name "Debugging Duck 🦆" &&
git config --local user.email "github-actions[bot]@users.noreply.github.com" &&
git add . &&
git commit -m "💄 Fix formatting issues with Prettier" || echo "No changes to commit."
)
- name: 🧹 Lint code
run: npm run lint
- name: 🧪 Run tests with coverage
run: npm run test
env:
CI: true
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
APP_ID: ${{ secrets.APP_ID }}
PROBOT_GITHUB_TOKEN: ${{ secrets.PROBOT_GITHUB_TOKEN }}
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- name: 🚀 Deploy
run: echo "Replace this with your deployment commands"