Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
thir: ${{ steps.check_thir.outputs.changed }}
# Flag for codegen changes
codegen: ${{ steps.check_codegen.outputs.changed }}
# Flag for WOOL changes
wools: ${{ steps.check_wools.outputs.changed }}
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -146,6 +148,38 @@
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- name: Check if WOOLs changed
id: check_wools
env:
MERGE_BASE: ${{ steps.merge_base.outputs.sha }}
run: |
if git diff --quiet "${MERGE_BASE}...HEAD" -- \
':wools/**' \
; then
echo "changed=false" >> "$GITHUB_OUTPUT"
else
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
check-wools:
name: "check wools"
runs-on: ubuntu-latest
needs: determine_changes
if: ${{ needs.determine_changes.outputs.wools == 'true' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/canary' }}
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- name: Install uv
uses: astral-sh/setup-uv@v5

Check warning

Code scanning / CodeQL

Unpinned tag for a non-immutable Action in workflow Medium

Unpinned 3rd party Action 'CI - BAML Language' step
Uses Step
uses 'astral-sh/setup-uv' with ref 'v5', not a pinned commit hash
with:
enable-cache: true
cache-dependency-glob: "uv.lock"

- name: "Check WOOL index"
run: ./wools/scripts/update_wool_readme.py --check

cargo-fmt:
name: "cargo fmt"
runs-on: ubuntu-latest
Expand Down Expand Up @@ -506,9 +540,15 @@
- cargo-test-wasm
- cargo-build-msrv
- snapshot-tests
- check-wools
steps:
- name: "Check test results"
run: |
if [[ "${{ needs.check-wools.result }}" != "success" && "${{ needs.check-wools.result }}" != "skipped" ]]; then
echo "::error::WOOL check failed"
exit 1
fi
if [[ "${{ needs.cargo-fmt.result }}" != "success" && "${{ needs.cargo-fmt.result }}" != "skipped" ]]; then
echo "::error::Formatting check failed"
exit 1
Expand Down
85 changes: 85 additions & 0 deletions .github/workflows/deploy-wools.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Deploy WOOLs to GitHub Pages

on:
push:
branches:
- canary
paths:
- "wools/**"
- ".github/workflows/deploy-wools.yml"
pull_request:
paths:
- "wools/**"
- ".github/workflows/deploy-wools.yml"
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.x

- name: Install MkDocs and dependencies
run: |
pip install mkdocs-material mkdocs-awesome-pages-plugin

- name: Build MkDocs
working-directory: wools
run: mkdocs build

- name: Upload artifact
if: github.event_name == 'push' && github.ref == 'refs/heads/canary'
uses: actions/upload-pages-artifact@v3
with:
path: _site

- name: Setup Node.js
if: github.event_name == 'pull_request'
uses: actions/setup-node@v4
with:
node-version: 20

- name: Deploy to Vercel (Preview)
if: github.event_name == 'pull_request'
env:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN_SAM }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID_WOOLS }}
run: |
npm install -g vercel
vercel deploy _site --token=${{ secrets.VERCEL_TOKEN_SAM }} --yes > preview_url.txt
echo "URL=$(cat preview_url.txt)" >> $GITHUB_ENV

- name: Comment Preview URL
if: github.event_name == 'pull_request'
uses: thollander/[email protected]

Check warning

Code scanning / CodeQL

Unpinned tag for a non-immutable Action in workflow Medium

Unpinned 3rd party Action 'Deploy WOOLs to GitHub Pages' step
Uses Step
uses 'thollander/actions-comment-pull-request' with ref 'v3.0.1', not a pinned commit hash
with:
message: |
🐑 **WOOLs Preview**: ${{ env.URL }}

deploy:
if: github.event_name == 'push' && github.ref == 'refs/heads/canary'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -176,4 +176,4 @@ result

target/

baml-graph/
baml-graph/_site/
8 changes: 8 additions & 0 deletions mise.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ java = "temurin-23"
"cargo:cargo-watch" = "latest"
"cargo:wasm-pack" = "0.13.1"
"cargo:ripgrep" = "latest"
"cargo:just" = "latest"

# Go tools
# locked to match the version in .github/actions/setup-go/action.yml
Expand All @@ -29,6 +30,13 @@ java = "temurin-23"
"npm:pnpm" = "10.14.0"
"npm:@infisical/cli" = "latest"

[tasks]
"wool:readme" = "./wools/scripts/update_wool_readme.py"
"wool:new" = "./wools/scripts/new_wool.py"
"wool:update" = "./wools/scripts/update_wool.py"
"wool:check" = "./wools/scripts/update_wool_readme.py --check"
"wool:serve" = "cd wools && uv run --with mkdocs-material --with mkdocs-awesome-pages-plugin mkdocs serve"

[settings]
experimental = true
# idiomatic_version_file_enable_tools = ["node", "python", "ruby", "go"]
11 changes: 11 additions & 0 deletions scripts/setup-hooks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,17 @@ if ! cargo clippy --workspace --all-targets --all-features -- -D warnings; then
fi
echo -e "${GREEN}✓ Clippy checks passed${NC}"

# Run wool:readme to keep WOOL index up to date
echo -e "${YELLOW}Checking WOOL index...${NC}"
cd "$REPO_ROOT" || exit 1
if command -v mise >/dev/null 2>&1; then
mise run wool:readme
git add wools/README.md 2>/dev/null || true
echo -e "${GREEN}✓ WOOL index updated${NC}"
else
echo -e "${YELLOW}Warning: mise not found, skipping WOOL index update${NC}"
fi

echo ""
echo -e "${GREEN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
echo -e "${GREEN}✓ All pre-commit checks passed!${NC}"
Expand Down
1 change: 1 addition & 0 deletions wools/.obsidian/app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
1 change: 1 addition & 0 deletions wools/.obsidian/appearance.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
33 changes: 33 additions & 0 deletions wools/.obsidian/core-plugins.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"file-explorer": true,
"global-search": true,
"switcher": true,
"graph": true,
"backlink": true,
"canvas": true,
"outgoing-link": true,
"tag-pane": true,
"footnotes": false,
"properties": true,
"page-preview": true,
"daily-notes": true,
"templates": true,
"note-composer": true,
"command-palette": true,
"slash-command": false,
"editor-status": true,
"bookmarks": true,
"markdown-importer": false,
"zk-prefixer": false,
"random-note": false,
"outline": true,
"word-count": true,
"slides": false,
"audio-recorder": false,
"workspaces": false,
"file-recovery": true,
"publish": false,
"sync": true,
"bases": true,
"webviewer": false
}
Loading
Loading