feat: add playground for web components #178
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: check cli node compatibility | |
on: | |
workflow_dispatch: | |
pull_request: | |
paths: | |
- 'packages/cli/**' | |
- 'pnpm-lock.yaml' | |
- '.github/workflows/check-cli-node-compatibility.yml' | |
permissions: | |
contents: read | |
jobs: | |
build: | |
name: build (workspace node) | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 | |
# no setup-node here; let pnpm's useNodeVersion rule | |
- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 | |
with: { run_install: false } | |
- name: install (workspace node via useNodeVersion) | |
run: pnpm install | |
- name: build cli | |
run: pnpm --filter "@digdir/designsystemet" build | |
- name: upload dist | |
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
with: | |
name: cli-dist | |
path: packages/cli/dist | |
test: | |
name: node ${{ matrix.node }} • cli | |
needs: build | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
node: [20.x, 21.x, 22.x, 23.x, 24.x] | |
steps: | |
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 | |
- name: neuter pnpm node pin | |
run: | | |
# drop useNodeVersion so pnpm won't hijack | |
sed -i '/^useNodeVersion:/d' pnpm-workspace.yaml || true | |
awk 'BEGIN{skip=0}/^useNodeVersion:/{skip=1;next} skip&&NF==0{skip=0;next}!skip{print}' pnpm-workspace.yaml \ | |
> pnpm-workspace.yaml.tmp && mv pnpm-workspace.yaml.tmp pnpm-workspace.yaml | |
- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 | |
with: { run_install: false } | |
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 | |
with: | |
node-version: ${{ matrix.node }} | |
cache: pnpm | |
- name: print versions | |
run: | | |
node -v | |
pnpm -v | |
- name: install deps for this node | |
run: pnpm install | |
env: | |
PNPM_CONFIG_ENGINE_STRICT: "false" | |
- name: fetch built dist | |
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0 | |
with: | |
name: cli-dist | |
path: packages/cli/dist | |
- name: test cli | |
run: pnpm --filter "@digdir/designsystemet" test |