Skip to content

Add implicit / explit list handling tests #390

Add implicit / explit list handling tests

Add implicit / explit list handling tests #390

Workflow file for this run

name: Test/Publish Workflow
on:
push:
branches: [ main ]
tags:
- '*'
pull_request:
branches: [ main ]
jobs:
test:
name: Test on Node.js ${{ matrix.node-version }}
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x, 21.x, 22.x]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install dependencies
run: npm i --dev
- name: Run code quality checks
run: npm run check
- name: Run tests
run: npm test
- name: Test CLI functionality
run: |
npm run cli -- --help
npm run cli -- parse_tokenset --help
npm run cli -- permutate_tokenset --help
npm run cli -- evaluate_standard_compliance --help
build:
name: Build Library
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build library
run: npm run build
- name: Test built CLI
run: |
./dist/cli.js --help
./dist/cli.js --version
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: |
dist/
!dist/**/*.map
retention-days: 7
stencil-components:
name: Build & Test Stencil Components
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'npm'
- name: Install root dependencies
run: npm ci
- name: Build library
run: npm run build:lib
- name: Install Stencil components dependencies
working-directory: packages/stencil-components
run: npm ci
- name: Build Stencil components
run: npm run build:components
- name: Test Stencil components
run: npm run test:components
- name: Upload Stencil build artifacts
uses: actions/upload-artifact@v4
with:
name: stencil-components-artifacts
path: |
packages/stencil-components/dist/
packages/stencil-components/loader/
retention-days: 7
e2e:
name: E2E Tests - ${{ matrix.example }}
runs-on: ubuntu-latest
needs: [build, stencil-components]
strategy:
fail-fast: false
matrix:
example: [web-repl, runtime-ui, graph-visualization]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'npm'
- name: Install root dependencies
run: npm ci
- name: Build library
run: npm run build:lib
- name: Install Stencil components dependencies
working-directory: packages/stencil-components
run: npm ci
- name: Build Stencil components
run: npm run build:components
- name: Install example dependencies
working-directory: examples/${{ matrix.example }}
run: npm install
- name: Build example app
working-directory: examples/${{ matrix.example }}
run: npm run build
- name: Get Playwright version
id: playwright-version
working-directory: examples/${{ matrix.example }}
run: echo "version=$(npm ls @playwright/test --json | jq -r '.dependencies["@playwright/test"].version // .devDependencies["@playwright/test"].version')" >> $GITHUB_OUTPUT
- name: Cache Playwright browsers
uses: actions/cache@v4
id: playwright-cache
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ steps.playwright-version.outputs.version }}
- name: Install Playwright browsers
if: steps.playwright-cache.outputs.cache-hit != 'true'
working-directory: examples/${{ matrix.example }}
run: npx playwright install --with-deps chromium
- name: Install Playwright system dependencies
if: steps.playwright-cache.outputs.cache-hit == 'true'
run: npx playwright install-deps chromium
- name: Run E2E tests
working-directory: examples/${{ matrix.example }}
run: npm run test:e2e
env:
CI: true
- name: Upload Playwright report
uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report-${{ matrix.example }}
path: examples/${{ matrix.example }}/playwright-report/
retention-days: 7
security:
name: Security Audit
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run security audit
run: npm audit --audit-level=moderate
- name: Check for outdated dependencies
run: npm outdated || true