Skip to content

Test

Test #539

Workflow file for this run

name: Test
on:
schedule:
- cron: "0 0 1 * *"
push:
branches:
- master
pull_request:
workflow_call:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
jobs:
test:
name: Test
timeout-minutes: 15
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- macos-latest
- ubuntu-latest
- windows-latest
node-version:
- 16
- 17
- 18
env:
OS: ${{ matrix.os }}
NODE_VERSION: ${{ matrix.node-version }}
steps:
- uses: actions/checkout@v3
- name: Set up node modules cache
id: node-modules-cache
uses: actions/cache@v3
with:
path: '**/node_modules'
key: node-modules-${{ matrix.os }}-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
node-modules-${{ matrix.os }}-${{ matrix.node-version }}-
node-modules-${{ matrix.os }}-
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
if: ${{ steps.node-modules-cache.outputs.cache-hit != 'true' }}
run: npm i --no-fund
- name: Check code styles
run: npm run lint
- name: Build for CommonJS
run: npm run build:cjs
- name: Build for ECMAScript
run: npm run build:esm
- name: Generate code documents
run: npm run docs
test-summary:
name: Test Summary
needs:
- test
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
- name: Check test matrix status
if : ${{ needs.test.result != 'success' }}
run : exit 1