-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (66 loc) · 1.95 KB
/
ci.yml
File metadata and controls
77 lines (66 loc) · 1.95 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Build
on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches:
- main
workflow_dispatch:
inputs:
target_branch:
description: 'Target branch to compare against'
required: false
default: 'main'
type: string
jobs:
Build:
runs-on: ubuntu-latest
permissions:
# Allow commenting on commits
contents: write
# Allow commenting on issues
issues: write
# Allow commenting on pull requests
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Pnpm
run: |
npm install -g corepack@latest --force
corepack enable
- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: 22
cache: 'pnpm'
# Update npm to the latest version to enable OIDC
- name: Update npm
run: |
npm install -g npm@latest
npm --version
node --version
npx -v
- name: Install Dependencies and Build
run: |
pnpm install --ignore-scripts
pnpm run build
- name: Run Tests
run: |
pnpm run test
- name: Build Demo Project
run: |
cd examples/rsbuild-demo
pnpm install
pnpm run build
cd ../rsbuild-demo2
pnpm run build
- name: Report Compressed Size
uses: ./
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
file_path: 'examples/**/*/.rsdoctor/rsdoctor-data.json'
target_branch: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.ref || github.event.inputs.target_branch || github.event.repository.default_branch }}