Check code quality #34
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Check code quality | |
on: | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
check: | |
name: Check code quality | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v2 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: .node-version | |
cache: pnpm | |
- name: 📦 Install dependencies | |
run: pnpm install | |
- name: 🔎 Lint | |
run: pnpm run lint | |
- name: 🔎 Check formatting | |
run: pnpm run format:check | |
- name: 🛠️ Build | |
run: pnpm run build | |
working-directory: packages/sit-onyx | |
- name: 🛠️ Build Storybook | |
run: pnpm run build:storybook | |
working-directory: packages/sit-onyx | |
- name: 🛠️ Build documentation | |
run: pnpm run build | |
working-directory: apps/docs | |
- name: 🚨 Run unit tests | |
run: pnpm run test:unit:coverage | |
working-directory: packages/sit-onyx | |
# install system dependencies for Playwright | |
# see: https://playwright.dev/python/docs/browsers#install-system-dependencies | |
- name: 📦 Install Playwright system dependencies | |
run: pnpm exec playwright install-deps | |
working-directory: packages/sit-onyx | |
- name: 🚨 Run component tests | |
run: pnpm run test:components | |
working-directory: packages/sit-onyx | |
- name: 🔎 Type check Storybook utils | |
run: pnpm run type-check | |
working-directory: packages/storybook-utils | |
- name: 🛠️ Build Figma utils | |
run: pnpm run build | |
working-directory: packages/figma-utils | |
# make sure that publint is only run after all packages have been built | |
- name: Run publint | |
run: pnpm run publint | |
- name: Upload test results artifact | |
uses: actions/upload-artifact@v3 | |
if: always() # needed to also upload test results when they failed (useful for debugging) | |
with: | |
name: test-results | |
path: | | |
packages/sit-onyx/coverage | |
packages/sit-onyx/playwright-report | |
packages/sit-onyx/test-results | |
- name: Upload Storybook artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: storybook-static | |
path: packages/sit-onyx/storybook-static | |
- name: Upload documentation artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: documentation | |
path: apps/docs/src/.vitepress/dist | |
# TODO: remove this, its just needed for testing | |
export: | |
name: Export Figma variables | |
runs-on: ubuntu-latest | |
environment: dev | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v2 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: .node-version | |
cache: pnpm | |
- name: 📦 Install dependencies | |
run: pnpm install | |
- name: 🛠️ Build Figma utils | |
run: pnpm run build | |
working-directory: packages/figma-utils | |
- name: Export variables | |
run: | | |
pnpm run @sit-onyx/figma-utils export-variables -k "${{ vars.FIGMA_FILE_KEY }}" -t "${{ secrets.FIGMA_TOKEN }}" -d "../sit-onyx/src/styles" -m onyx | |
working-directory: packages/figma-utils | |
- name: Create pull request | |
uses: peter-evans/create-pull-request@v5 | |
with: | |
commit-message: "feat: update Figma variables" | |
title: "feat: update Figma variables" | |
body: This is an auto-generated pull request. All Figma variables have been updated / exported. | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
BRANCH_NAME: ${{ github.ref_name }} |