ci: fix types #10
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' | |
- '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 Deno | |
uses: denoland/setup-deno@v1 | |
with: | |
deno-version: ~1.x | |
- name: Restore deno cache | |
uses: actions/cache@v3 | |
with: | |
key: ${{ runner.os }}-deno-${{ hashFiles('**/deps.lock.json') }} | |
restore-keys: ${{ runner.os }}-deno- | |
path: | | |
~/.cache/deno/deps | |
~/Library/Caches/deno | |
~/AppData/Local/deno/deps | |
- 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: Tests | |
run: deno task test | |
- name: Benchmark | |
run: deno task bench | |
- name: Build | |
run: deno task build |