Skip to content

dl responsive table view #3454

dl responsive table view

dl responsive table view #3454

Workflow file for this run

name: Pull request
on:
pull_request:
push:
branches:
- main
- 'feature/**'
- 'support/**'
workflow_dispatch:
jobs:
build:
name: Build
runs-on: ubuntu-latest
env:
PUPPETEER_SKIP_DOWNLOAD: true
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install and build
uses: ./.github/workflows/actions/build
linting:
name: Code style checks
runs-on: ubuntu-latest
needs: [build]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Restore dependencies (from cache)
uses: actions/cache/restore@v4
with:
fail-on-cache-miss: true
key: npm-install-${{ hashFiles('package-lock.json') }}
path: node_modules
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- name: Run linting
run: npm run lint
tests:
name: Javascript unit tests
runs-on: ubuntu-latest
needs: [build]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Restore dependencies (from cache)
uses: actions/cache/restore@v4
with:
fail-on-cache-miss: true
key: npm-install-${{ hashFiles('package-lock.json') }}
path: node_modules
- name: Restore build (from cache)
uses: actions/cache/restore@v4
with:
fail-on-cache-miss: true
key: build-${{ github.sha }}
path: packages/*/dist/
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- name: Setup Puppeteer
run: npm run install:puppeteer
- name: Run tests
run: npm run test:js -- --coverage
- name: Save test coverage
uses: actions/upload-artifact@v4
with:
name: Javascript unit tests coverage
path: coverage
exports:
name: Package ${{ matrix.conditions }}
runs-on: ubuntu-latest
needs: [build]
strategy:
fail-fast: false
matrix:
conditions:
- require
- import
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Restore dependencies (from cache)
uses: actions/cache/restore@v4
with:
fail-on-cache-miss: true
key: npm-install-${{ hashFiles('package-lock.json') }}
path: node_modules
- name: Restore build (from cache)
uses: actions/cache/restore@v4
with:
fail-on-cache-miss: true
key: build-${{ github.sha }}
path: packages/*/dist/
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- name: Resolve entry path
run: |
node --eval "console.log(require.resolve('nhsuk-frontend'))" --conditions ${{ matrix.conditions }}
node --eval "console.log(require.resolve('nhsuk-frontend/package.json'))" --conditions ${{ matrix.conditions }}
node --eval "console.log(require.resolve('nhsuk-frontend/dist/nhsuk/index.js'))" --conditions ${{ matrix.conditions }}
node --eval "console.log(require.resolve('nhsuk-frontend/dist/nhsuk/index.mjs'))" --conditions ${{ matrix.conditions }}
node --eval "console.log(require.resolve('nhsuk-frontend/dist/nhsuk/nhsuk.js'))" --conditions ${{ matrix.conditions }}
node --eval "console.log(require.resolve('nhsuk-frontend/dist/nhsuk/nhsuk.mjs'))" --conditions ${{ matrix.conditions }}
node --eval "console.log(require.resolve('nhsuk-frontend/dist/nhsuk/components/button/button.js'))" --conditions ${{ matrix.conditions }}
node --eval "console.log(require.resolve('nhsuk-frontend/dist/nhsuk/components/button/button.mjs'))" --conditions ${{ matrix.conditions }}
- name: Resolve entry path (legacy paths)
run: |
node --eval "console.log(require.resolve('nhsuk-frontend/packages/nhsuk'))" --conditions ${{ matrix.conditions }}
node --eval "console.log(require.resolve('nhsuk-frontend/packages/nhsuk.js'))" --conditions ${{ matrix.conditions }}
node --eval "console.log(require.resolve('nhsuk-frontend/packages/components/button/button'))" --conditions ${{ matrix.conditions }}
node --eval "console.log(require.resolve('nhsuk-frontend/packages/components/button/button.js'))" --conditions ${{ matrix.conditions }}
sass:
name: Sass import
needs: [build]
# Run existing "Sass" workflow
# (after build has been cached)
uses: ./.github/workflows/sass.yml
regression:
name: Visual regression tests
runs-on: macos-latest
needs: [build]
if: ${{ github.base_ref == 'main' }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check for changes
uses: ./.github/workflows/actions/diff
id: changes
- name: Download browsers
if: ${{ steps.changes.outputs.changes == 'true' }}
run: |
npm run install:puppeteer
npm run install:playwright
- name: Run backstop
if: ${{ steps.changes.outputs.changes == 'true' }}
run: npm run test:visual --ignore-scripts
- name: Save backstop report
if: ${{ !cancelled() && steps.changes.outputs.changes == 'true' }}
uses: actions/upload-artifact@v4
with:
name: Backstop report
path: tests/backstop/
if-no-files-found: ignore
sonar:
name: Sonar analysis
runs-on: ubuntu-latest
needs: [build, tests]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
steps:
- name: Checkout
if: ${{ env.SONAR_TOKEN }}
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Restore test coverage
if: ${{ env.SONAR_TOKEN }}
uses: actions/download-artifact@v4
with:
name: Javascript unit tests coverage
path: coverage
- name: Sonar analysis
if: ${{ env.SONAR_TOKEN }}
uses: SonarSource/sonarqube-scan-action@v5