Upgrade OS --> 26.04 #2
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: 'install-smoke-test' | |
| # Manual / scheduled smoke test that runs nextcloud_install_production.sh | |
| # end-to-end inside a privileged Ubuntu 26.04 container. Catches: | |
| # - apt package availability changes between LTS releases | |
| # - PHP/PG/Apache config breakage | |
| # - Nextcloud download + occ install regressions | |
| # - lib.sh sourcing / version-gate regressions | |
| # | |
| # Does NOT cover: | |
| # - real LVM snapshot / lvextend behaviour (loopback approximation) | |
| # - hypervisor-specific kernel installs (Hyper-V, VMware, QEMU) | |
| # - reboot path (stubbed) | |
| # | |
| # Manual trigger only β runtime ~25 min, ~3 GB RAM. | |
| on: | |
| pull_request: | |
| workflow_dispatch: | |
| inputs: | |
| ubuntu_image: | |
| description: 'Ubuntu image to test against (e.g. ubuntu:26.04, ubuntu:24.04)' | |
| default: 'ubuntu:26.04' | |
| required: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| install: | |
| name: 'Run nextcloud_install_production.sh -p' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 45 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| # Default checks out the ref that fired workflow_dispatch (so picking | |
| # `upgrade-os-26.04` from the UI tests that branch). | |
| ref: ${{ github.ref }} | |
| - name: Prepare host | |
| run: | | |
| # Loopback devices the install script expects | |
| sudo truncate -s 6G /tmp/disk-sdb.img | |
| sudo losetup -fP /tmp/disk-sdb.img | |
| LOOP_SDB=$(losetup -j /tmp/disk-sdb.img | cut -d: -f1) | |
| echo "LOOP_SDB=$LOOP_SDB" >> "$GITHUB_ENV" | |
| # Show what we created | |
| lsblk | |
| - name: Run install script in privileged container | |
| env: | |
| UBUNTU_IMAGE: ${{ inputs.ubuntu_image || 'ubuntu:26.04' }} | |
| run: | | |
| set -e | |
| docker run --rm \ | |
| --privileged \ | |
| --name nc-install \ | |
| -v "$PWD:/repo:ro" \ | |
| -v "${LOOP_SDB}:/dev/sdb" \ | |
| -e DEBIAN_FRONTEND=noninteractive \ | |
| -e SUDO_USER=root \ | |
| -e RUNLEVEL=1 \ | |
| "$UBUNTU_IMAGE" \ | |
| bash -c ' | |
| set -e | |
| # Bare image bootstrap so the install script can run | |
| apt-get update -qq | |
| apt-get install -qqy --no-install-recommends \ | |
| sudo curl ca-certificates lsb-release iproute2 \ | |
| netcat-openbsd whiptail kmod | |
| # Stub reboot so the script does not actually try to reboot. | |
| # (Using printf instead of heredoc β heredoc closing tag cannot be | |
| # indented inside a YAML run block, which silently swallows the rest | |
| # of the script as heredoc content.) | |
| printf "#!/bin/sh\necho \"[reboot stubbed in CI: \$*]\" >&2\nexit 0\n" \ | |
| > /usr/local/sbin/reboot | |
| chmod +x /usr/local/sbin/reboot | |
| ln -sf /usr/local/sbin/reboot /usr/local/sbin/shutdown | |
| # Make a copy we can edit (script lives in read-only mount) | |
| cp -a /repo /work | |
| cd /work | |
| # Run installer in provisioning mode (no prompts) | |
| bash nextcloud_install_production.sh -p | |
| ' | |
| - name: Verify Nextcloud is installed | |
| if: always() | |
| run: | | |
| # Container exited; attach a fresh one to the same host paths to inspect state | |
| # (Skipped here because container is --rm; rely on script exit code.) | |
| # Show host-side artifacts in case anything was written via bind mount. | |
| ls -la /tmp/disk-sdb.img || true | |
| - name: Cleanup loopback | |
| if: always() | |
| run: | | |
| sudo losetup -d "$LOOP_SDB" || true | |
| sudo rm -f /tmp/disk-sdb.img |