|
| 1 | +name: 'install-smoke-test' |
| 2 | + |
| 3 | +# Manual / scheduled smoke test that runs nextcloud_install_production.sh |
| 4 | +# end-to-end inside a privileged Ubuntu 26.04 container. Catches: |
| 5 | +# - apt package availability changes between LTS releases |
| 6 | +# - PHP/PG/Apache config breakage |
| 7 | +# - Nextcloud download + occ install regressions |
| 8 | +# - lib.sh sourcing / version-gate regressions |
| 9 | +# |
| 10 | +# Does NOT cover: |
| 11 | +# - real LVM snapshot / lvextend behaviour (loopback approximation) |
| 12 | +# - hypervisor-specific kernel installs (Hyper-V, VMware, QEMU) |
| 13 | +# - reboot path (stubbed) |
| 14 | +# |
| 15 | +# Manual trigger only — runtime ~25 min, ~3 GB RAM. |
| 16 | + |
| 17 | +on: |
| 18 | + workflow_dispatch: |
| 19 | + inputs: |
| 20 | + ubuntu_image: |
| 21 | + description: 'Ubuntu image to test against (e.g. ubuntu:26.04, ubuntu:24.04)' |
| 22 | + default: 'ubuntu:26.04' |
| 23 | + required: true |
| 24 | + |
| 25 | +jobs: |
| 26 | + install: |
| 27 | + name: 'Run nextcloud_install_production.sh -p' |
| 28 | + runs-on: ubuntu-latest |
| 29 | + timeout-minutes: 45 |
| 30 | + steps: |
| 31 | + - name: Checkout |
| 32 | + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 |
| 33 | + with: |
| 34 | + # Default checks out the ref that fired workflow_dispatch (so picking |
| 35 | + # `upgrade-os-26.04` from the UI tests that branch). |
| 36 | + ref: ${{ github.ref }} |
| 37 | + |
| 38 | + - name: Prepare host |
| 39 | + run: | |
| 40 | + # Loopback devices the install script expects |
| 41 | + sudo truncate -s 6G /tmp/disk-sdb.img |
| 42 | + sudo losetup -fP /tmp/disk-sdb.img |
| 43 | + LOOP_SDB=$(losetup -j /tmp/disk-sdb.img | cut -d: -f1) |
| 44 | + echo "LOOP_SDB=$LOOP_SDB" >> "$GITHUB_ENV" |
| 45 | + # Show what we created |
| 46 | + lsblk |
| 47 | +
|
| 48 | + - name: Run install script in privileged container |
| 49 | + env: |
| 50 | + UBUNTU_IMAGE: ${{ inputs.ubuntu_image }} |
| 51 | + run: | |
| 52 | + set -e |
| 53 | + docker run --rm \ |
| 54 | + --privileged \ |
| 55 | + --name nc-install \ |
| 56 | + -v "$PWD:/repo:ro" \ |
| 57 | + -v "${LOOP_SDB}:/dev/sdb" \ |
| 58 | + -e DEBIAN_FRONTEND=noninteractive \ |
| 59 | + -e SUDO_USER=root \ |
| 60 | + -e RUNLEVEL=1 \ |
| 61 | + "$UBUNTU_IMAGE" \ |
| 62 | + bash -c ' |
| 63 | + set -e |
| 64 | + # Bare image bootstrap so the install script can run |
| 65 | + apt-get update -qq |
| 66 | + apt-get install -qqy --no-install-recommends \ |
| 67 | + sudo curl ca-certificates lsb-release iproute2 \ |
| 68 | + netcat-openbsd whiptail kmod |
| 69 | + # Stub reboot so the script does not actually try to reboot |
| 70 | + cat > /usr/local/sbin/reboot <<"REBOOT" |
| 71 | + #!/bin/sh |
| 72 | + echo "[reboot stubbed in CI: $*]" >&2 |
| 73 | + exit 0 |
| 74 | + REBOOT |
| 75 | + chmod +x /usr/local/sbin/reboot |
| 76 | + ln -sf /usr/local/sbin/reboot /usr/local/sbin/shutdown |
| 77 | + # Make a copy we can edit (script lives in read-only mount) |
| 78 | + cp -a /repo /work |
| 79 | + cd /work |
| 80 | + # Run installer in provisioning mode (no prompts) |
| 81 | + bash nextcloud_install_production.sh -p |
| 82 | + ' |
| 83 | +
|
| 84 | + - name: Verify Nextcloud is installed |
| 85 | + if: always() |
| 86 | + run: | |
| 87 | + # Container exited; attach a fresh one to the same host paths to inspect state |
| 88 | + # (Skipped here because container is --rm; rely on script exit code.) |
| 89 | + # Show host-side artifacts in case anything was written via bind mount. |
| 90 | + ls -la /tmp/disk-sdb.img || true |
| 91 | +
|
| 92 | + - name: Cleanup loopback |
| 93 | + if: always() |
| 94 | + run: | |
| 95 | + sudo losetup -d "$LOOP_SDB" || true |
| 96 | + sudo rm -f /tmp/disk-sdb.img |
0 commit comments