Fix/pagination #957
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: Web Build | |
| permissions: | |
| contents: read | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| jobs: | |
| web-build: | |
| name: Build Web Target | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install system dependencies | |
| run: sudo apt-get update && sudo apt-get install -y libssl-dev | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: wasm32-unknown-unknown | |
| - name: Cache Rust | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| shared-key: "wasm" | |
| cache-on-failure: true | |
| workspaces: "apps/papillon/frontend -> target" | |
| - name: Install cargo-binstall | |
| uses: cargo-bins/cargo-binstall@main | |
| - name: Cache trunk binary | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/.cargo/bin/trunk | |
| key: trunk-${{ runner.os }}-${{ hashFiles('apps/papillon/frontend/Cargo.lock') }} | |
| restore-keys: trunk-${{ runner.os }}- | |
| - name: Install trunk | |
| run: cargo binstall trunk --no-confirm | |
| - name: Build web with trunk | |
| working-directory: apps/papillon/frontend | |
| run: trunk build --release | |
| - name: Upload web artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: papillon-web | |
| path: apps/papillon/frontend/dist/ | |
| retention-days: 7 | |
| web-smoke-test: | |
| name: Smoke Test (Standalone Web Build) | |
| runs-on: ubuntu-latest | |
| needs: web-build | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Download web artifact | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: papillon-web | |
| path: apps/papillon/frontend/dist/ | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| cache-dependency-path: apps/papillon/e2e/package-lock.json | |
| - name: Cache Playwright browsers | |
| uses: actions/cache@v5 | |
| id: playwright-cache | |
| with: | |
| path: ~/.cache/ms-playwright | |
| key: playwright-${{ runner.os }}-${{ hashFiles('apps/papillon/e2e/package-lock.json', 'e2e/package.json') }} | |
| restore-keys: playwright-${{ runner.os }}- | |
| - name: Install npm dependencies | |
| working-directory: apps/papillon/e2e | |
| run: npm ci | |
| - name: Install Playwright browsers | |
| working-directory: apps/papillon/e2e | |
| if: steps.playwright-cache.outputs.cache-hit != 'true' | |
| run: npx playwright install chromium --with-deps | |
| - name: Install Playwright system deps only | |
| working-directory: apps/papillon/e2e | |
| if: steps.playwright-cache.outputs.cache-hit == 'true' | |
| run: npx playwright install-deps chromium | |
| - name: Run web standalone smoke tests | |
| working-directory: apps/papillon/e2e | |
| run: npx playwright test tests/web-standalone.spec.ts --workers=1 | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: web-smoke-test-results | |
| path: | | |
| apps/papillon/e2e/test-results/ | |
| apps/papillon/e2e/playwright-report/ | |
| retention-days: 7 | |
| web-check: | |
| name: Check Web Target Compilation | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install system dependencies | |
| run: sudo apt-get update && sudo apt-get install -y libssl-dev | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: wasm32-unknown-unknown | |
| - name: Cache Rust | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| shared-key: "wasm" | |
| cache-on-failure: true | |
| - name: Check WASM target | |
| run: cargo build --target wasm32-unknown-unknown -p papillon-shared --no-default-features --features wasm --lib | |
| web-clippy: | |
| name: Clippy (WASM target) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install system dependencies | |
| run: sudo apt-get update && sudo apt-get install -y libssl-dev | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: wasm32-unknown-unknown | |
| components: clippy | |
| - name: Cache Rust | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| shared-key: "wasm" | |
| cache-on-failure: true | |
| - name: Clippy papillon-shared (WASM) | |
| run: cargo clippy --target wasm32-unknown-unknown -p papillon-shared --no-default-features --features wasm --lib -- -D warnings | |
| web-test: | |
| name: Test Web Build | |
| runs-on: ubuntu-latest | |
| needs: web-build | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Download web artifact | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: papillon-web | |
| path: apps/papillon/frontend/dist/ | |
| - name: Verify web app can start | |
| run: | | |
| # Use Python's built-in HTTP server — no npm install needed | |
| cd apps/papillon/frontend/dist/ | |
| python3 -m http.server 8080 & | |
| sleep 1 | |
| curl -f http://localhost:8080/ || exit 1 | |
| echo "Web app served successfully" | |
| web-unit-test: | |
| name: Test papillon-shared (WASM backend) | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache Rust | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| shared-key: "wasm" | |
| cache-on-failure: true | |
| - name: Test papillon-shared with WASM feature | |
| run: cargo test -p papillon-shared --no-default-features --features wasm |