2022-12-02 23:43:59 +00:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
name: Test Node.js ${{ matrix.node-version }}
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
node-version:
|
2022-12-10 03:48:17 +00:00
|
|
|
- 19
|
2022-12-02 23:43:59 +00:00
|
|
|
- 18
|
|
|
|
- 16
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Install Node.js
|
|
|
|
uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node-version }}
|
|
|
|
|
|
|
|
- name: Install pnpm
|
|
|
|
uses: pnpm/action-setup@v2
|
|
|
|
id: pnpm-install
|
|
|
|
with:
|
|
|
|
version: 7
|
|
|
|
run_install: false
|
|
|
|
|
|
|
|
- name: Get pnpm store directory
|
|
|
|
id: pnpm-cache
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
|
|
|
|
|
|
|
|
- uses: actions/cache@v3
|
|
|
|
name: Setup pnpm cache
|
|
|
|
with:
|
|
|
|
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
|
|
|
|
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-pnpm-store-
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
|
|
|
|
- name: Run test
|
2022-12-05 23:11:32 +00:00
|
|
|
env:
|
|
|
|
SESSION_TOKEN: 'fake-session-token-for-CI'
|
2022-12-02 23:43:59 +00:00
|
|
|
run: pnpm run test
|