diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b6c407f..c8fa03e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,10 +4,15 @@ on: push: branches: [main] pull_request: + workflow_dispatch: permissions: contents: read +concurrency: + group: ci-${{ github.ref }} + cancel-in-progress: true + jobs: test: name: Tests (Python ${{ matrix.python }}) diff --git a/.github/workflows/image.yml b/.github/workflows/image.yml index 0b23b6a..3a1d361 100644 --- a/.github/workflows/image.yml +++ b/.github/workflows/image.yml @@ -3,6 +3,12 @@ name: Build ISO image on: push: tags: ["v*"] + pull_request: + paths: + - "image/**" + - "scripts/virtuality_firstboot.sh" + - "web/requirements.txt" + - ".github/workflows/image.yml" workflow_dispatch: inputs: arch: @@ -14,6 +20,10 @@ on: permissions: contents: read +concurrency: + group: image-${{ github.ref }} + cancel-in-progress: true + jobs: iso: name: ISO ${{ matrix.arch }} @@ -26,13 +36,22 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - - run: sudo apt-get update && sudo apt-get install -y xorriso + - run: sudo apt-get update && sudo apt-get install -y xorriso python3-yaml - uses: actions/cache@v4 with: path: .cache/iso key: ubuntu-iso-${{ matrix.arch }}-${{ hashFiles('image/build-iso.sh') }} restore-keys: ubuntu-iso-${{ matrix.arch }}- + - name: Free disk space + run: sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL && df -h / - run: make iso ARCH=${{ matrix.arch }} + - name: Check ISO boot records + run: | + iso=$(ls dist/*.iso) + xorriso -indev "$iso" -report_el_torito plain 2>/dev/null | tee /dev/stderr | grep -q "UEFI" + xorriso -osirrox on -indev "$iso" -extract /autoinstall.yaml autoinstall.yaml -extract /boot/grub/grub.cfg grub.cfg + python3 -c "import yaml; d = yaml.safe_load(open('autoinstall.yaml')); assert d['autoinstall']['version'] == 1" + grep -q "Install Virtuality" grub.cfg # Ubuntu server ISOs are larger than the 2 GB GitHub release asset limit, # so images are published as workflow artifacts. - uses: actions/upload-artifact@v4