Test & Benchmark CI #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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: Test & Benchmark CI | |
on: | |
push: | |
branches: [main] | |
paths: | |
- '*.ts' | |
- '*.js' | |
- '*.json' | |
- '*.jsonc' | |
- '*.yaml' | |
- '.github/**/test-and-benchmark.yml' | |
- '.typedoc/**/*' | |
- 'media/**/*' | |
- 'tests/**/*' | |
- 'scripts/**/*' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
if: "!contains(github.event.head_commit.message, '[skip ci]')" | |
permissions: | |
contents: read | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token | |
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo | |
- name: Setup Node.js environment | |
uses: actions/setup-node@v3 | |
with: | |
# File containing the version Spec of the version to use. Examples: .nvmrc, .node-version, .tool-versions. | |
node-version-file: '.nvmrc' # optional | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
# Version of pnpm to install | |
version: latest # optional | |
# If specified, run `pnpm install` | |
run_install: false # optional, default is null | |
- 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 | |
- name: Build | |
run: pnpm pre-release |