Skip to content

Commit

Permalink
Add quality workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
anubra266 committed Jan 23, 2024
1 parent c0c5a21 commit 36caeec
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/composite-actions/install/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: 'Install'
description: 'Sets up Node.js and runs install'

runs:
using: composite
steps:
- uses: pnpm/[email protected]
with:
version: 7

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16.x
registry-url: 'https://registry.npmjs.org'
cache: 'pnpm'

- name: Setup Git User
shell: bash
run: |
git config --global user.email "[email protected]"
git config --global user.name "Segun Adebayo"
- name: Install dependencies
shell: bash
run: pnpm install
68 changes: 68 additions & 0 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Quality

on:
push:
branches:
- main
pull_request:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
prettier:
name: Prettier
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install
uses: ./.github/composite-actions/install

- name: Run Prettier
run: pnpm prettier

tests:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install
uses: ./.github/composite-actions/install

- name: Run tests
run: pnpm test

eslint:
name: ESLint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install
uses: ./.github/composite-actions/install

- name: Run ESLint
run: pnpm lint
env:
NODE_OPTIONS: "--max-old-space-size=4096"

types:
name: TypeScript
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install
uses: ./.github/composite-actions/install

- name: Run TypeScript type check
run: pnpm typecheck
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"scripts": {
"dev": "pnpm -r --parallel dev",
"build": "pnpm -r --parallel build",
"test": "pnpm -r --parallel test",
"lint": "pnpm -r --parallel lint",
"prettier": "prettier --check .",
"prettier-fix": "prettier --write .",
Expand Down

0 comments on commit 36caeec

Please sign in to comment.