Skip to content

Commit 2cec87a

Browse files
committed
chore: initial commit
0 parents  commit 2cec87a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+30803
-0
lines changed

.editorconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 4
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
max_line_length = 110
11+
12+
[{*.json,*.yml,*.yaml,*.tf}]
13+
indent_size = 2
14+
15+
[GNUmakefile]
16+
indent_style = tab

.eslintrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": ["@gravity-ui/eslint-config", "@gravity-ui/eslint-config/prettier"],
3+
"root": true,
4+
"rules": {
5+
"no-implicit-globals":"off"
6+
}
7+
}

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* !text !filter !merge !diff

.github/workflows/ci.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- release-v*
8+
pull_request:
9+
branches:
10+
- main
11+
- release-v*
12+
13+
jobs:
14+
verify_files:
15+
name: Verify Files
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v2
20+
with:
21+
fetch-depth: 0
22+
- name: Setup Node
23+
uses: actions/setup-node@v2
24+
with:
25+
node-version: '18.x'
26+
cache: 'npm'
27+
- name: Install Packages
28+
run: npm ci
29+
- name: Lint Files
30+
run: npm run lint
31+
- name: Typecheck
32+
run: npm run typecheck

.github/workflows/main-preview.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Main Preview
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
jobs:
8+
main:
9+
name: Build and Deploy
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v2
14+
with:
15+
fetch-depth: 0
16+
- name: Setup Node
17+
uses: actions/setup-node@v2
18+
with:
19+
node-version: 18
20+
- name: Install Packages
21+
run: npm ci
22+
shell: bash
23+
- name: Build Storybook
24+
run: npm run build-storybook
25+
shell: bash
26+
- name: Upload to S3
27+
uses: gravity-ui/preview-upload-to-s3-action@v1
28+
with:
29+
node-version: 18
30+
src-path: storybook-static
31+
dest-path: /react-unipika/main/
32+
s3-key-id: ${{ secrets.STORYBOOK_S3_KEY_ID }}
33+
s3-secret-key: ${{ secrets.STORYBOOK_S3_SECRET_KEY }}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: PR Preview Build
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
build:
8+
name: Build
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: gravity-ui/preview-build-action@v2
12+
with:
13+
node-version: 18
14+
env:
15+
TS_NODE_PROJECT: .storybook/tsconfig.json
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: PR Preview Deploy
2+
3+
on:
4+
workflow_run:
5+
workflows: ['PR Preview Build']
6+
types:
7+
- completed
8+
9+
jobs:
10+
deploy:
11+
name: Deploy
12+
if: >
13+
github.event.workflow_run.event == 'pull_request' &&
14+
github.event.workflow_run.conclusion == 'success'
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: gravity-ui/preview-deploy-action@v1
18+
with:
19+
project: react-unipika
20+
github-token: ${{ secrets.GRAVITY_UI_BOT_GITHUB_TOKEN }}
21+
s3-key-id: ${{ secrets.STORYBOOK_S3_KEY_ID }}
22+
s3-secret-key: ${{ secrets.STORYBOOK_S3_SECRET_KEY }}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: PR Visual Tests Report
2+
3+
on:
4+
workflow_run:
5+
workflows: [PR Visual Tests]
6+
types:
7+
- completed
8+
9+
jobs:
10+
comment:
11+
name: Create GitHub Comment
12+
if: github.event.workflow_run.event == 'pull_request'
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Download Artifacts
16+
uses: actions/download-artifact@v4
17+
with:
18+
github-token: ${{ secrets.GRAVITY_UI_BOT_GITHUB_TOKEN }}
19+
run-id: ${{ github.event.workflow_run.id }}
20+
- name: Extract PR Number
21+
id: pr
22+
run: echo "::set-output name=id::$(<pr/pr-id.txt)"
23+
shell: bash
24+
- name: Install AWS CLI
25+
uses: unfor19/install-aws-cli-action@v1
26+
with:
27+
version: 2.22.35
28+
arch: amd64
29+
- name: Upload to S3
30+
env:
31+
AWS_ACCESS_KEY_ID: ${{ secrets.STORYBOOK_S3_KEY_ID }}
32+
AWS_SECRET_ACCESS_KEY: ${{ secrets.STORYBOOK_S3_SECRET_KEY }}
33+
AWS_DEFAULT_REGION: ru-central1
34+
AWS_EC2_METADATA_DISABLED: true
35+
run: aws s3 cp playwright-report s3://playwright-reports/react-unipika/pulls/${{ steps.pr.outputs.id}}/ --endpoint-url=https://storage.yandexcloud.net --recursive
36+
shell: bash
37+
- name: Create Comment
38+
uses: marocchino/sticky-pull-request-comment@v2
39+
with:
40+
GITHUB_TOKEN: ${{ secrets.GRAVITY_UI_BOT_GITHUB_TOKEN }}
41+
number: ${{ steps.pr.outputs.id }}
42+
header: visual tests report
43+
message: '[Visual Tests Report](https://storage.yandexcloud.net/playwright-reports/react-unipika/pulls/${{ steps.pr.outputs.id }}/index.html) is ready.'
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: PR Visual Tests
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
visual_tests:
8+
name: Visual Tests
9+
runs-on: ubuntu-latest
10+
container:
11+
image: mcr.microsoft.com/playwright:v1.50.1-noble
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-node@v4
15+
with:
16+
node-version: 18
17+
cache: npm
18+
- name: Install Packages
19+
run: npm ci
20+
- name: Run Visual Tests
21+
run: npm run playwright
22+
env:
23+
CI: 'true'
24+
- name: Upload Playwright Report
25+
if: always()
26+
uses: actions/upload-artifact@v4
27+
with:
28+
name: playwright-report
29+
path: ./playwright-report
30+
retention-days: 1
31+
- name: Save PR ID
32+
if: always()
33+
run: |
34+
pr="${{ github.event.pull_request.number }}"
35+
echo $pr > ./pr-id.txt
36+
shell: bash
37+
- name: Create PR Artifact
38+
if: always()
39+
uses: actions/upload-artifact@v4
40+
with:
41+
name: pr
42+
path: ./pr-id.txt

.github/workflows/release.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- release/v*
8+
- next
9+
10+
jobs:
11+
release:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: release from ${{ github.ref_name }}
15+
uses: gravity-ui/release-action@v1
16+
with:
17+
github-token: ${{ secrets.GRAVITY_UI_BOT_GITHUB_TOKEN }}
18+
npm-token: ${{ secrets.GRAVITY_UI_BOT_NPM_TOKEN }}
19+
node-version: 18
20+
default-branch: ${{ github.ref_name != 'main' && github.ref_name || null }}
21+
npm-dist-tag: ${{ github.ref_name != 'main' && github.ref_name || 'latest' }}
22+
prerelease: ${{ github.ref_name == 'next' && true || null }}

0 commit comments

Comments
 (0)