Skip to content

[Dialog]: Change Storybook example headings to h1 #1306

[Dialog]: Change Storybook example headings to h1

[Dialog]: Change Storybook example headings to h1 #1306

Workflow file for this run

name: Run tests
on:
# Enable reusing this workflow.
workflow_call:
# Run after PR is merged to main.
push:
branches:
- main
# Run for PR's. External PR's require approval before running checks.
pull_request:
types:
- opened
- reopened
- synchronize
jobs:
build:
name: Build image
uses: ./.github/workflows/build_image.yaml
lint:
name: Lint code
needs:
- build
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: fudis-test
path: /tmp
- name: Load image
run: docker load --input /tmp/fudis-test.image.tar
- name: Run linter
run: docker run -t fudis-test npm run lint
stylelint:
name: Lint styles
needs:
- build
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: fudis-test
path: /tmp
- name: Load image
run: docker load --input /tmp/fudis-test.image.tar
- name: Run stylelint
run: docker run -t fudis-test npm run stylelint
formatting:
name: Check formatting
needs:
- build
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- name: Install dependencies
run: npm ci
- name: Run prettier
run: npm run format:check
component-tests:
name: Component tests
needs:
- build
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: fudis-test
path: /tmp
- name: Load image
run: docker load --input /tmp/fudis-test.image.tar
- name: Run unit tests
run: docker run -te CI=true fudis-test npm test
visual-regression-tests:
name: Visual regression tests
needs:
- build
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: fudis-test
path: /tmp
- name: Load image
run: docker load --input /tmp/fudis-test.image.tar
- name: Start Storybook
run: docker run -d -p 6006:6006 fudis-test npm run storybook
- name: Build Playwright image
run: docker build -t fudis-pw test/
- name: Wait for Storybook server to be up
run: curl --head -X GET --retry 10 --retry-connrefused --retry-delay 5 http://localhost:6006
- name: Create test output directories for mounts
run: mkdir test/test-results test/playwright-report
- name: Run visual regression tests
run: |
docker run -t \
-e CI=true \
-e PLAYWRIGHT_BASE_URL=http://localhost:6006 \
--network=host \
--mount type=bind,source=./test/test-results,target=/usr/src/app/test-results \
--mount type=bind,source=./test/playwright-report,target=/usr/src/app/playwright-report \
fudis-pw
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: test/playwright-report/
- uses: actions/upload-artifact@v4
if: failure()
with:
name: test-results
path: test/test-results/