Files
webstudio/.github/workflows/fixtures-test.yml
Bogdan Chadkin e8de913a28 refactor: generalize features fixture (#4820)
We have a fixture which is used for testing generated features.
Historically we use it as vercel template fixture.

Here migrated it to react-router, removed vercel stuff from it and
renamed it to webstudio-features.
2025-02-04 14:03:36 +07:00

81 lines
2.2 KiB
YAML

name: Fixtures tests
on:
workflow_call:
inputs:
builder-url:
required: true
type: string
builder-host:
required: true
type: string
environment:
required: true
type: string
secrets:
PRIVATE_GITHUB_DEPLOY_TOKEN:
required: true
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
checks:
timeout-minutes: 20
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
environment:
name: ${{ inputs.environment }}
env:
DATABASE_URL: postgres://
AUTH_SECRET: test
BUILDER_URL_DEPRECATED: ${{ inputs.builder-url }}
BUILDER_HOST: ${{ inputs.builder-host }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
# Test that everything is working with submodules
- uses: ./.github/actions/submodules-checkout
with:
submodules-ssh-key: ${{ secrets.PRIVATE_GITHUB_DEPLOY_TOKEN }}
- uses: ./.github/actions/ci-setup
# Testing fixtures for vercel template
- name: Test cli --help flag
working-directory: ./fixtures/webstudio-features
run: pnpm cli --help
- name: Testing cli link command
run: pnpm --filter='./fixtures/*' --sequential run fixtures:link
- name: Testing cli sync command
run: pnpm --filter='./fixtures/*' run --parallel fixtures:sync
- name: Testing cli build command
run: pnpm --filter='./fixtures/*' run --parallel fixtures:build
- name: Prepare for diffing
shell: bash
run: |
find . -type f -path "./fixtures/*/.webstudio/data.json" -exec sed -i 's|"origin": ".*"|"origin": "https://main.development.webstudio.is"|g' {} +
- name: Test git diff
# This command will fail if there are uncommitted changes, i.e something has broken
run: git diff --name-only HEAD --exit-code
- name: Show changed files and diff
if: ${{ failure() }}
run: |
echo "Changed files are:"
git diff --name-only HEAD
git diff HEAD | head -n 1000