-
Notifications
You must be signed in to change notification settings - Fork 1
50 lines (47 loc) · 1.32 KB
/
ci.yaml
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
name: 'ci: Code Standards & Testing'
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
ci:
name: Lint & Test
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: '⬇️ Checkout Code'
uses: actions/checkout@v4
- name: '💚 Use Node.js'
uses: actions/setup-node@v4
with:
node-version: 20
- name: '📦 Install Packages'
run: yarn install
- name: '🏗️ Build'
run: yarn build
- name: '🎨 Code Formatting'
run: yarn analyze:fmt
- name: '⚙️ Code Linting'
run: yarn analyze:lint
- name: '🟦 Typecheck'
run: yarn analyze:types
- name: '⚡️ Test'
id: test
run: yarn test
dependabot:
name: 'Dependabot (auto-merge)'
needs: [ci]
runs-on: ubuntu-latest
timeout-minutes: 5
if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}} # Detect that the PR author is dependabot
steps:
- name: Enable auto-merge for Dependabot PRs
run: gh pr merge --auto --squash "$PR_URL" # Use GitHub CLI to automatically merge the PR
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{ secrets.GH_BOT_TOKEN }}