Skip to content

chore(deps): Bump the playground-dependencies group across 1 directory with 4 updates #109

chore(deps): Bump the playground-dependencies group across 1 directory with 4 updates

chore(deps): Bump the playground-dependencies group across 1 directory with 4 updates #109

Workflow file for this run

name: front-end test
# The playground app is the only TypeScript in this repo, and it is checked by a
# toolchain the Go workflows know nothing about. It gets its own workflow so that a
# front-end change is gated by svelte-check and vitest rather than by `go test`, and
# so that a Node upgrade or a dependabot npm bump fails here instead of surfacing in
# the documentation deployment.
#
# Node only: `npm run build` needs no Go and no WASI artifact — a missing
# public/genspec-wasi.wasm is copied as nothing rather than failing the build. The
# pack that pairs the app with a freshly built artifact is `npm run dist`, and that
# stays in update-doc.yml where it is deployed.
permissions:
contents: read
# NOTE: no "paths" filter here, on purpose. A workflow filtered out by its paths never
# starts, and a required check that never starts leaves the pull request waiting on
# "Expected — waiting for status to be reported". Filtering happens in the "changes"
# job below instead, so "front-end tests completed" reports on every run and can be
# pinned in the branch protection rules.
on:
push:
branches: [ "master" ]
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
changes:
# description: |
# Is there anything here for npm to check? Fails open: anything unclear runs the
# whole lane.
name: Changes
permissions:
contents: read
# A called workflow cannot hold more than its caller grants, and an omitted scope
# is 'none': without this the run is rejected before it starts.
pull-requests: read
uses: go-openapi/ci-workflows/.github/workflows/changed-paths.yml@cba06a2e6390abfedda6bf1067f44741cbe93650 # v0.6.2
with:
preset: front-end
# The producer of the -format=json envelope the app consumes. A change here can
# invalidate the app without touching a line of it, so the lane runs. What decides
# whether the contract still holds is a Go test next to the envelope, since nothing
# in this workflow reads Go.
extra-paths: |
cmd/genspec-wasi/**
test:
name: test
needs: [ changes ]
if: ${{ needs.changes.outputs.changed == 'true' }}
runs-on: ubuntu-latest
defaults:
run:
shell: bash
# On the job and not on the workflow: the gate below checks out nothing, and a
# working directory that does not exist fails the shell before it runs a line.
working-directory: hack/doc-site/genspec-wasi
strategy:
fail-fast: false
matrix:
# Both LTS lines. The doc build pins one of them; the other is what tells us
# a dependabot bump has moved the floor before the pin follows it.
node-version: [ '22', '24' ]
steps:
-
name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: '1'
sparse-checkout: hack/doc-site/genspec-wasi/
-
name: Set up node
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: ${{ matrix.node-version }}
cache: npm
cache-dependency-path: hack/doc-site/genspec-wasi/package-lock.json
-
name: Install dependencies
# npm ci, not npm install: the lock file is what makes this reproducible, and
# CI is not the place to pick up a new minor.
run: npm ci
-
name: Type-check
run: npm run check
-
name: Unit tests
run: npm run test
-
name: Build
run: npm run build
front-end-test-complete:
# description: |
# This is the gate pinned in the branch protection rules, so it MUST report on every
# run, including the runs where everything else was skipped.
#
# Hence "always()" — with the default condition the job would inherit the skip of its
# dependencies and never report — and an assertion on the negative: fail on 'failure'
# and 'cancelled', pass on 'skipped'. A job correctly skipped is then indistinguishable
# from a job that had nothing to do.
#
# "changes" belongs in "needs" too: a job skipped because ITS dependency failed reports
# 'skipped', so leaving the failing one out would turn the gate green over an unchecked
# pull request.
name: front-end tests completed
needs: [ changes, test ]
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
-
name: Report upstream job results
env:
RESULTS: ${{ toJSON(needs) }}
run: |
echo "::group::upstream job results"
printenv RESULTS
echo "::endgroup::"
-
name: Fail on any unsuccessful upstream job
if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}
run: |
echo "::error title=front-end-tests::at least one job failed or was cancelled"
exit 1
-
name: Tests completed
run: |
echo "::notice title=Success::All front-end tests passed"