Skip to content

Commit d735893

Browse files
committed
dev: migrate to pnpm
1 parent e26239d commit d735893

File tree

28 files changed

+15651
-23591
lines changed

28 files changed

+15651
-23591
lines changed

.github/workflows/branch-preview.yaml

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,30 @@ jobs:
77
name: Build and Deploy
88
runs-on: ubuntu-latest
99
steps:
10-
- name: Checkout
11-
uses: actions/checkout@v3
12-
with:
13-
ref: ${{ github.event.pull_request.head.sha }}
14-
- name: Setup Node
15-
uses: actions/setup-node@v3
16-
with:
17-
node-version: 24
18-
cache: npm
19-
- name: Install Packages
20-
run: npm ci
21-
shell: bash
22-
- name: Build Storybook
23-
run: npm run storybook:build
24-
shell: bash
25-
- name: Upload to S3
26-
uses: gravity-ui/preview-upload-to-s3-action@v1
27-
with:
28-
src-path: storybook-static
29-
dest-path: /md-editor/branches/${{ github.ref_name }}/
30-
s3-key-id: ${{ secrets.STORYBOOK_S3_KEY_ID }}
31-
s3-secret-key: ${{ secrets.STORYBOOK_S3_SECRET_KEY }}
10+
- name: Checkout
11+
uses: actions/checkout@v4
12+
with:
13+
ref: ${{ github.event.pull_request.head.sha }}
14+
15+
- name: Setup pnpm
16+
uses: pnpm/action-setup@v4
17+
18+
- name: Setup Node
19+
uses: actions/setup-node@v6
20+
with:
21+
node-version-file: '.nvmrc'
22+
cache: pnpm
23+
24+
- name: Install dependencies
25+
run: pnpm run deps:ci
26+
27+
- name: Build Storybook
28+
run: pnpm run sb:build
29+
30+
- name: Upload to S3
31+
uses: gravity-ui/preview-upload-to-s3-action@v1
32+
with:
33+
src-path: storybook-static
34+
dest-path: /md-editor/branches/${{ github.ref_name }}/
35+
s3-key-id: ${{ secrets.STORYBOOK_S3_KEY_ID }}
36+
s3-secret-key: ${{ secrets.STORYBOOK_S3_SECRET_KEY }}

.github/workflows/ci.yml

Lines changed: 57 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -10,50 +10,70 @@ jobs:
1010
name: Verify Files
1111
runs-on: ubuntu-latest
1212
steps:
13-
- name: Checkout
14-
uses: actions/checkout@v3
15-
- name: Setup Node
16-
uses: actions/setup-node@v3
17-
with:
18-
node-version: 24
19-
cache: npm
20-
- name: Install Packages
21-
run: npm ci
22-
- name: Lint Files
23-
run: npm run lint
24-
- name: Typecheck
25-
run: npm run typecheck
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
16+
- name: Setup pnpm
17+
uses: pnpm/action-setup@v4
18+
19+
- name: Setup Node
20+
uses: actions/setup-node@v6
21+
with:
22+
node-version-file: '.nvmrc'
23+
cache: pnpm
24+
25+
- name: Install dependencies
26+
run: pnpm run deps:ci
27+
28+
- name: Lint Files
29+
run: pnpm run lint
30+
31+
- name: Typecheck
32+
run: pnpm run typecheck
2633

2734
tests:
2835
name: Tests
2936
runs-on: ubuntu-latest
3037
steps:
31-
- name: Checkout
32-
uses: actions/checkout@v3
33-
- name: Setup Node
34-
uses: actions/setup-node@v3
35-
with:
36-
node-version: 24
37-
cache: npm
38-
- name: Install Packages
39-
run: npm ci
40-
- name: Unit Tests
41-
run: npm run test
42-
- name: ESBuild compatability
43-
run: npm run test:esbuild
38+
- name: Checkout
39+
uses: actions/checkout@v4
40+
41+
- name: Setup pnpm
42+
uses: pnpm/action-setup@v4
43+
44+
- name: Setup Node
45+
uses: actions/setup-node@v6
46+
with:
47+
node-version-file: '.nvmrc'
48+
cache: pnpm
49+
50+
- name: Install dependencies
51+
run: pnpm run deps:ci
52+
53+
- name: Unit Tests
54+
run: pnpm run test
55+
56+
- name: ESBuild compatability
57+
run: pnpm run test:esbuild
4458

4559
check_circular_deps:
4660
name: Check Circular Dependencies
4761
runs-on: ubuntu-latest
4862
steps:
49-
- name: Checkout
50-
uses: actions/checkout@v3
51-
- name: Setup Node
52-
uses: actions/setup-node@v3
53-
with:
54-
node-version: 24
55-
cache: npm
56-
- name: Install Packages
57-
run: npm ci
58-
- name: Check circular dependencies
59-
run: npm run check-circular-deps
63+
- name: Checkout
64+
uses: actions/checkout@v4
65+
66+
- name: Setup pnpm
67+
uses: pnpm/action-setup@v4
68+
69+
- name: Setup Node
70+
uses: actions/setup-node@v6
71+
with:
72+
node-version-file: '.nvmrc'
73+
cache: pnpm
74+
75+
- name: Install dependencies
76+
run: pnpm run deps:ci
77+
78+
- name: Check circular dependencies
79+
run: pnpm run check-circular-deps

.github/workflows/main-preview.yml

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,28 @@ jobs:
99
name: Build and Deploy
1010
runs-on: ubuntu-latest
1111
steps:
12-
- name: Checkout
13-
uses: actions/checkout@v4
14-
- name: Setup Node
15-
uses: actions/setup-node@v4
16-
with:
17-
node-version: 24
18-
cache: npm
19-
- name: Install Packages
20-
run: npm ci
21-
shell: bash
22-
- name: Build Storybook
23-
run: npm run storybook:build
24-
shell: bash
25-
- name: Upload to S3
26-
uses: gravity-ui/preview-upload-to-s3-action@v1
27-
with:
28-
src-path: storybook-static
29-
dest-path: /md-editor/main/
30-
s3-key-id: ${{ secrets.STORYBOOK_S3_KEY_ID }}
31-
s3-secret-key: ${{ secrets.STORYBOOK_S3_SECRET_KEY }}
12+
- name: Checkout
13+
uses: actions/checkout@v4
14+
15+
- name: Setup pnpm
16+
uses: pnpm/action-setup@v4
17+
18+
- name: Setup Node
19+
uses: actions/setup-node@v6
20+
with:
21+
node-version-file: '.nvmrc'
22+
cache: pnpm
23+
24+
- name: Install dependencies
25+
run: pnpm run deps:ci
26+
27+
- name: Build Storybook
28+
run: pnpm run sb:build
29+
30+
- name: Upload to S3
31+
uses: gravity-ui/preview-upload-to-s3-action@v1
32+
with:
33+
src-path: storybook-static
34+
dest-path: /md-editor/main/
35+
s3-key-id: ${{ secrets.STORYBOOK_S3_KEY_ID }}
36+
s3-secret-key: ${{ secrets.STORYBOOK_S3_SECRET_KEY }}

.github/workflows/pr-preview-build.yml

Lines changed: 0 additions & 13 deletions
This file was deleted.

.github/workflows/pr-preview-deploy.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

.github/workflows/pr-preview.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: PR Preview
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
main:
8+
name: Build and Deploy Storybook
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
14+
- name: Setup pnpm
15+
uses: pnpm/action-setup@v4
16+
17+
- name: Setup Node
18+
uses: actions/setup-node@v6
19+
with:
20+
node-version-file: '.nvmrc'
21+
cache: pnpm
22+
23+
- name: Install dependencies
24+
run: pnpm run deps:ci
25+
26+
- name: Install Storybook CLI
27+
run: pnpm i @storybook/cli@8.4.1
28+
29+
- name: Build Storybook
30+
run: pnpm run sb:build
31+
32+
- name: Upload to S3
33+
uses: gravity-ui/preview-upload-to-s3-action@v1
34+
with:
35+
src-path: storybook-static
36+
dest-path: /md-editor/pulls/${{ github.event.pull_request.number }}/
37+
s3-key-id: ${{ secrets.STORYBOOK_S3_KEY_ID }}
38+
s3-secret-key: ${{ secrets.STORYBOOK_S3_SECRET_KEY }}
39+
40+
- name: Create token
41+
id: app-token
42+
uses: actions/create-github-app-token@v2
43+
with:
44+
app-id: ${{ secrets.GRAVITY_UI_APP_ID }}
45+
private-key: ${{ secrets.GRAVITY_UI_APP_PRIVATE_KEY }}
46+
47+
- name: Create Comment
48+
uses: marocchino/sticky-pull-request-comment@v2
49+
with:
50+
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
51+
header: preview
52+
number: ${{ github.event.pull_request.number }}
53+
message: '[![Storybook Deployed](https://img.shields.io/badge/Storybook-Deployed-FF4785?logo=storybook&style=for-the-badge)](https://preview.gravity-ui.com/md-editor/${{ github.event.pull_request.number }}/)'

.github/workflows/pr-visual-tests-report.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,30 @@ jobs:
1212
if: github.event.workflow_run.event == 'pull_request'
1313
runs-on: ubuntu-latest
1414
steps:
15+
- name: Create token
16+
id: app-token
17+
uses: actions/create-github-app-token@v2
18+
with:
19+
app-id: ${{ secrets.GRAVITY_UI_APP_ID }}
20+
private-key: ${{ secrets.GRAVITY_UI_APP_PRIVATE_KEY }}
21+
1522
- name: Download Artifacts
1623
uses: actions/download-artifact@v4
1724
with:
18-
github-token: ${{ secrets.GRAVITY_UI_BOT_GITHUB_TOKEN }}
25+
github-token: ${{ steps.app-token.outputs.token }}
1926
run-id: ${{ github.event.workflow_run.id }}
27+
2028
- name: Extract PR Number
2129
id: pr
2230
run: echo "::set-output name=id::$(<pr/pr-id.txt)"
2331
shell: bash
32+
2433
- name: Install AWS CLI
2534
uses: unfor19/install-aws-cli-action@v1
2635
with:
2736
version: 2.22.35
2837
arch: amd64
38+
2939
- name: Upload to S3
3040
env:
3141
AWS_ACCESS_KEY_ID: ${{ secrets.STORYBOOK_S3_KEY_ID }}
@@ -34,10 +44,11 @@ jobs:
3444
AWS_EC2_METADATA_DISABLED: true
3545
run: aws s3 cp playwright-report s3://playwright-reports/markdown-editor/pulls/${{ steps.pr.outputs.id}}/ --endpoint-url=https://storage.yandexcloud.net --recursive
3646
shell: bash
47+
3748
- name: Create Comment
3849
uses: marocchino/sticky-pull-request-comment@v2
3950
with:
40-
GITHUB_TOKEN: ${{ secrets.GRAVITY_UI_BOT_GITHUB_TOKEN }}
51+
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
4152
number: ${{ steps.pr.outputs.id }}
4253
header: visual tests report
43-
message: '[Visual Tests Report](https://storage.yandexcloud.net/playwright-reports/markdown-editor/pulls/${{ steps.pr.outputs.id }}/index.html) is ready.'
54+
message: '[![Playwright Report](https://img.shields.io/badge/Playwright-Report-45ba4b?style=for-the-badge&labelColor=2b3137)](https://storage.yandexcloud.net/playwright-reports/markdown-editor/pulls/${{ steps.pr.outputs.id }}/index.html)'

.github/workflows/pr-visual-tests.yml

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,41 @@ jobs:
1010
container:
1111
image: mcr.microsoft.com/playwright:v1.49.0-jammy
1212
steps:
13-
- uses: actions/checkout@v4
14-
- uses: actions/setup-node@v4
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
16+
- name: Setup pnpm
17+
uses: pnpm/action-setup@v4
18+
19+
- name: Setup Node
20+
uses: actions/setup-node@v6
1521
with:
16-
node-version: 24
17-
cache: npm
18-
- name: Install Packages
19-
run: npm ci
22+
node-version-file: '.nvmrc'
23+
cache: pnpm
24+
25+
- name: Install dependencies
26+
run: pnpm run deps:ci
27+
2028
- name: Run Visual Tests
21-
run: npm run playwright
29+
run: pnpm run playwright
2230
env:
2331
CI: 'true'
32+
2433
- name: Upload Playwright Report
2534
if: always()
2635
uses: actions/upload-artifact@v4
2736
with:
2837
name: playwright-report
2938
path: ./playwright-report
3039
retention-days: 1
40+
3141
- name: Save PR ID
3242
if: always()
3343
run: |
3444
pr="${{ github.event.pull_request.number }}"
3545
echo $pr > ./pr-id.txt
3646
shell: bash
47+
3748
- name: Create PR Artifact
3849
if: always()
3950
uses: actions/upload-artifact@v4

0 commit comments

Comments
 (0)