Skip to content

Commit

Permalink
feat(CI): Add ci actions
Browse files Browse the repository at this point in the history
  • Loading branch information
draedful authored Oct 4, 2024
1 parent 3e2bfb7 commit 59cf335
Show file tree
Hide file tree
Showing 7 changed files with 215 additions and 6 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: CI

on:
push:
branches: [main]
pull_request:

jobs:
verify_files:
name: Verify Files
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
cache: npm
- name: Install Packages
run: npm ci
# - name: Lint Files
# run: npm run lint
- name: Typecheck
run: npm run typecheck

tests:
name: Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18
cache: npm
- name: Install Packages
run: npm ci
- name: Unit Tests
run: npm run test
# - name: ESBuild compatability
# run: npm run test:esbuild
13 changes: 13 additions & 0 deletions .github/workflows/pr-preview-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: PR Preview Build

on:
pull_request:

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: gravity-ui/preview-build-action@v2
with:
node-version: 18
22 changes: 22 additions & 0 deletions .github/workflows/pr-preview-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: PR Preview Deploy

on:
workflow_run:
workflows: [PR Preview Build]
types:
- completed

jobs:
deploy:
name: Deploy
if: >
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
steps:
- uses: gravity-ui/preview-deploy-action@v2
with:
project: graph
github-token: ${{ secrets.GRAVITY_UI_BOT_GITHUB_TOKEN }}
s3-key-id: ${{ secrets.STORYBOOK_S3_KEY_ID }}
s3-secret-key: ${{ secrets.STORYBOOK_S3_SECRET_KEY }}
27 changes: 27 additions & 0 deletions .github/workflows/pr-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: PR Title

on:
pull_request:
types:
- opened
- synchronize
- reopened
- edited

jobs:
verify_title:
name: Verify Title
runs-on: ubuntu-latest
if: ${{github.event.action != 'edited' || github.event.changes.title}}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18
cache: npm
- name: Install Packages
run: npm ci
- name: Run Commitlint
run: echo "${{github.event.pull_request.title}}" | npx commitlint
6 changes: 6 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
"subject-case": [0],
},
};
97 changes: 97 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
"keywords": [],
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/gravity-ui/graph"
},
"type": "git",
"url": "https://github.com/gravity-ui/graph"
},
"files": [
"build",
"tsconfig.json"
],
"engines": {
"yarn": "Please use npm instead of yarn to install dependencies",
"pnpm": "Please use npm instead of pnpm to install dependencies"
},
"yarn": "Please use npm instead of yarn to install dependencies",
"pnpm": "Please use npm instead of pnpm to install dependencies"
},
"scripts": {
"typecheck": "npm run build:publish -- --noEmit",
"lint": "eslint \"src/**/*.{js,jsx,ts,tsx}\"",
Expand Down Expand Up @@ -56,6 +56,7 @@
"@babel/preset-react": "^7.22.5",
"@babel/preset-typescript": "^7.22.5",
"@chromatic-com/storybook": "^1.5.0",
"@commitlint/config-conventional": "^19.5.0",
"@gravity-ui/eslint-config": "^2.1.1",
"@gravity-ui/tsconfig": "^1.0.0",
"@gravity-ui/uikit": "^5.26.0",
Expand Down

0 comments on commit 59cf335

Please sign in to comment.