Skip to content

Commit

Permalink
ci: add pr title validation check and types check
Browse files Browse the repository at this point in the history
  • Loading branch information
kieranroneill committed Sep 11, 2024
1 parent b458629 commit 7aff9d4
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 6 deletions.
38 changes: 33 additions & 5 deletions .github/workflows/pull_request_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,29 @@ jobs:
- name: "🧶 Setup Yarn Dependencies"
uses: ./.github/actions/use-yarn-dependencies

##
# validation
##

validate_pr_title:
name: "Validate PR Title"
needs: install
runs-on: ubuntu-latest
steps:
- name: "🛎 Checkout"
uses: actions/checkout@v4
- name: "🔧 Setup"
uses: ./.github/actions/use-dependencies
- name: "✅ Validate"
run: echo ${{ github.event.pull_request.title }} | yarn commitlint

##
# lint, build documentation, build package and test
##

lint:
name: "Lint"
needs: install
needs: [install, validate_pr_title]
runs-on: ubuntu-latest
steps:
- name: "🛎 Checkout"
Expand All @@ -33,9 +49,21 @@ jobs:
- name: "👕 Lint"
run: yarn lint

build_documenation:
type_check:
name: "Type Check"
needs: [install, validate_pr_title]
runs-on: ubuntu-latest
steps:
- name: "🛎 Checkout"
uses: actions/checkout@v4
- name: "🔧 Setup"
uses: ./.github/actions/use-dependencies
- name: "🔍 Type Check"
run: yarn types:check

build_documentation:
name: "Build Documentation"
needs: install
needs: [install, validate_pr_title]
runs-on: ubuntu-latest
steps:
- name: "🛎 Checkout"
Expand All @@ -47,7 +75,7 @@ jobs:

build_package:
name: "Build Package"
needs: install
needs: [install, validate_pr_title]
runs-on: ubuntu-latest
steps:
- name: "🛎 Checkout"
Expand All @@ -59,7 +87,7 @@ jobs:

test:
name: "Test"
needs: install
needs: [install, validate_pr_title]
runs-on: ubuntu-latest
steps:
- name: "🛎 Checkout"
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
"lint": "eslint . --ext .ts --ext .js",
"prepare": "husky install",
"prettier": "prettier --config .prettierrc --write \"**/*.{js,json,ts}\"",
"test": "jest"
"test": "jest",
"types:check": "tsc --noEmit --project tsconfig.build.json"
},
"devDependencies": {
"@commitlint/cli": "^18.6.0",
Expand Down

0 comments on commit 7aff9d4

Please sign in to comment.