Skip to content

Commit

Permalink
Create node.js.yml
Browse files Browse the repository at this point in the history
Replaced npm with pnpm
  • Loading branch information
JohannThapa authored Aug 20, 2024
1 parent 6b7a16d commit c70fac9
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Node.js CI
# {1}
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x, 20.x, 22.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
# {2}
- name: Checkout the source code
- uses: actions/checkout@v4
# {3}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
# {4}
# Install pnpm using the standalone script
- name: Install pnpm
run: curl -fsSL https://get.pnpm.io/install.sh | sh -
# Alternatively, use pnpm env (if needed)
# - name: Install pnpm (using pnpm env)
# run: pnpm env
# {5}
- name: Install dependencies
- run: pnpm install
# {6}
# Optional: Run additional tests (e.g., E2E tests)
- name: Run E2E tests (if applicable)
if: ${{ runner.os == 'linux' }} # Only run on Linux for E2E tests (adjust if needed)
run: pnpm run e2e-ui
# {7}
# Optional: Run code formatting and linting checks
- name: Run code formatting
run: pnpm run prettier:verify
# {8}
- name: Run code linting
run: pnpm run lint
# {9}
- name: Run test
- run: pnpm test
# {10}
- name: Build
- run: pnpm run build --if-present

0 comments on commit c70fac9

Please sign in to comment.