Skip to content

Commit

Permalink
ci: Add Node.js CI workflow
Browse files Browse the repository at this point in the history
Introduce a GitHub Actions workflow to automate testing for the Node.js project. This configuration sets up multiple Node.js versions (18.x, 20.x) and includes steps for dependency installation, building the source code, and running tests.
  • Loading branch information
rustyy committed Aug 3, 2024
1 parent dbba67a commit 870ecd1
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# 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

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

jobs:
build:

runs-on: ubuntu-latest

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

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run build
- run: npm test

0 comments on commit 870ecd1

Please sign in to comment.