|
| 1 | +name: CI (c10s) |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ main ] |
| 6 | + pull_request: |
| 7 | + branches: [ main ] |
| 8 | + workflow_dispatch: |
| 9 | + |
| 10 | +jobs: |
| 11 | + build: |
| 12 | + runs-on: ubuntu-24.04 |
| 13 | + container: |
| 14 | + image: quay.io/centos/centos:stream10 |
| 15 | + |
| 16 | + steps: |
| 17 | + - uses: actions/checkout@v4 |
| 18 | + |
| 19 | + - name: Install build dependencies |
| 20 | + run: | |
| 21 | + dnf clean all |
| 22 | + dnf -y install dnf-utils && dnf config-manager --set-enabled crb |
| 23 | + dnf install -y pkgconfig go-md2man gcc make openssl-devel openssh-clients |
| 24 | +
|
| 25 | + - name: Setup Rust |
| 26 | + uses: dtolnay/rust-toolchain@stable |
| 27 | + with: |
| 28 | + components: rustfmt, clippy |
| 29 | + |
| 30 | + - uses: taiki-e/install-action@nextest |
| 31 | + |
| 32 | + - uses: taiki-e/install-action@just |
| 33 | + |
| 34 | + - name: Cache build artifacts |
| 35 | + uses: Swatinem/rust-cache@v2 |
| 36 | + |
| 37 | + - name: Build |
| 38 | + run: just validate && just build |
| 39 | + |
| 40 | + - name: Run unit tests |
| 41 | + run: just unit |
| 42 | + |
| 43 | + - name: Create integration test archive |
| 44 | + run: cargo nextest archive --release -P integration -p integration-tests --archive-file integration-tests.tar.zst |
| 45 | + |
| 46 | + - name: Upload build artifacts |
| 47 | + uses: actions/upload-artifact@v4 |
| 48 | + with: |
| 49 | + name: bcvk-build |
| 50 | + path: | |
| 51 | + target/release/bcvk |
| 52 | + integration-tests.tar.zst |
| 53 | + retention-days: 1 |
| 54 | + |
| 55 | + test: |
| 56 | + needs: [build] |
| 57 | + runs-on: ubuntu-24.04 |
| 58 | + container: |
| 59 | + image: quay.io/centos-bootc/centos-bootc:stream10 |
| 60 | + options: "--privileged --device=/dev/kvm --volume /var/lib/containers" |
| 61 | + |
| 62 | + env: |
| 63 | + LIBVIRT_DEFAULT_URI: "qemu:///system" |
| 64 | + |
| 65 | + steps: |
| 66 | + - uses: actions/checkout@v4 |
| 67 | + |
| 68 | + - name: Download build artifacts |
| 69 | + uses: actions/download-artifact@v4 |
| 70 | + with: |
| 71 | + name: bcvk-build |
| 72 | + |
| 73 | + - name: List artifacts |
| 74 | + run: | |
| 75 | + echo "Root directory:" |
| 76 | + ls -la |
| 77 | + echo "Looking for target directory:" |
| 78 | + find . -name bcvk -o -name "*.tar.zst" | head -20 |
| 79 | +
|
| 80 | + - name: Make binary executable |
| 81 | + run: | |
| 82 | + if [ -f bcvk ]; then |
| 83 | + chmod +x bcvk |
| 84 | + elif [ -f target/release/bcvk ]; then |
| 85 | + chmod +x target/release/bcvk |
| 86 | + ln -s target/release/bcvk bcvk |
| 87 | + else |
| 88 | + echo "ERROR: bcvk binary not found" |
| 89 | + exit 1 |
| 90 | + fi |
| 91 | +
|
| 92 | + - name: Install runtime dependencies |
| 93 | + run: | |
| 94 | + dnf clean all |
| 95 | + dnf install -y libvirt-daemon libvirt-daemon-driver-qemu libvirt-client qemu-kvm virtiofsd |
| 96 | + # Ensure we have $HOME |
| 97 | + mkdir -p /var/roothome |
| 98 | +
|
| 99 | + - name: Setup Rust |
| 100 | + uses: dtolnay/rust-toolchain@stable |
| 101 | + |
| 102 | + - uses: taiki-e/install-action@nextest |
| 103 | + |
| 104 | + - name: Pull test images |
| 105 | + run: podman pull -q quay.io/fedora/fedora-bootc:42 quay.io/centos-bootc/centos-bootc:stream9 quay.io/centos-bootc/centos-bootc:stream10 |
| 106 | + |
| 107 | + - name: Run integration tests |
| 108 | + run: | |
| 109 | + export BCVK_PATH=$(pwd)/bcvk |
| 110 | + # Note: we only run the ephermeral tests until we debug libvirt-in-container above |
| 111 | + cargo nextest run --archive-file integration-tests.tar.zst ephemeral |
| 112 | +
|
| 113 | + - name: Upload junit XML |
| 114 | + if: always() |
| 115 | + uses: actions/upload-artifact@v4 |
| 116 | + with: |
| 117 | + name: integration-junit-xml |
| 118 | + path: target/nextest/integration/junit.xml |
| 119 | + retention-days: 7 |
0 commit comments