Skip to content

update benchmark, actions #40

update benchmark, actions

update benchmark, actions #40

Workflow file for this run

name: ci
on:
push:
branches:
- main
pull_request:
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6
with:
persist-credentials: false
- uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6
with:
node-version: 22
- run: corepack enable
- name: find pnpm cache path
id: cache
run: echo "path=$(pnpm store path)" >> "$GITHUB_OUTPUT"
- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: ${{ steps.cache.outputs.path }}
key: v1-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
v1-pnpm-
- name: Install dependencies
run: pnpm install --frozen-lockfile
- run: pnpm build
- run: pnpm publint
- uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5
with:
name: dist
path: dist/
bench:
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6
with:
persist-credentials: false
- uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6
with:
name: dist
path: dist/
- uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6
with:
node-version: 22
- run: corepack enable
- name: find pnpm cache path
id: cache
run: echo "path=$(pnpm store path)" >> "$GITHUB_OUTPUT"
- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: ${{ steps.cache.outputs.path }}
key: v1-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
v1-pnpm-
- name: Install dependencies
run: pnpm install --frozen-lockfile
working-directory: ./bench
- run: pnpm run bench
working-directory: ./bench
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6
with:
persist-credentials: false
- uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6
with:
node-version: 22
- run: corepack enable
- name: find pnpm cache path
id: cache
run: echo "path=$(pnpm store path)" >> "$GITHUB_OUTPUT"
- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: ${{ steps.cache.outputs.path }}
key: v1-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
v1-pnpm-
- name: Install dependencies
run: pnpm install --frozen-lockfile
- run: pnpm lint
typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6
with:
persist-credentials: false
- uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6
with:
node-version: 22
- run: corepack enable
- name: find pnpm cache path
id: cache
run: echo "path=$(pnpm store path)" >> "$GITHUB_OUTPUT"
- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: ${{ steps.cache.outputs.path }}
key: v1-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
v1-pnpm-
- name: Install dependencies
run: pnpm install --frozen-lockfile
- run: pnpm typecheck
test:
name: test (${{ matrix.runner }}, node v${{ matrix.node }})
needs: [build]
strategy:
matrix:
runner: [ubuntu-latest, macos-latest, windows-latest]
node: [18, 20, 22, 24]
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6
with:
persist-credentials: false
- uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6
with:
name: dist
path: dist/
- uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6
with:
node-version: ${{ matrix.node }}
- run: corepack enable
- name: find pnpm cache path
id: cache
run: echo "path=$(pnpm store path)" >> "$GITHUB_OUTPUT"
shell: bash
- uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: ${{ steps.cache.outputs.path }}
key: v1-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
v1-pnpm-
- name: Install dependencies
run: pnpm install --frozen-lockfile
- run: pnpm run test