Skip to content
Merged
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
69 changes: 69 additions & 0 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Examples

# Same paths as e2e.yml: the examples, the library they pack, and the tooling that installs both.
on:
push:
branches:
- main
paths:
- "examples/**"
- "package/**"
- ".github/workflows/examples.yml"
- "pnpm-lock.yaml"
- "pnpm-workspace.yaml"
- "mise.toml"
- "mise.lock"
pull_request:
types: [opened, synchronize, reopened]
branches:
- main
paths:
- "examples/**"
- "package/**"
- ".github/workflows/examples.yml"
- "pnpm-lock.yaml"
- "pnpm-workspace.yaml"
- "mise.toml"
- "mise.lock"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions: {}

jobs:
check:
name: Check examples
runs-on: ubuntu-latest
permissions:
contents: read
timeout-minutes: 10
env:
MISE_EXPERIMENTAL: "1"
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: 🛠️ Setup mise
uses: jdx/mise-action@c2a87611a18de5b3828c5652fe268e992400cb5c # v4.3.0
with:
install: true
cache: true
experimental: true

# `mise install` takes no monorepo glob, so each example's own runtime (bun, deno) installs here.
- name: 🧰 Install example tools
run: for d in examples/*/; do mise install --locked -C "$d"; done

- name: 📦 Install root dependencies
run: pnpm install --frozen-lockfile

- name: 🎁 Pack @variablelab/env
run: mise run env:pack

- name: 💅 Lint and typecheck examples
timeout-minutes: 5
run: mise run examples:check
1 change: 1 addition & 0 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ The pull request title takes the same form, because it becomes the squash-merge
- [ ] The pull request title follows Conventional Commits.
- [ ] Tests cover the change: unit tests in `package/src/__tests__/`, and e2e tests in `examples/<name>/test/e2e/` when relevant.
- [ ] `mise run lib:test` and `mise run check` pass locally.
- [ ] `mise run examples:check` passes locally, when the change touches `examples/` or `package/`.
- [ ] `mise run test:e2e` passes locally, at least for the examples the change touches.
- [ ] A changeset is added, if the published `@variablelab/env` changed. See [Changesets](#changesets).
- [ ] The docs are updated, if public API or behavior changed.
Expand Down
5 changes: 3 additions & 2 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,10 @@ On every pull request to `main`:

- **CI** ([`ci.yml`](../.github/workflows/ci.yml)): the library and docs pipeline, inside the pnpm workspace (`package` + `docsite`). It runs `mise run check`, `mise run lib:test` and `mise run lib:build`. On `main`, it also runs the Changesets release job, and for a `feat/*` or `fix/*` branch, or a pull request with the `preview` label, it publishes a [preview release](contributing.md#preview-releases).
- **E2E** ([`e2e.yml`](../.github/workflows/e2e.yml)): a matrix job per example, when the pull request touches `examples/`, `package/`, the workflow itself, the pnpm lockfile or workspace, or the root mise files. Each job sets up its own runtime with `jdx/mise-action` v4.3.0 (with `working_directory: examples/<name>`), packs the library with `mise run env:pack`, and runs `mise run //examples/<name>:test:e2e`.
- **Examples** ([`examples.yml`](../.github/workflows/examples.yml)): one job, on the same paths as E2E, that installs each example's tools, packs the library and runs `mise run examples:check`.
- **Workflow audit** ([`workflow-audit.yml`](../.github/workflows/workflow-audit.yml)): zizmor on the workflows in `.github/`.

CI and E2E use the experimental mise monorepo feature (`MISE_EXPERIMENTAL=1`).
CI, E2E and Examples use the experimental mise monorepo feature (`MISE_EXPERIMENTAL=1`).

Outside pull requests:

Expand Down Expand Up @@ -303,4 +304,4 @@ mise run examples:bump

### CI passes but local fails (or the reverse)

Make sure your local mise is current (`mise self-update`), and that you ran `mise install` from the root and from the example. CI uses `jdx/mise-action` v4.3.0 with `working_directory: examples/<name>` to provision both layers.
Make sure your local mise is current (`mise self-update`), and that you ran `mise install` from the root and from the example. E2E uses `jdx/mise-action` v4.3.0 with `working_directory: examples/<name>` to provision both layers. Examples runs it from the root, then `mise install --locked` in each example.
Loading