Skip to content

Commit

Permalink
Create pr.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
rishinrahim committed Jan 23, 2025
1 parent dac29c8 commit 821f134
Showing 1 changed file with 102 additions and 0 deletions.
102 changes: 102 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: Pull Request Checks

on:
pull_request:
workflow_dispatch:

jobs:
quality:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Biome
uses: biomejs/setup-biome@v2
with:
version: latest
- name: Run Biome
run: biome ci .

build:
name: Build
runs-on: ubuntu-latest

steps:
- name: Git Checkout
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Restore Cache
uses: actions/cache/restore@v4
with:
path: |
~/.npm
.next/cache
node_modules/.cache
key: cache-${{ hashFiles('package-lock.json') }}-
restore-keys: cache-

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'

- name: Install NPM packages
run: npm ci

- name: Build Next.js
run: |
node --run build
node --run postbuild
- name: Save Cache
uses: actions/cache/save@v4
with:
path: |
~/.npm
.next/cache
node_modules/.cache
key: cache-${{ hashFiles('package-lock.json') }}

unit-test:
name: Unit Test
runs-on: ubuntu-latest

steps:
- name: Git Checkout
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Restore Cache
uses: actions/cache/restore@v4
with:
path: |
~/.npm
.next/cache
node_modules/.cache
key: cache-${{ hashFiles('package-lock.json') }}-
restore-keys: cache-

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'

- name: Install NPM packages
run: npm ci

- name: Run Unit Tests
run: node --run test

- name: Save Cache
uses: actions/cache/save@v4
with:
path: |
~/.npm
.next/cache
node_modules/.cache
key: cache-${{ hashFiles('package-lock.json') }}

0 comments on commit 821f134

Please sign in to comment.