-
Notifications
You must be signed in to change notification settings - Fork 0
156 lines (126 loc) · 4.31 KB
/
Copy pathdeploy.yml
File metadata and controls
156 lines (126 loc) · 4.31 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
name: CI and Pages
on:
pull_request:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
CARGO_TERM_COLOR: always
UV_PYTHON: '3.13'
jobs:
check:
name: Rust and XML DSL checks
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- name: Check formatting
run: cargo +nightly fmt --all --check
- uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
components: clippy
- uses: Swatinem/rust-cache@v2
- name: Check native Rust
run: cargo clippy --workspace --all-targets --locked -- -D warnings
- name: Check WASM bridge
run: cargo clippy --target wasm32-unknown-unknown --lib --locked -- -D warnings
- name: Test XML DSL and configuration generation
run: cargo test --workspace --locked
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: Verify TOML, JSON and YAML round trips
run: |
cargo run --locked --example fixtures -- .cache/config-editor-fixtures
uvx --with 'PyYAML>=6,<7' python tests/config-editor/roundtrip.py .cache/config-editor-fixtures/roundtrip.json
build:
name: Build and test standalone SPA
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- uses: Swatinem/rust-cache@v2
with:
key: svelte-wasm
- uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- uses: actions/setup-node@v4
with:
node-version: '24'
cache: npm
cache-dependency-path: |
config-editor/package-lock.json
tests/config-editor/package-lock.json
- uses: extractions/setup-just@v4
- name: Install frontend dependencies
run: npm ci --prefix config-editor
- name: Build documentation and standalone editor
run: |
just build
uvx python tests/config-editor/check-site.py
- name: Install browser test dependencies
run: npm ci --prefix tests/config-editor
- name: Install Chromium
working-directory: tests/config-editor
run: npx --no-install playwright install --with-deps chromium
- name: Test the built WASM application
env:
BROWSER_CHANNEL: chromium
run: |
uvx python tests/config-editor/preview-server.py &
preview_pid=$!
trap 'kill "$preview_pid" 2>/dev/null || true' EXIT
curl --fail --silent --show-error --retry 30 --retry-connrefused --retry-delay 1 --retry-max-time 60 \
http://127.0.0.1:8765/config-editor/ > /dev/null
node tests/config-editor/browser.mjs
- name: Verify application reuse with a different XML description
env:
CONFIG_SCHEMA: schema/example.xml
BROWSER_CHANNEL: chromium
run: |
npm run build --prefix config-editor -- --outDir "$PWD/.cache/generic-site"
uvx python tests/config-editor/run-browser.py --directory .cache/generic-site --script tests/config-editor/browser-generic.mjs
- name: Assemble Pages artifact
run: |
mkdir -p "$RUNNER_TEMP/pages"
cp -a site/. "$RUNNER_TEMP/pages/"
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: ${{ runner.temp }}/pages
deploy:
name: Deploy to GitHub Pages
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
needs: [check, build]
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: false
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5