mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-15 12:20:40 -07:00
64 lines
1.7 KiB
YAML
64 lines
1.7 KiB
YAML
name: Test
|
|
on: [workflow_dispatch, workflow_call]
|
|
jobs:
|
|
test:
|
|
name: Test
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest]
|
|
timezone: [Etc/GMT, Asia/Shanghai, America/New_York]
|
|
node-version: [latest]
|
|
include:
|
|
- os: ubuntu-latest
|
|
node-version: lts/*
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
- name: Download artifacts
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: dist-${{ matrix.os }}
|
|
path: dist
|
|
- name: Run Test
|
|
run: TZ=${{ matrix.timezone || 'Etc/GMT' }} npm test
|
|
- name: Archive npm failure logs
|
|
uses: actions/upload-artifact@v4
|
|
if: failure()
|
|
with:
|
|
name: test-npm-logs-${{ matrix.os }}-${{ matrix.node-version }}
|
|
path: ~/.npm/_logs
|
|
demo:
|
|
name: Demo Check
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: latest
|
|
- name: Download artifacts
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: dist-ubuntu-latest
|
|
path: dist
|
|
- name: Run Demo Test
|
|
run: npm run test:demo
|
|
- name: Archive npm failure logs
|
|
uses: actions/upload-artifact@v4
|
|
if: failure()
|
|
with:
|
|
name: demo-npm-logs
|
|
path: ~/.npm/_logs
|