Skip to content

Commit

Permalink
ci: Add NPM CI workflow for testing and building
Browse files Browse the repository at this point in the history
  • Loading branch information
supitsdu committed Sep 1, 2024
1 parent 4e588da commit 82f1fc0
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 54 deletions.
54 changes: 0 additions & 54 deletions .github/workflows/node-ci.yml

This file was deleted.

46 changes: 46 additions & 0 deletions .github/workflows/npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: NPM CI

on:
push:
pull_request:
branches: ["main"]

jobs:
build:
name: Test & Build

runs-on: ubuntu-latest

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

steps:
- name: Checkout repository
uses: actions/checkout@v4

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

- name: Display Node.js version
run: node -v

- name: Install dependencies
run: npm ci

- name: Cache node_modules
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Build the project
run: npm run build --if-present

- name: Run tests
run: npm test

0 comments on commit 82f1fc0

Please sign in to comment.