enhance: replace glob with fast-glob #1664
Workflow file for this run
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
name: CI | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- 'v*' | |
pull_request: | |
jobs: | |
install_and_test_win: | |
runs-on: windows-latest | |
timeout-minutes: 5 | |
strategy: | |
matrix: | |
node-version: [20] | |
name: Windows - Node ${{ matrix.node-version }} | |
steps: | |
- uses: actions/[email protected] | |
with: | |
fetch-depth: 0 | |
- uses: pnpm/action-setup@v4 | |
- name: Get pnpm store directory | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
- uses: actions/[email protected] | |
name: Setup pnpm cache | |
with: | |
path: ${{ env.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 --prefer-offline | |
- name: Typecheck | |
run: pnpm typecheck | |
- name: Build | |
run: pnpm build | |
- name: Test | |
shell: cmd | |
run: | | |
pnpm test:ci || exit /b 1 | |
pnpm test:post || exit /b 1 | |
install_and_test: | |
runs-on: [ubuntu-latest] | |
timeout-minutes: 5 | |
strategy: | |
matrix: | |
node-version: [18, 20] | |
name: Linux - Node ${{ matrix.node-version }} | |
steps: | |
- uses: actions/[email protected] | |
with: | |
fetch-depth: 0 | |
- uses: pnpm/action-setup@v4 | |
- name: Get pnpm store directory | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
- uses: actions/[email protected] | |
name: Setup pnpm cache | |
with: | |
path: ${{ env.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 --prefer-offline | |
- name: Typecheck | |
run: pnpm typecheck | |
- name: Build | |
run: pnpm build | |
- name: Test | |
run: | | |
pnpm test:ci | |
pnpm test:post | |
release: | |
runs-on: ubuntu-latest | |
needs: [install_and_test] | |
if: startsWith(github.ref, 'refs/tags/') | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
steps: | |
- uses: actions/[email protected] | |
- uses: pnpm/action-setup@v4 | |
- name: Use Node ${{ matrix.node-version }} | |
uses: actions/[email protected] | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: pnpm | |
- name: Write Auth | |
# https://github.com/pnpm/pnpm/blob/d491da0c08be420362444398ce149b586a74f3cc/.github/workflows/release.yml#L45C11-L45C103 | |
run: npm config set "//registry.npmjs.org/:_authToken" "${NPM_TOKEN}" # pnpm config set is broken | |
- name: Install Dependencies | |
run: pnpm install --frozen-lockfile --prefer-offline | |
- name: Determine tag | |
id: determine_tag | |
run: | | |
echo "tag=$(echo $GITHUB_REF | grep -Eo 'alpha|beta|rc')" >> $GITHUB_OUTPUT | |
- name: Publish to versioned tag | |
if: steps.determine_tag.outputs.tag != '' | |
run: | | |
echo "Publishing to ${{ steps.determine_tag.outputs.tag }} tag" | |
pnpm publish --tag ${{ steps.determine_tag.outputs.tag }} --no-git-checks | |
- name: Publish to latest | |
if: steps.determine_tag.outputs.tag == '' | |
run: | | |
echo "Publishing to latest" | |
pnpm publish --no-git-checks |