Repository navigation
82 lines (82 loc) · 3.44 KB
/
Copy pathsite-e2e.yml
File metadata and controls
82 lines (82 loc) · 3.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Site E2E
on:
workflow_call:
inputs:
candidate-server:
type: boolean
default: true
workflow_dispatch:
permissions:
contents: read
env:
CARGO_PROFILE_DEV_DEBUG: "0"
CARGO_PROFILE_TEST_DEBUG: "0"
CARGO_INCREMENTAL: "0"
# Update together after a successful release, retaining the verified asset hash.
SITE_SERVER_VERSION: v0.52.3
SITE_SERVER_SHA256: a6c1840a248d6210b0b8f39911e631e913d1403d80b3e338c72d93d5219fb991
jobs:
smoke:
name: Generated React build, lint, and browser tests
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/setup-rust
with:
# Older site caches contain generated node_modules under target.
# Keep this generation separate now that smoke files live in runner.temp.
cache-key: site-v2-${{ inputs.candidate-server && 'candidate' || 'tooling' }}
- uses: pnpm/action-setup@v4
with:
version: 10
- uses: actions/setup-node@v6
with:
node-version: "22"
- name: Build portable candidate generator
if: github.event_name != 'workflow_dispatch' && !inputs.candidate-server
run: |
cargo build --locked --package schema-forge-cli --bin schemaforge --no-default-features
mkdir -p target/site-ci
cp target/debug/schemaforge target/site-ci/generator
echo "GENERATOR_BIN=$GITHUB_WORKSPACE/target/site-ci/generator" >> "$GITHUB_ENV"
- name: Build candidate server
if: github.event_name == 'workflow_dispatch' || inputs.candidate-server
run: |
cargo build --locked --package schema-forge-cli --bin schemaforge
echo "SERVER_BIN=$GITHUB_WORKSPACE/target/debug/schemaforge" >> "$GITHUB_ENV"
echo "GENERATOR_BIN=$GITHUB_WORKSPACE/target/debug/schemaforge" >> "$GITHUB_ENV"
- name: Download pinned validated server
if: github.event_name != 'workflow_dispatch' && !inputs.candidate-server
env:
GH_TOKEN: ${{ github.token }}
run: |
asset="schemaforge-${SITE_SERVER_VERSION}-x86_64-unknown-linux-gnu-surrealdb.tar.gz"
gh release download "$SITE_SERVER_VERSION" --repo "$GITHUB_REPOSITORY" --pattern "$asset" --dir target/site-ci
echo "$SITE_SERVER_SHA256 target/site-ci/$asset" | sha256sum --check --strict
tar -xzf "target/site-ci/$asset" -C target/site-ci
echo "SERVER_BIN=$GITHUB_WORKSPACE/target/site-ci/schemaforge" >> "$GITHUB_ENV"
- name: Run generated app build, lint, and browser smoke
env:
TMP_ROOT: ${{ runner.temp }}/site-e2e
run: cargo run --locked -p schema-forge-test-runner -- ./crates/schema-forge-cli/tests/site_e2e/run.sh
- name: Upload browser artifacts on failure
if: failure()
uses: actions/upload-artifact@v7
with:
name: playwright-report
path: |
crates/schema-forge-cli/tests/site_e2e/playwright/playwright-report
crates/schema-forge-cli/tests/site_e2e/playwright/test-results
if-no-files-found: ignore
retention-days: 7
- name: Upload server logs on failure
if: failure()
uses: actions/upload-artifact@v7
with:
name: site-server-logs
path: |
${{ runner.temp }}/site-e2e/backend.log
${{ runner.temp }}/site-e2e/vite.log
if-no-files-found: ignore
retention-days: 7