Skip to content

Commit

Permalink
config: add CI/CD github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
gimnathperera committed Sep 29, 2023
1 parent 7399aee commit 83f0b10
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 1 deletion.
37 changes: 37 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Main
on:
push:
branches:
- main

jobs:
linter:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: ['18.x']

steps:
- name: Git checkout
uses: actions/checkout@v3

- name: Add SHORT_SHA env property with commit short sha
run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV

- name: Git sort sha
run: echo ${SHORT_SHA}

- name: Setup Node.js version ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Install PNPM
run: npm install -g pnpm

- name: Install dependencies using PNPM
run: pnpm install --frozen-lockfile

- name: Linter
run: pnpm run lint
35 changes: 35 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Linter
on:
pull_request:

jobs:
linter:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: ['18.x']

steps:
- name: Git checkout
uses: actions/checkout@v3

- name: Add SHORT_SHA env property with commit short sha
run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV

- name: Git sort sha
run: echo ${SHORT_SHA}

- name: Setup Node.js version ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- name: Install PNPM
run: npm install -g pnpm

- name: Install dependencies using PNPM
run: pnpm install --frozen-lockfile

- name: Linter
run: pnpm run lint
3 changes: 2 additions & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ pnpm check-types ||
Please resolve the indicated problems before proceeding.'
false;
)
# If all checks pass, proceed to build


echo '👍 No linting or type issues found...'


Expand Down

0 comments on commit 83f0b10

Please sign in to comment.