49 lines
1.3 KiB
YAML
49 lines
1.3 KiB
YAML
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
|
|
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
|
|
|
|
name: Node.js Build CI
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- dev
|
|
|
|
pull_request:
|
|
branches: [main, dev]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
matrix:
|
|
node-version: [18.x]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
|
|
- name: Cache pnpm modules
|
|
uses: actions/cache@v3
|
|
env:
|
|
cache-name: cache-pnpm-modules
|
|
with:
|
|
path: ~/.pnpm-store
|
|
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-${{ hashFiles('**/pnpm-lock.yaml') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-${{ hashFiles('**/pnpm-lock.yaml') }}
|
|
- uses: pnpm/action-setup@v2.2.4
|
|
with:
|
|
version: 8.x
|
|
run_install: false
|
|
- name: Install Dependencies
|
|
run: |
|
|
pnpm i
|
|
- name: Test
|
|
run: |
|
|
pnpm run test-unit
|