AkurAI Build
Menu

BifrOSt-Apps

public

Latest change f67fd8437552caf5eb9371b0012e81d27c807ca3 - Add native RÚV television application by Ólafur Búi Ólafsson

name: Validate RÚV

on:
  push:
    branches: [main]
    paths:
      - "apps/ruv/**"
      - ".github/workflows/validate-ruv.yml"
  pull_request:
    paths:
      - "apps/ruv/**"
      - ".github/workflows/validate-ruv.yml"
  workflow_dispatch:

permissions:
  contents: read

jobs:
  unit-tests:
    name: Rust unit tests
    runs-on: ubuntu-24.04
    timeout-minutes: 30
    steps:
      - uses: actions/checkout@v5
      - uses: dtolnay/rust-toolchain@1.93.0
      - name: Install native build dependencies
        run: |
          sudo apt-get update
          sudo apt-get install --yes \
            libfontconfig1-dev libgstreamer-plugins-base1.0-dev \
            libgstreamer1.0-dev libudev-dev libwayland-dev \
            libxkbcommon-dev pkg-config
      - name: Test locked sources
        run: cargo test --locked --manifest-path apps/ruv/Cargo.toml

  metadata:
    name: Validate metadata
    runs-on: ubuntu-24.04
    timeout-minutes: 10
    steps:
      - uses: actions/checkout@v5
      - name: Install validators
        run: |
          sudo apt-get update
          sudo apt-get install --yes appstream desktop-file-utils
      - name: Validate desktop and AppStream metadata
        run: |
          desktop-file-validate apps/ruv/data/org.bifrost.Ruv.desktop
          appstreamcli validate --no-net apps/ruv/data/org.bifrost.Ruv.metainfo.xml

  flatpak:
    name: Offline Flatpak candidate
    needs: [unit-tests, metadata]
    runs-on: ubuntu-24.04
    timeout-minutes: 45
    steps:
      - uses: actions/checkout@v5
      - name: Install Flatpak Builder
        run: |
          sudo apt-get update
          sudo apt-get install --yes flatpak flatpak-builder
          flatpak remote-add --user --if-not-exists flathub \
            https://dl.flathub.org/repo/flathub.flatpakrepo
      - name: Acquire pinned sources and runtimes
        run: |
          flatpak-builder --user --install-deps-from=flathub --download-only \
            --force-clean --default-branch=stable .ci-build \
            apps/ruv/org.bifrost.Ruv.yml
      - name: Build stable ref without downloads
        run: |
          flatpak-builder --user --disable-download --force-clean \
            --default-branch=stable --repo=.ci-repo .ci-build \
            apps/ruv/org.bifrost.Ruv.yml 2>&1 | tee ruv-flatpak-build.log
      - name: Inspect ref and create unsigned candidate
        run: |
          refs="$(flatpak repo --refs=.ci-repo)"
          printf '%s\n' "$refs" | grep -Fx \
            "app/org.bifrost.Ruv/x86_64/stable"
          unexpected="$(printf '%s\n' "$refs" | grep -Fvx \
            "app/org.bifrost.Ruv/x86_64/stable" | grep -Fvx \
            "runtime/org.bifrost.Ruv.Debug/x86_64/stable" || true)"
          test -z "$unexpected"
          flatpak build-bundle .ci-repo org.bifrost.Ruv.flatpak \
            org.bifrost.Ruv stable --arch=x86_64
          sha256sum org.bifrost.Ruv.flatpak > org.bifrost.Ruv.flatpak.sha256
          printf '%s\n' "$GITHUB_SHA" > source-revision.txt
          cp apps/ruv/org.bifrost.Ruv.yml org.bifrost.Ruv.yml
      - name: Upload unsigned candidate and evidence
        uses: actions/upload-artifact@v4
        with:
          name: org.bifrost.Ruv-${{ github.sha }}-unsigned
          if-no-files-found: error
          retention-days: 14
          path: |
            org.bifrost.Ruv.flatpak
            org.bifrost.Ruv.flatpak.sha256
            org.bifrost.Ruv.yml
            ruv-flatpak-build.log
            source-revision.txt