feature: editor enhancements #16
Workflow file for this run
This file contains hidden or 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: Verify PR | |
| on: | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| detect-changes: | |
| name: Detect changes | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| outputs: | |
| lint: ${{ steps.filter.outputs.lint }} | |
| screen-test: ${{ steps.filter.outputs.screen-test }} | |
| unit-test: ${{ steps.filter.outputs.unit-test }} | |
| build: ${{ steps.filter.outputs.build }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - uses: dorny/paths-filter@v3 | |
| id: filter | |
| with: | |
| filters: | | |
| lint: | |
| - '**/*.{js,ts,jsx,tsx,mjs,mts,css,json}' | |
| - 'pnpm-lock.yaml' | |
| screen-test: | |
| - '**/*.{js,ts,jsx,tsx,mjs,mts,css,json}' | |
| - '**/__screenshots__/**' | |
| - 'pnpm-lock.yaml' | |
| unit-test: | |
| - '**/*.{js,ts,jsx,tsx,mjs,mts,css,json}' | |
| - 'pnpm-lock.yaml' | |
| build: | |
| - '**/*.{js,ts,jsx,tsx,mjs,mts,css,json}' | |
| - 'pnpm-lock.yaml' | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| needs: detect-changes | |
| if: needs.detect-changes.outputs.lint == 'true' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| run_install: false | |
| - name: Install Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: .nvmrc | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Run linter | |
| run: pnpm exec turbo lint | |
| unit-test: | |
| name: Unit tests | |
| runs-on: ubuntu-latest | |
| needs: detect-changes | |
| if: needs.detect-changes.outputs.unit-test == 'true' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| run_install: false | |
| - name: Install Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: .nvmrc | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Run unit tests | |
| run: pnpm exec turbo test:unit | |
| screen-test: | |
| name: Screen tests | |
| runs-on: macos-latest | |
| needs: detect-changes | |
| if: needs.detect-changes.outputs.screen-test == 'true' | |
| strategy: | |
| matrix: | |
| package: | |
| - packages/ui-kit | |
| - packages/synth | |
| - packages/editor | |
| - apps/synth-playground | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| run_install: false | |
| - name: Install Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: .nvmrc | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Run screen tests | |
| working-directory: ${{ matrix.package }} | |
| run: pnpm exec turbo test:screen | |
| - name: Prepare report artifact name | |
| id: prepare-report-artifact | |
| if: ${{ !cancelled() }} | |
| run: echo "name=${{ matrix.package }}" | sed 's|/|--|g' >> "$GITHUB_OUTPUT" | |
| - name: Upload report | |
| uses: actions/upload-artifact@v4 | |
| if: ${{ !cancelled() }} | |
| with: | |
| name: ${{ steps.prepare-report-artifact.outputs.name }}-playwright-report | |
| path: ${{ matrix.package }}/playwright-report/ | |
| retention-days: 30 | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| needs: detect-changes | |
| if: needs.detect-changes.outputs.build == 'true' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| run_install: false | |
| - name: Install Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: .nvmrc | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Build | |
| run: pnpm exec turbo build | |
| verify-pr: | |
| name: Verify PR | |
| runs-on: ubuntu-latest | |
| if: always() | |
| needs: | |
| - lint | |
| - unit-test | |
| - screen-test | |
| - build | |
| steps: | |
| - name: Check completed jobs | |
| uses: re-actors/alls-green@release/v1 | |
| with: | |
| jobs: ${{ toJSON(needs) }} | |
| allowed-skips: ${{ toJSON(needs) }} |