diff --git a/.github/actions/bootc-ubuntu-setup/action.yml b/.github/actions/bootc-ubuntu-setup/action.yml index b9bdf9174..98b8e32d7 100644 --- a/.github/actions/bootc-ubuntu-setup/action.yml +++ b/.github/actions/bootc-ubuntu-setup/action.yml @@ -1,5 +1,10 @@ name: 'Bootc Ubuntu Setup' description: 'Default host setup' +inputs: + libvirt: + description: 'Install libvirt and virtualization stack' + required: false + default: 'false' runs: using: 'composite' steps: @@ -45,3 +50,20 @@ runs: id: set_arch shell: bash run: echo "ARCH=$(arch)" >> $GITHUB_ENV + # We often use Rust, so set up opinionated default caching + - name: Setup Rust cache + uses: Swatinem/rust-cache@v2 + with: + cache-all-crates: true + # Only generate caches on push to git main + save-if: ${{ github.ref == 'refs/heads/main' }} + # Suppress actually using the cache for builds running from + # git main so that we avoid incremental compilation bugs + lookup-only: ${{ github.ref == 'refs/heads/main' }} + # Install libvirt stack if requested + - name: Install libvirt and virtualization stack + if: ${{ inputs.libvirt == 'true' }} + shell: bash + run: | + set -eux + sudo apt install -y libkrb5-dev pkg-config libvirt-dev genisoimage qemu-utils qemu-kvm qemu-utils libvirt-daemon-system diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 31f2df466..ec673185c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,12 +32,6 @@ jobs: - uses: actions/checkout@v4 - name: Bootc Ubuntu Setup uses: ./.github/actions/bootc-ubuntu-setup - - name: Setup Rust cache - uses: Swatinem/rust-cache@v2 - with: - cache-all-crates: true - save-if: ${{ github.ref == 'refs/heads/main' }} - lookup-only: ${{ github.ref == 'refs/heads/main' }} - name: Validate (default) run: just validate # Build container with continuous repository enabled @@ -47,12 +41,6 @@ jobs: - uses: actions/checkout@v4 - name: Bootc Ubuntu Setup uses: ./.github/actions/bootc-ubuntu-setup - - name: Setup Rust cache - uses: Swatinem/rust-cache@v2 - with: - cache-all-crates: true - save-if: ${{ github.ref == 'refs/heads/main' }} - lookup-only: ${{ github.ref == 'refs/heads/main' }} - name: Build with continuous repo enabled run: sudo just build --build-arg=continuous_repo=1 # Check for security vulnerabilities and license compliance @@ -74,12 +62,6 @@ jobs: uses: actions/checkout@v4 - name: Bootc Ubuntu Setup uses: ./.github/actions/bootc-ubuntu-setup - - name: Setup Rust cache - uses: Swatinem/rust-cache@v2 - with: - cache-all-crates: true - save-if: ${{ github.ref == 'refs/heads/main' }} - lookup-only: ${{ github.ref == 'refs/heads/main' }} - name: Enable fsverity for / run: sudo tune2fs -O verity $(findmnt -vno SOURCE /) - name: Install utils @@ -133,12 +115,6 @@ jobs: - uses: actions/checkout@v4 - name: Bootc Ubuntu Setup uses: ./.github/actions/bootc-ubuntu-setup - - name: Setup Rust cache - uses: Swatinem/rust-cache@v2 - with: - cache-all-crates: true - save-if: ${{ github.ref == 'refs/heads/main' }} - lookup-only: ${{ github.ref == 'refs/heads/main' }} - name: Build mdbook run: just build-mdbook # Build containers and disk images for integration testing across OS matrix @@ -154,14 +130,8 @@ jobs: - uses: actions/checkout@v4 - name: Bootc Ubuntu Setup uses: ./.github/actions/bootc-ubuntu-setup - - name: Setup Rust cache - uses: Swatinem/rust-cache@v2 with: - cache-all-crates: true - save-if: ${{ github.ref == 'refs/heads/main' }} - lookup-only: ${{ github.ref == 'refs/heads/main' }} - - name: Install qemu-utils - run: sudo apt install -y qemu-utils + libvirt: true - name: Build container and disk image run: | @@ -192,12 +162,10 @@ jobs: - uses: actions/checkout@v4 - name: Bootc Ubuntu Setup uses: ./.github/actions/bootc-ubuntu-setup - - name: Install deps - run: | - sudo apt-get update - # see https://tmt.readthedocs.io/en/stable/overview.html#install - sudo apt install -y libkrb5-dev pkg-config libvirt-dev genisoimage qemu-kvm qemu-utils libvirt-daemon-system just - pip install --user "tmt[provision-virtual]" + with: + libvirt: true + - name: Install tmt + run: pip install --user "tmt[provision-virtual]" - name: Create folder to save disk image run: mkdir -p target