Test: Visual regression testing with Meticulous #32
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: Meticulous | |
| # Important: The workflow needs to run both on pushes to your main branch and on | |
| # pull requests. It needs to run on your main branch because it'll use the results | |
| # from the base commit of the PR on the main branch to compare against. | |
| on: | |
| push: | |
| branches: [master] | |
| pull_request: {} | |
| # Important: We need the workflow to be triggered on workflow_dispatch events, | |
| # so that Meticulous can run the workflow on the base commit to compare | |
| # against if an existing workflow hasn't run | |
| workflow_dispatch: {} | |
| # Important: The workflow needs all the permissions below. | |
| # These permissions are mainly needed to post and update the status check and | |
| # feedback comment on your PR. Meticulous won't work without them. | |
| permissions: | |
| actions: write | |
| contents: read | |
| issues: write | |
| pull-requests: write | |
| statuses: read | |
| jobs: | |
| test: | |
| name: Meticulous | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 60 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: '10.18.3' | |
| - name: Get pnpm store directory | |
| id: pnpm-cache | |
| shell: bash | |
| run: | | |
| echo "STORE_PATH=$(pnpm store path)" >> "$GITHUB_OUTPUT" | |
| - name: Setup pnpm cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} | |
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm-store- | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build n8n | |
| run: pnpm build:n8n | |
| env: | |
| # Disable turbo cache to ensure fresh builds for comparison | |
| TURBO_FORCE: true | |
| - name: Start n8n server | |
| run: | | |
| cd compiled | |
| ./bin/n8n start & | |
| N8N_PID=$! | |
| echo "n8n started with PID $N8N_PID" | |
| echo "Waiting for n8n to be ready..." | |
| timeout 120 bash -c 'until curl -f http://localhost:5678/favicon.ico > /dev/null 2>&1; do sleep 2; done' || (echo "n8n failed to start" && exit 1) | |
| echo "n8n is ready!" | |
| env: | |
| N8N_PORT: '5678' | |
| N8N_LOG_LEVEL: 'info' | |
| N8N_DIAGNOSTICS_ENABLED: 'false' | |
| N8N_USER_MANAGEMENT_DISABLED: 'true' | |
| N8N_ENCRYPTION_KEY: 'test-encryption-key-for-ci' | |
| - name: Run Meticulous tests | |
| uses: alwaysmeticulous/report-diffs-action/cloud-compute@v1 | |
| with: | |
| api-token: ${{ secrets.METICULOUS_API_TOKEN }} | |
| app-url: 'http://localhost:5678' | |