Skip to content

Honor user-level workbench.editorAssociations for attachment links (#… #2520

Honor user-level workbench.editorAssociations for attachment links (#…

Honor user-level workbench.editorAssociations for attachment links (#… #2520

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
typos-check:
name: Spell Check with Typos
runs-on: ubuntu-latest
steps:
- name: Checkout Actions Repository
uses: actions/checkout@v6
- name: Check spelling with custom config file
uses: crate-ci/typos@v1.14.8
with:
config: ./typos.toml
lint:
name: Lint
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- uses: actions/checkout@v6
- name: Run oxlint
uses: oxc-project/oxlint-action@v3.0.0
with:
working-directory: packages/foam-vscode
config: .oxlintrc.json
all-files: 'true'
test:
name: Build and Test
# strategy:
# matrix:
# os: [macos-12, ubuntu-22.04, windows-2022]
# runs-on: ${{ matrix.os }}
runs-on: ubuntu-22.04
# env:
# OS: ${{ matrix.os }}
timeout-minutes: 15
steps:
- uses: actions/checkout@v6
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: '22'
- name: Restore Dependencies and VS Code test instance
uses: actions/cache@v5
with:
path: |
node_modules
*/*/node_modules
packages/foam-vscode/.vscode-test
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock', 'packages/foam-vscode/src/test/run-tests.ts') }}-${{ secrets.CACHE_VERSION }}
- name: Install Dependencies
run: yarn
- name: Build Packages
run: yarn build
- name: Test @foam/core
run: yarn workspace @foam/core test
- name: Test @foam/graph-view
run: yarn workspace @foam/graph-view test
- name: Test @foam/cli
run: yarn workspace @foam/cli test
- name: Test foam-vscode
run: xvfb-run --auto-servernum yarn workspace foam-vscode test
performance:
name: Performance Benchmark
# Pinned image on purpose: the perf baseline is machine-specific, so it is
# only valid when compared on the same runner class. A runner-image upgrade
# is a deliberate change — bump PERF_CACHE_VERSION below to reseed the
# baseline when you change it.
runs-on: ubuntu-22.04
timeout-minutes: 10
env:
# Manual version token for the perf baseline cache. Bump this to accept
# new numbers (after an intentional perf change or a runner-image upgrade)
# — the next run finds no baseline and reseeds. Mirrors the CACHE_VERSION
# convention used for the dependency cache.
# v2: workspace bench regrouped by operation (benchmark keys changed)
PERF_CACHE_VERSION: v2
steps:
- uses: actions/checkout@v6
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: '22'
- name: Restore Dependencies and VS Code test instance
uses: actions/cache@v5
with:
path: |
node_modules
*/*/node_modules
packages/foam-vscode/.vscode-test
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock', 'packages/foam-vscode/src/test/run-tests.ts') }}-${{ secrets.CACHE_VERSION }}
- name: Install Dependencies
run: yarn
- name: Build
# foam-vscode's bench renders the real preview pipeline; both packages'
# benches resolve @foam/core to source under vitest, but building keeps
# consumers consistent.
run: yarn build
- name: Restore performance baselines
# Restored AFTER the build: baselines live under out/perf/, which the
# build wipes. actions/cache only re-saves on a cache MISS, so once a key
# exists its baseline is frozen (not overwritten on a hit). Bump
# PERF_CACHE_VERSION to force a reseed. One shared cache entry holds both
# packages' baselines.
uses: actions/cache@v5
with:
path: |
packages/foam-core/out/perf/perf-baseline.json
packages/foam-vscode/out/perf/perf-baseline.json
key: perf-baseline-${{ runner.os }}-${{ env.PERF_CACHE_VERSION }}
# Each package: run the bench once, then compare (scaling shape always +
# baseline if present) and seed the baseline on a cache miss. bench:compare
# fails the job on a >2x regression or a worse-than-expected scaling shape.
- name: Benchmark @foam/core
run: yarn workspace @foam/core bench
- name: Compare @foam/core
run: yarn workspace @foam/core bench:compare
- name: Benchmark foam-vscode
run: yarn workspace foam-vscode bench
- name: Compare foam-vscode
run: yarn workspace foam-vscode bench:compare
- name: Seed baselines if missing
# Runs even if a comparison failed, so a first run always establishes
# both baselines; the post-job cache save then persists them.
if: always()
run: |
yarn workspace @foam/core bench:seed
yarn workspace foam-vscode bench:seed
docs-site-verify:
name: Docs Site Verify
runs-on: ubuntu-22.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: '22'
- name: Restore Dependencies and VS Code test instance
uses: actions/cache@v5
with:
path: |
node_modules
*/*/node_modules
packages/foam-vscode/.vscode-test
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock', 'packages/foam-vscode/src/test/run-tests.ts') }}-${{ secrets.CACHE_VERSION }}
- name: Install Dependencies
run: yarn
- name: Build @foam/core
run: yarn workspace @foam/core build
- name: Publish Foam Docs Site
run: yarn publish:docs-site
- name: Verify Generated Site Shape
run: |
test -f ./.tmp/foam-docs-site/package.json
test -f ./.tmp/foam-docs-site/generated/site-config.json
test -f ./.tmp/foam-docs-site/public/export-routes.json
test -f ./.tmp/foam-docs-site/src/content/docs/index.md
test ! -e ./.tmp/foam-docs-site/src/content/docs/dev