Skip to content

fix(deps): update dependency @sanity/import to ^4.1.1 #51889

fix(deps): update dependency @sanity/import to ^4.1.1

fix(deps): update dependency @sanity/import to ^4.1.1 #51889

Workflow file for this run

name: Unit tests
on:
# Build on pushes branches that have a PR (including drafts)
pull_request:
# don't overide the defaults of opened, synchronize, and reopened
# just add labeling to allow for full test suite running
types: [opened, synchronize, reopened, labeled, unlabeled]
# Build on commits pushed to branches without a PR if it's in the allowlist
push:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
test:
timeout-minutes: 60
name: Test (node ${{ matrix.node }})
runs-on: ubuntu-8core
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
continue-on-error: ${{ matrix.experimental }}
strategy:
# we want to know if a test fails on a specific node version
fail-fast: false
matrix:
node: [20, 22, 24]
experimental: [false]
shardIndex: [1, 2, 3, 4]
shardTotal: [4]
# include:
# - os: windows-latest
# node: 16
# experimental: true
steps:
- uses: actions/checkout@v6
with:
# Full history required for vitest --changed to diff against base branch
fetch-depth: 0
- name: Check if only examples files changed
id: check_examples
uses: ./.github/actions/check-path-only
with:
path: examples/
- uses: ./.github/actions/setup
if: steps.check_examples.outputs.path_only != 'true'
with:
node-version: ${{ matrix.node }}
- name: Build packages
if: steps.check_examples.outputs.path_only != 'true'
run: pnpm build --output-logs=full --log-order=grouped
- name: Test
if: steps.check_examples.outputs.path_only != 'true'
id: test
run: |
# Base arguments for all test runs
ARGS="--test-timeout=60000 --retry 4 --shard=${{ matrix.shardIndex}}/${{ matrix.shardTotal }} --passWithNoTests"
# Add --changed for PRs (unless 'full-test-suite' label is present)
if [ "${{ github.event_name }}" == "pull_request" ] && [ "${{ contains(github.event.pull_request.labels.*.name, 'full-test-suite') }}" != "true" ]; then
ARGS="$ARGS --changed origin/${{ github.base_ref }}"
fi
if [ "${{ matrix.node }}" == "20" ]; then
# We only gather coverage from a single Node version.
# We pass in `--reporter=blob` so that we can combine the results from all shards.
ARGS="$ARGS --coverage --reporter=default --reporter=blob"
fi
pnpm test:vitest $ARGS
env:
GITHUB_SHARD_IDENTIFIER: ${{ matrix.shardIndex }}-${{ matrix.shardTotal }}
- name: Upload blob report to GitHub Actions Artifacts
if: ${{ !cancelled() && matrix.node == '20' && steps.check_examples.outputs.path_only != 'true' }}
uses: actions/upload-artifact@v6
with:
name: blob-report-${{ github.run_id }}-${{ matrix.shardIndex }}
path: ".vitest-reports/*"
include-hidden-files: true
retention-days: 1
report-coverage:
if: ${{ !cancelled() }}
needs: test
runs-on: ubuntu-8core
permissions:
# Required to put a comment into the pull-request
pull-requests: write
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Check if only examples files changed
id: check_examples
uses: ./.github/actions/check-path-only
with:
path: examples/
- uses: ./.github/actions/setup
if: steps.check_examples.outputs.path_only != 'true'
- name: "Download coverage artifacts"
if: steps.check_examples.outputs.path_only != 'true'
uses: actions/download-artifact@v7
with:
path: .vitest-reports
pattern: blob-report-${{ github.run_id }}-*
merge-multiple: true
- name: Merged report
if: steps.check_examples.outputs.path_only != 'true'
id: merge_reports
continue-on-error: true
run: |
pnpm vitest run --merge-reports --coverage
- name: Report coverage
if: steps.check_examples.outputs.path_only != 'true' && steps.merge_reports.outcome == 'success'
uses: davelosert/vitest-coverage-report-action@5b6122e3a819a3be7b27fc961b7faafb3bf00e4d # v2