mirror of
https://github.com/webstudio-is/webstudio.git
synced 2026-10-28 23:57:17 +09:00
86 lines
2.4 KiB
YAML
86 lines
2.4 KiB
YAML
name: Fixtures tests
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
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_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:local --help
|
|
|
|
- name: Testing cli link command
|
|
run: pnpm --filter='./fixtures/*' --sequential run fixtures:link
|
|
|
|
- name: Testing cli sync command
|
|
shell: bash
|
|
run: |
|
|
set +e
|
|
pnpm --filter='./fixtures/*' --sequential run fixtures:sync 2>&1 | tee fixtures-sync.log
|
|
sync_status=${PIPESTATUS[0]}
|
|
if [ "$sync_status" -ne 0 ]; then
|
|
message=$(tail -n 40 fixtures-sync.log | sed -e 's/%/%25/g' -e 's/\r/%0D/g' -e 's/$/%0A/' | tr -d '\n')
|
|
echo "::error title=Fixture sync failed::$message"
|
|
exit "$sync_status"
|
|
fi
|
|
|
|
- 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
|