Skip to content

Tkakar/cat 946 map ensemble ids #3851

Tkakar/cat 946 map ensemble ids

Tkakar/cat 946 map ensemble ids #3851

Workflow file for this run

# Adapted from https://github.com/vega/vega/blob/4b945e22905c610ccc2bdd28471a6f1f80aa1636/.github/workflows/test.yml
name: Test (monorepo)
on:
push:
branches:
- main
pull_request:
jobs:
test-unit:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
node: [18.20.0, 20.10.0, 22]
os: [ubuntu-latest]
include:
- os: windows-2022
node: 18.20.0
name: Test on ${{ matrix.os }} with Node ${{ matrix.node }}
permissions:
# Permissions required for the vitest-coverage-report action
# to be able to leave a comment on the pull request
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v3
with:
# Reference: https://github.com/changesets/changesets/issues/517#issuecomment-1182094769
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- uses: pnpm/action-setup@v4
name: Install pnpm
id: pnpm-install
with:
run_install: true
- run: pnpm run changeset-status
- id: get-options
run: . ./scripts/set-node-options.sh --action
shell: bash
- run: pnpm run build:ci
env:
NODE_OPTIONS: ${{ steps.get-options.outputs.node-options }}
- run: ./scripts/test.sh --action
shell: bash
- run: pnpm run bundle:ci
- run: pnpm run publint
- name: Report coverage
# Generage coverage report even when tests fail,
# but only generate a coverage report once per matrix.
# (Here, we just pick ubuntu and node 18, a bit arbitrarily).
if: ${{ matrix.os == 'ubuntu-latest' && matrix.node == 18 && always() }}
uses: davelosert/vitest-coverage-report-action@v2
test-e2e-demo:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- uses: pnpm/action-setup@v4
name: Install pnpm
id: pnpm-install
with:
run_install: true
- id: get-options
run: . ./scripts/set-node-options.sh --action
shell: bash
- run: |
pnpm run build:ci
cd ./sites/demo
pnpm run build-demo
env:
NODE_OPTIONS: ${{ steps.get-options.outputs.node-options }}
- name: Cypress PNPM Patch
run: cp pnpm-lock.yaml ./sites/demo/package-lock.json
- name: Cypress
uses: cypress-io/github-action@v4
env:
DEBUG: '@cypress/github-action'
with:
working-directory: ./sites/demo
install-command: echo
start: pnpm run preview
wait-on: 'http://localhost:3000'
wait-on-timeout: 240
browser: chrome
headed: false
test-e2e-html:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- uses: pnpm/action-setup@v4
name: Install pnpm
id: pnpm-install
with:
run_install: true
- id: get-options
run: . ./scripts/set-node-options.sh --action
shell: bash
- run: pnpm run build:ci && pnpm run bundle:ci
env:
NODE_OPTIONS: ${{ steps.get-options.outputs.node-options }}
- run: ./scripts/consumer-install.sh
shell: bash
- name: Cypress PNPM Patch
run: cp pnpm-lock.yaml ./sites/html/package-lock.json
- name: Cypress
uses: cypress-io/github-action@v4
env:
DEBUG: '@cypress/github-action'
with:
working-directory: ./sites/html
install-command: echo
start: pnpm run start-html
wait-on: 'http://localhost:3003'
wait-on-timeout: 240
browser: chrome
headed: false
test-e2e-playwright:
# because we take the golden screenshots on macOS locally
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- uses: pnpm/action-setup@v4
name: Install pnpm
id: pnpm-install
with:
run_install: true
- name: Install Playwright Browsers
run: pnpm exec playwright install --with-deps
- id: get-options
run: . ./scripts/set-node-options.sh --action
shell: bash
- run: |
pnpm run build:ci
cd ./sites/demo
pnpm run build-demo
env:
NODE_OPTIONS: ${{ steps.get-options.outputs.node-options }}
- name: Playwright
run: pnpm exec playwright test