-
Notifications
You must be signed in to change notification settings - Fork 103
135 lines (112 loc) · 3.16 KB
/
main.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
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# This is a basic workflow to help you get started with Actions
name: CI
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches:
- 'main'
- 'next'
- '+([0-9])?(.{+([0-9]),x}).x'
pull_request: {}
jobs:
reuse-compliance:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: REUSE Compliance Check
uses: fsfe/reuse-action@v1.1
check-bundle-size:
if: ${{ github.base_ref == 'main' }} # only for PRs targeting main branch
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: preactjs/compressed-size-action@2.6.0
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
pattern: 'packages/**/dist/**/*.{js,css}'
compression: 'gzip'
clean-script: 'clean:remove-modules'
install:
name: 'Install Dependencies'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4.0.4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- name: Install and Build
run: yarn install --immutable
test:
needs: ['install']
uses: './.github/workflows/test.yml'
build:
needs: ['install']
name: 'Build'
runs-on: ubuntu-latest
strategy:
matrix:
react: ['18', '19']
env:
CYPRESS_INSTALL_BINARY: 0
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4.0.4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- name: Install
run: yarn install --immutable
- name: Install 19
if: ${{ matrix.react == '19' }}
run: |
echo "$(jq '.resolutions += {"@types/react": "npm:types-react@rc", "@types/react-dom": "npm:types-react-dom@rc" }' package.json)" > package.json
yarn add react@rc react-dom@rc
yarn
- name: Build
run: yarn build
lint:
needs: ['install']
runs-on: ubuntu-latest
env:
CYPRESS_INSTALL_BINARY: 0
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4.0.4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- name: install dependencies
run: yarn install --immutable
- name: run eslint
run: yarn lint
env:
NODE_OPTIONS: '--max-old-space-size=4096'
deploy-next-docs:
needs: ['build']
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
env:
CYPRESS_INSTALL_BINARY: 0
steps:
- uses: actions/checkout@v4
- name: Setup Node.js environment
uses: actions/setup-node@v4.0.4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- name: Install and Build
run: |
yarn install --immutable
yarn build:storybook
env:
NODE_OPTIONS: '--max-old-space-size=4096'
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4.6.4
with:
branch: gh-pages # The branch the action should deploy to.
folder: .out # The folder the action should deploy.
target-folder: nightly
clean: true