Skip to content

Run prettier

Run prettier #59

name: Smart Forms Build-Test-Lint Workflow
on: [workflow_dispatch, push]
jobs:
build-smart-forms-app:
name: Build Smart Forms App
runs-on: ubuntu-latest
# Run this regardless of "if: github.actor != 'dependabot[bot]'" condition on other jobs to see if dependabot PRs breaks the build
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install dependencies
run: npm ci
- name: Build workspace packages (monorepo dependencies)
run: |
npm run build -w packages/sdc-assemble
npm run build -w packages/sdc-populate
npm run build -w packages/sdc-template-extract
npm run build -w packages/smart-forms-renderer
- name: Build application
run: npm run build -w apps/smart-forms-app
build-demo-app:
name: Build Demo App
runs-on: ubuntu-latest
# Run this regardless of "if: github.actor != 'dependabot[bot]'" condition on other jobs to see if dependabot PRs breaks the build
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install dependencies
run: cd apps/demo-renderer-app && npm ci
- name: Build application
run: cd apps/demo-renderer-app && npm run build
jest-smart-forms-app-tests:
name: Jest Tests - Smart Forms App
runs-on: ubuntu-latest
# Run this regardless of "if: github.actor != 'dependabot[bot]'" condition on other jobs to see if dependabot PRs breaks the build
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install dependencies
run: npm ci
- name: Build workspace packages (monorepo dependencies)
run: |
npm run build -w packages/sdc-assemble
npm run build -w packages/sdc-populate
npm run build -w packages/sdc-template-extract
npm run build -w packages/smart-forms-renderer
- name: Run jest tests
run: npm run test -w apps/smart-forms-app
- uses: codecov/codecov-action@v4
- name: Upload smart-forms-app coverage report to GitHub
uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: smart-forms-renderer-coverage-report
path: packages/smart-forms-app/coverage
retention-days: 30
jest-renderer-tests:
name: Jest Tests - Renderer
runs-on: ubuntu-latest
# Run this regardless of "if: github.actor != 'dependabot[bot]'" condition on other jobs to see if dependabot PRs breaks the build
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install dependencies
run: npm ci
- name: Build workspace packages (monorepo dependencies)
run: |
npm run build -w packages/sdc-assemble
npm run build -w packages/sdc-populate
npm run build -w packages/sdc-template-extract
- name: Run jest tests
run: npm run test -w packages/smart-forms-renderer
- uses: codecov/codecov-action@v4
- name: Upload smart-forms-renderer coverage report to GitHub
uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: smart-forms-renderer-coverage-report
path: packages/smart-forms-renderer/coverage
retention-days: 30
jest-populate-tests:
name: Jest Tests - Populate
runs-on: ubuntu-latest
# Run this regardless of "if: github.actor != 'dependabot[bot]'" condition on other jobs to see if dependabot PRs breaks the build
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install dependencies
run: npm ci
- name: Run jest tests
run: npm run test -w packages/sdc-populate
- uses: codecov/codecov-action@v4
- name: Upload sdc-populate coverage report to GitHub
uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: sdc-populate-coverage-report
path: packages/sdc-populate/coverage
retention-days: 30
storybook-renderer-tests:
name: Storybook Tests - Renderer
runs-on: ubuntu-latest
# Run this regardless of "if: github.actor != 'dependabot[bot]'" condition on other jobs to see if dependabot PRs breaks the build
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install dependencies
run: npm ci
- name: Build workspace packages (monorepo dependencies)
run: |
npm run build -w packages/sdc-assemble
npm run build -w packages/sdc-populate
npm run build -w packages/sdc-template-extract
- name: Install Playwright browsers
run: npx playwright install --with-deps
- name: Serve Storybook Dev and run tests
run: npm run test-storybook-ci -w packages/smart-forms-renderer
jest-assemble-tests:
name: Jest Tests - Assemble
runs-on: ubuntu-latest
# Run this regardless of "if: github.actor != 'dependabot[bot]'" condition on other jobs to see if dependabot PRs breaks the build
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install dependencies
run: npm ci
- name: Run jest tests
run: npm run test -w packages/sdc-assemble
- uses: codecov/codecov-action@v4
- name: Upload sdc-assemble coverage report to GitHub
uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: sdc-assemble-coverage-report
path: packages/sdc-assemble/coverage
retention-days: 30
jest-extract-tests:
name: Jest Tests - Template-Based Extract
runs-on: ubuntu-latest
# Run this regardless of "if: github.actor != 'dependabot[bot]'" condition on other jobs to see if dependabot PRs breaks the build
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install dependencies
run: npm ci
- name: Run jest tests
run: npm run test -w packages/sdc-template-extract
- uses: codecov/codecov-action@v4
- name: Upload sdc-template-extract coverage report to GitHub
uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: sdc-template-extract-coverage-report
path: packages/sdc-template-extract/coverage
retention-days: 30
playwright-test:
name: Playwright Tests
timeout-minutes: 60
runs-on: ubuntu-latest
# Conditional logic to skip if workflow is triggered by Dependabot
if: github.actor != 'dependabot[bot]'
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install dependencies
run: npm ci
- name: Build workspace packages (monorepo dependencies)
run: |
npm run build -w packages/sdc-assemble
npm run build -w packages/sdc-populate
npm run build -w packages/sdc-template-extract
npm run build -w packages/smart-forms-renderer
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
run: npm run playwright -w apps/smart-forms-app
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: apps/smart-forms-app/playwright-report/
retention-days: 30
lint:
name: Lint
runs-on: ubuntu-latest
# Run this regardless of "if: github.actor != 'dependabot[bot]'" condition on other jobs to see if dependabot PRs breaks the build
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install dependencies
run: npm ci
- name: Run linter
run: npm run lint
- name: Run prettier
run: npm run prettier