playground-test #2
Workflow file for this run
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: playground-test | |
| on: | |
| push: | |
| branches: [fryd/mkosi-playground] # TEMPORARY: remove | |
| workflow_dispatch: | |
| inputs: | |
| image-run-id: | |
| description: "Reuse image from a previous run (skip build). Leave empty to build fresh." | |
| type: string | |
| default: "" | |
| builder-playground-version: | |
| description: "builder-playground release tag" | |
| default: "v0.3.2-alpha.4" | |
| type: string | |
| jobs: | |
| build: | |
| name: Build playground image | |
| if: inputs.image-run-id == '' | |
| runs-on: warp-ubuntu-2404-x64-32x | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Install mkosi | |
| run: | | |
| sudo apt-get update && sudo apt-get install -y debian-archive-keyring | |
| pip3 install git+https://github.com/systemd/mkosi.git@$(cat .mkosi_version) | |
| - name: Enable user namespaces | |
| run: sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 | |
| - name: Build image | |
| run: | | |
| umask 022 | |
| mkosi --force -I buildernet.conf --profile="devtools,playground" | |
| - name: Show output | |
| run: | | |
| ls -lah mkosi.output/ | |
| sha256sum mkosi.output/buildernet-qemu_*.qcow2 | |
| - name: Upload image | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: buildernet-playground-image | |
| path: mkosi.output/buildernet-qemu_*.qcow2 | |
| retention-days: 14 | |
| # test: | |
| # name: Test playground image | |
| # needs: build | |
| # if: always() && (needs.build.result == 'success' || needs.build.result == 'skipped') | |
| # runs-on: warp-ubuntu-2404-x64-32x | |
| # env: | |
| # PLAYGROUND_VERSION: ${{ inputs.builder-playground-version }} | |
| # steps: | |
| # - name: Download image | |
| # uses: actions/download-artifact@v4 | |
| # with: | |
| # name: buildernet-playground-image | |
| # path: ./image | |
| # run-id: ${{ inputs.image-run-id || github.run_id }} | |
| # github-token: ${{ secrets.GITHUB_TOKEN }} | |
| # | |
| # - name: Verify image | |
| # run: | | |
| # ls -lah ./image/ | |
| # sha256sum ./image/*.qcow2 | |
| # | |
| # - name: Install QEMU and OVMF | |
| # run: | | |
| # sudo apt-get update && sudo apt-get install -y \ | |
| # qemu-system-x86 ovmf jq unzip docker.io | |
| # qemu-system-x86_64 --version | |
| # | |
| # - name: Check KVM | |
| # run: | | |
| # if [ ! -e /dev/kvm ]; then | |
| # echo "::error::KVM not available on this runner. Needs nested virtualization support." | |
| # exit 1 | |
| # fi | |
| # ls -la /dev/kvm | |
| # | |
| # - name: Download builder-playground | |
| # run: | | |
| # DOWNLOAD_URL="https://github.com/flashbots/builder-playground/releases/download/${PLAYGROUND_VERSION}/builder-playground_${PLAYGROUND_VERSION}_linux_amd64.zip" | |
| # curl -fsSL -o builder-playground.zip "${DOWNLOAD_URL}" | |
| # unzip builder-playground.zip | |
| # chmod +x builder-playground | |
| # ./builder-playground version | |
| # | |
| # - name: Generate project | |
| # run: | | |
| # mkdir playground-workspace && cd playground-workspace | |
| # ../builder-playground generate buildernet/mkosi --force | |
| # echo "Generated files:" | |
| # find . -type f | sort | |
| # | |
| # - name: Place VM image | |
| # run: | | |
| # cd playground-workspace | |
| # mkdir -p .flashbots-images/mkosi.output | |
| # cp ../image/buildernet-qemu_*.qcow2 .flashbots-images/mkosi.output/buildernet-qemu_latest.qcow2 | |
| # ls -lah .flashbots-images/mkosi.output/ | |
| # | |
| # - name: Run prepare.sh | |
| # run: | | |
| # cd playground-workspace | |
| # ./prepare.sh | |
| # ls -lah .runtime/ | |
| # | |
| # - name: Start VM | |
| # run: | | |
| # cd playground-workspace | |
| # ./start.sh | |
| # ps aux | grep qemu || true | |
| # cat .runtime/qemu.pid || true | |
| # | |
| # - name: Wait for VM boot | |
| # run: | | |
| # sleep 30 | |
| # cd playground-workspace | |
| # echo "--- console log (first 100 lines) ---" | |
| # head -100 .runtime/console.log || true | |
| # echo "--- console log (last 50 lines) ---" | |
| # tail -50 .runtime/console.log || true | |
| # | |
| # # TODO: start full stack with builder-playground cook | |
| # # TODO: run integration test (builder-playground test --timeout 5m) | |
| # # TODO: collect docker + VM logs on failure | |
| # | |
| # - name: Debug info | |
| # if: always() | |
| # run: | | |
| # cd playground-workspace 2>/dev/null || true | |
| # echo "--- qemu ---" | |
| # ps aux | grep qemu || true | |
| # echo "--- docker ---" | |
| # docker ps -a 2>/dev/null || true | |
| # echo "--- console log (tail) ---" | |
| # tail -100 .runtime/console.log 2>/dev/null || echo "no console log" | |
| # echo "--- disk ---" | |
| # df -h | |
| # | |
| # - name: Cleanup | |
| # if: always() | |
| # run: | | |
| # cd playground-workspace 2>/dev/null || true | |
| # ../builder-playground clean all 2>/dev/null || true |