-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (68 loc) · 2.05 KB
/
Copy pathbuild.yml
File metadata and controls
72 lines (68 loc) · 2.05 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
name: Build
on: workflow_call
jobs:
build:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
- name: Set Node.js version
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: 24.x
- name: "Install"
run: |
npm ci
- name: "Prettier"
run: |
npm run format-check
- name: "Lint"
run: |
npm run lint
- name: "Test"
run: |
npm run test
- name: "build"
run: |
npm run build
npm run package
test:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
- name: Set Node.js version
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: 24.x
- name: "Build action for test"
run: |
npm ci
npm run all
git clean -fXd
- uses: ./
id: bundle
with:
path: './__tests__/fixtures/jquery.html'
- run: |
if [ "$EXPECTED_BUNDLE_SIZE" -gt "$ACTUAL_BUNDLE_SIZE" ]; then
echo "Actual bundle size $ACTUAL_BUNDLE_SIZE does not match expeced bundle size $EXPECTED_BUNDLE_SIZE"
exit 1
fi
env:
ACTUAL_BUNDLE_SIZE: ${{ steps.bundle.outputs.size }}
EXPECTED_BUNDLE_SIZE: '89501'
release:
runs-on: ubuntu-24.04
name: "Build and release action"
needs: [build, test]
steps:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
with:
fetch-depth: 0
persist-credentials: true
- name: Configure git
uses: smartlyio/github-actions@4ef49912877febb62867891d42a1205190fb2ab0 # git-init-userinfo-v1
- name: Release flow
uses: smartlyio/github-actions@ac9cc7e148b55d6c88641ea387ab6d2860ba5c3e # release-action-node-v1
with:
dry_run: ${{ github.event_name == 'pull_request' }}
token: "${{ secrets.GITHUB_TOKEN }}"