Skip to content

Commit

Permalink
add validation action
Browse files Browse the repository at this point in the history
  • Loading branch information
Pronin-vk committed Jul 3, 2024
1 parent ce0c9d4 commit f9a71f0
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 3 deletions.
9 changes: 9 additions & 0 deletions .github/actions/validation/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: 'Validation'
description: It runs linter and prettier checks

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Run linters
run: yarn lint:ci
3 changes: 3 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ jobs:
with:
version: ${{ github.event.inputs.new_version }}

- name: Validation
uses: ./.github/actions/validation

- name: Complete publish
uses: ./.github/actions/complete-publish
with:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/publish_prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ jobs:
version: ${{ github.event.inputs.custom_version || github.event.inputs.new_version }}
npm_tag: ${{ github.event.inputs.npm_tag }}

- name: Validation
uses: ./.github/actions/validation

- name: Complete publish
uses: ./.github/actions/complete-publish
with:
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: 'Pull Request'

on:
pull_request:

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.DEVTOOLS_GITHUB_TOKEN }}

- name: Setting up the repository environment
uses: ./.github/actions/setup

- name: Validation
uses: ./.github/actions/validation
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@
},
"scripts": {
"build": "tsc",
"eslint:check": "eslint src/ --ext ts,tsx",
"eslint:fix": "eslint src/ --ext ts,tsx",
"prettier:check": "prettier --check .",
"lint:eslint": "eslint src/ --ext ts,tsx",
"lint:fix": "eslint src/ --ext ts,tsx",
"lint:prettier": "prettier --check .",
"lint:ci": "yarn lint:eslint && yarn lint:prettier",
"prettier:fix": "prettier --write .",
"prepare": "husky install",
"prepublishOnly": "yarn build"
Expand Down

0 comments on commit f9a71f0

Please sign in to comment.