Skip to content

Refactor

Refactor #51

Workflow file for this run

name: Test
env:
# 7 GiB by default on GitHub, setting to 6 GiB
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
NODE_OPTIONS: --max-old-space-size=6144
# install playwright binary manually (because pnpm only runs install script once)
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '1'
# Vitest auto retry on flaky segfault
VITEST_SEGFAULT_RETRY: 3
concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
cancel-in-progress: true
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
test:
timeout-minutes: 20
runs-on: ${{ matrix.os }}
strategy:
matrix:
# os: [ubuntu-latest]
# node_version: [18]
include:
# Active LTS + other OS
# - os: macos-latest
# node_version: 18
- os: windows-latest
node_version: 18
fail-fast: true
name: 'Build&Test: node-${{ matrix.node_version }}, ${{ matrix.os }}'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8.6.2
- name: Set node version to ${{ matrix.node_version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node_version }}
cache: pnpm
- name: Install deps
run: pnpm install
# Install playwright's binary under custom directory to cache
# - name: Set Playwright path (non-windows)
# if: runner.os != 'Windows'
# run: echo "PLAYWRIGHT_BROWSERS_PATH=$HOME/.cache/playwright-bin" >> $GITHUB_ENV
# - name: Set Playwright path (windows)
# if: runner.os == 'Windows'
# run: echo "PLAYWRIGHT_BROWSERS_PATH=$HOME\.cache\playwright-bin" >> $env:GITHUB_ENV
# - name: Cache Playwright's binary
# uses: actions/cache@v3
# with:
# # Playwright removes unused browsers automatically
# # So does not need to add playwright version to key
# key: ${{ runner.os }}-playwright-bin-v1
# path: ${{ env.PLAYWRIGHT_BROWSERS_PATH }}
# - name: Install Playwright
# run: pnpx [email protected] install chromium
- name: Build
run: pnpm run build
- name: Test
run: pnpm run test:unit
# - name: Test serve
# run: pnpm run test:serve
# - name: Test build
# run: pnpm run test:build
# lint:
# timeout-minutes: 10
# runs-on: ubuntu-latest
# name: 'Lint: node-LTS, ubuntu-latest'
# steps:
# - uses: actions/checkout@v4
# with:
# fetch-depth: 0
# - name: Install pnpm
# uses: pnpm/action-setup@v2
# with:
# version: 8.6.2
# - name: Set node version to LTS
# uses: actions/setup-node@v3
# with:
# node-version: lts/*
# cache: pnpm
# - name: Install deps
# run: pnpm install
# - name: Lint
# run: pnpm run lint