Repository navigation
refactor(config-generator): drop legacy line description syntax #35
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: 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-generator-fixtures | |
| uvx --with 'PyYAML>=6,<7' python tests/config-generator/roundtrip.py .cache/config-generator-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-generator/package-lock.json | |
| tests/config-generator/package-lock.json | |
| - uses: extractions/setup-just@v4 | |
| - name: Install frontend dependencies | |
| run: npm ci --prefix config-generator | |
| - name: Build documentation and standalone generator | |
| run: | | |
| just build | |
| uvx python tests/config-generator/check-site.py | |
| - name: Install browser test dependencies | |
| run: npm ci --prefix tests/config-generator | |
| - name: Install Chromium | |
| working-directory: tests/config-generator | |
| run: npx --no-install playwright install --with-deps chromium | |
| - name: Test the built WASM application | |
| env: | |
| BROWSER_CHANNEL: chromium | |
| run: | | |
| uvx python tests/config-generator/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-generator/ > /dev/null | |
| node tests/config-generator/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-generator -- --outDir "$PWD/.cache/generic-site" | |
| uvx python tests/config-generator/run-browser.py --directory .cache/generic-site --script tests/config-generator/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 |