feat(ui): add loading skeletons and empty states to data-fetching views #532
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 | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| concurrency: | |
| group: ci-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| rust-checks: | |
| name: Rust Checks | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Free disk space | |
| run: | | |
| sudo rm -rf /usr/share/dotnet | |
| sudo rm -rf /usr/local/lib/android | |
| sudo rm -rf /opt/ghc | |
| sudo rm -rf /opt/hostedtoolcache/CodeQL | |
| sudo docker image prune --all --force || true | |
| df -h | |
| - uses: actions/checkout@v4 | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| build-essential \ | |
| curl \ | |
| wget \ | |
| file \ | |
| libssl-dev \ | |
| pkg-config \ | |
| libgtk-3-dev \ | |
| libayatana-appindicator3-dev \ | |
| librsvg2-dev \ | |
| libsoup-3.0-dev \ | |
| libpipewire-0.3-dev \ | |
| libasound2-dev \ | |
| libdbus-1-dev \ | |
| libxdo-dev | |
| sudo apt-get install -y libwebkit2gtk-4.1-dev libjavascriptcoregtk-4.1-dev \ | |
| || sudo apt-get install -y libwebkit2gtk-4.0-dev libjavascriptcoregtk-4.0-dev | |
| - name: Set up Rust | |
| uses: dtolnay/[email protected] | |
| with: | |
| components: rustfmt, clippy | |
| - name: Rust Cache | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: . -> target | |
| cache-on-failure: false | |
| - name: Rust fmt check | |
| run: cargo fmt --all -- --check | |
| - name: Rust audit | |
| run: | | |
| cargo install cargo-audit --locked | |
| # TODO: Remove RUSTSEC-2025-0008 from ignore list once saorsa-webrtc-codecs updates | |
| # Currently blocked: saorsa-webrtc-codecs 0.2.1 depends on openh264-sys2 0.7.1 | |
| # communitas-core now uses openh264-sys2 0.9.0 (safe) directly as mitigation | |
| # Track upstream fix: https://github.com/saorsalabs/saorsa-webrtc/issues | |
| cargo audit --ignore RUSTSEC-2025-0008 | |
| - name: Build dependencies | |
| run: cargo check --workspace --all-features | |
| - name: Rust clippy policy | |
| run: | | |
| # Run clippy with practical checks on library crates | |
| # Note: unwrap_used/expect_used excluded - too restrictive for test code, | |
| # better caught in code review per CLAUDE.md policy | |
| # Excluded: | |
| # - distributed-test-orchestrator: CLI tool uses println!() | |
| # - clippy::unimplemented: flutter_rust_bridge generates unimplemented!() for web fallbacks | |
| cargo clippy --workspace \ | |
| --exclude distributed-test-orchestrator \ | |
| --all-features -- \ | |
| -D clippy::panic \ | |
| -D clippy::todo \ | |
| -D clippy::print_stdout \ | |
| -D clippy::print_stderr | |
| headless-build: | |
| name: Headless Build & Test (${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| needs: rust-checks | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-24.04 | |
| target: x86_64-unknown-linux-gnu | |
| suffix: "" | |
| - os: macos-latest | |
| target: aarch64-apple-darwin | |
| suffix: "" | |
| - os: windows-latest | |
| target: x86_64-pc-windows-msvc | |
| suffix: ".exe" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup MSVC (Windows) | |
| if: matrix.os == 'windows-latest' | |
| uses: microsoft/setup-msbuild@v2 | |
| - name: Install Rust stable | |
| uses: dtolnay/[email protected] | |
| with: | |
| targets: ${{ matrix.target }} | |
| - name: Rust Cache | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: . -> target | |
| cache-on-failure: false | |
| shared-key: headless-${{ matrix.os }}-${{ matrix.target }} | |
| - name: Build headless | |
| run: cargo build --release -p communitas-headless --target ${{ matrix.target }} | |
| - name: Smoke test (Unix) | |
| if: matrix.os != 'windows-latest' | |
| run: | | |
| target/${{ matrix.target }}/release/communitas-headless --help >/dev/null | |
| target/${{ matrix.target }}/release/communitas-headless --version || true | |
| - name: Smoke test (Windows) | |
| if: matrix.os == 'windows-latest' | |
| shell: pwsh | |
| run: | | |
| target/${{ matrix.target }}/release/communitas-headless.exe --help | Out-Null | |
| target/${{ matrix.target }}/release/communitas-headless.exe --version | |
| - name: Show binary info (Unix) | |
| if: matrix.os != 'windows-latest' | |
| run: | | |
| file target/${{ matrix.target }}/release/communitas-headless || true | |
| ldd target/${{ matrix.target }}/release/communitas-headless | grep 'not found' && { echo 'Missing runtime deps'; exit 1; } || true | |
| - name: Show binary info (Windows) | |
| if: matrix.os == 'windows-latest' | |
| shell: pwsh | |
| run: | | |
| Get-Item target/${{ matrix.target }}/release/communitas-headless.exe | Format-List Length,LastWriteTime | |
| # Basic dep check (Windows doesn't have ldd equivalent in CI) | |
| - name: Upload headless binary | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: communitas-headless-${{ matrix.os }}-${{ github.sha }} | |
| path: target/${{ matrix.target }}/release/communitas-headless${{ matrix.suffix }} | |
| retention-days: 7 | |
| # Integration and E2E tests | |
| integration-tests: | |
| name: Integration Tests | |
| runs-on: ubuntu-24.04 | |
| needs: rust-checks | |
| timeout-minutes: 45 | |
| steps: | |
| - name: Free disk space | |
| run: | | |
| sudo rm -rf /usr/share/dotnet | |
| sudo rm -rf /usr/local/lib/android | |
| sudo rm -rf /opt/ghc | |
| sudo rm -rf /opt/hostedtoolcache/CodeQL | |
| sudo docker image prune --all --force || true | |
| df -h | |
| - uses: actions/checkout@v4 | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| build-essential \ | |
| libssl-dev \ | |
| pkg-config \ | |
| libgtk-3-dev \ | |
| libsoup-3.0-dev \ | |
| libpipewire-0.3-dev \ | |
| libasound2-dev \ | |
| libdbus-1-dev \ | |
| libxdo-dev | |
| sudo apt-get install -y libwebkit2gtk-4.1-dev libjavascriptcoregtk-4.1-dev \ | |
| || sudo apt-get install -y libwebkit2gtk-4.0-dev libjavascriptcoregtk-4.0-dev | |
| - name: Set up Rust | |
| uses: dtolnay/[email protected] | |
| - name: Rust Cache | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: . -> target | |
| cache-on-failure: false | |
| shared-key: tests-ubuntu | |
| - name: Run unit tests | |
| run: cargo test --workspace --lib -- --test-threads=4 | |
| - name: Run integration tests | |
| run: | | |
| echo "Starting integration tests at $(date)" | |
| cargo test --workspace --test '*' -- --test-threads=4 | |
| echo "Finished integration tests at $(date)" | |
| - name: Run property tests | |
| run: cargo test -p communitas-ui-service --test property_tests -- --test-threads=2 | |
| # Stress tests (nightly only) | |
| stress-tests: | |
| name: Stress Tests | |
| runs-on: ubuntu-24.04 | |
| needs: rust-checks | |
| timeout-minutes: 60 | |
| # Only run on schedule or manual trigger | |
| if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| build-essential \ | |
| libssl-dev \ | |
| pkg-config \ | |
| libgtk-3-dev \ | |
| libsoup-3.0-dev \ | |
| libpipewire-0.3-dev \ | |
| libasound2-dev \ | |
| libdbus-1-dev \ | |
| libxdo-dev | |
| sudo apt-get install -y libwebkit2gtk-4.1-dev libjavascriptcoregtk-4.1-dev \ | |
| || sudo apt-get install -y libwebkit2gtk-4.0-dev libjavascriptcoregtk-4.0-dev | |
| - name: Set up Rust | |
| uses: dtolnay/[email protected] | |
| - name: Rust Cache | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: . -> target | |
| cache-on-failure: false | |
| shared-key: stress-ubuntu | |
| - name: Run stress tests | |
| env: | |
| STRESS_DURATION_SECS: "30" | |
| run: cargo test -p communitas-ui-service --test stress -- --ignored --test-threads=1 | |