Skip to content

Commit

Permalink
ci: add jobs to verify PR
Browse files Browse the repository at this point in the history
  • Loading branch information
mthahzan committed Dec 17, 2024
1 parent 030b19f commit 0a196c7
Show file tree
Hide file tree
Showing 4 changed files with 159 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/pr-deps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Deps Installer

on:
pull_request:
branches:
- main
- develop

jobs:
install-dependencies:
name: Install Dependencies
runs-on: ubuntu-latest
outputs:
cache-key: ${{ steps.cache-deps.outputs.cache-key }}
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '22'

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Upload node_modules as artifact
uses: actions/upload-artifact@v3
with:
name: node_modules
path: node_modules

- name: Upload yarn cache
id: cache-deps
uses: actions/cache@v3
with:
path: |
~/.cache/yarn
node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
39 changes: 39 additions & 0 deletions .github/workflows/pr-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Lint Runner

on:
workflow_dispatch:
pull_request:

jobs:
run-lint:
name: Run Lint
runs-on: ubuntu-latest
needs: install-dependencies
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Download node_modules artifact
uses: actions/download-artifact@v3
with:
name: node_modules
path: node_modules

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '22'

- name: Run lint
run: yarn lint

- name: Lint Report
uses: dorny/test-reporter@v1
if: success()
with:
name: Lint

- name: Lint Summary
uses: test-summary/action@v2
with:
paths: 'reports/lint.xml'
41 changes: 41 additions & 0 deletions .github/workflows/pr-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Test Runner

on:
workflow_dispatch:
pull_request:

jobs:
run-tests:
name: Run Tests
runs-on: ubuntu-latest
needs: install-dependencies
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Download node_modules artifact
uses: actions/download-artifact@v3
with:
name: node_modules
path: node_modules

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '22'

- name: Run tests
run: yarn test

- name: Test Report
uses: dorny/test-reporter@v1
if: success()
with:
name: Tests
path: reports/junit.xml
reporter: jest-junit

- name: Test Summary
uses: test-summary/action@v2
with:
paths: 'reports/junit.xml'
39 changes: 39 additions & 0 deletions .github/workflows/pr-typecheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Type Check Runner

on:
workflow_dispatch:
pull_request:

jobs:
run-typecheck:
name: Run Type Check
runs-on: ubuntu-latest
needs: install-dependencies
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Download node_modules artifact
uses: actions/download-artifact@v3
with:
name: node_modules
path: node_modules

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '22'

- name: Run type check
run: yarn typecheck

- name: Type Check Report
uses: dorny/test-reporter@v1
if: success()
with:
name: Type Check

- name: Type Check Summary
uses: test-summary/action@v2
with:
paths: 'reports/typecheck.xml'

0 comments on commit 0a196c7

Please sign in to comment.