diff --git a/.github/workflows/acceptance-tests.yml b/.github/workflows/acceptance-tests.yml index b8f2cd55c36..ed5dfb3f75c 100644 --- a/.github/workflows/acceptance-tests.yml +++ b/.github/workflows/acceptance-tests.yml @@ -72,6 +72,12 @@ jobs: extensions: curl, xml, mbstring, zip, ldap, gd tools: composer + - name: Install libvips-dev for ENABLE_VIPS build + run: | + sudo apt-get update -qq + # NEEDRESTART_MODE=a: auto-restart services silently; without this, needrestart can fail with exit code 6 + sudo NEEDRESTART_MODE=a apt-get install -y libvips-dev + - name: Pre-checks and generate run: | # Phase 1 — I/O + light CPU, no contention between tasks. @@ -118,9 +124,10 @@ jobs: # from the ocis build. Critical path = ocis build (~300 s). vmstat 2 > /tmp/vmstat-phase2.log & MONITOR_PID=$! - make ci-golangci-lint > /tmp/golangci-lint.log 2>&1 & PIDS=($!) - make -C ocis build > /tmp/ocis-build.log 2>&1 & PIDS+=($!) - make test > /tmp/unit-tests.log 2>&1 & PIDS+=($!) + make ci-golangci-lint > /tmp/golangci-lint.log 2>&1 & PIDS=($!) + ENABLE_VIPS=true make -C ocis build > /tmp/ocis-build.log 2>&1 & PIDS+=($!) + make test > /tmp/unit-tests.log 2>&1 & PIDS+=($!) + GOWORK=off make -C tests/ociswrapper build > /tmp/ociswrapper-build.log 2>&1 & PIDS+=($!) FAILED=0 for PID in "${PIDS[@]}"; do wait "$PID" || FAILED=1; done @@ -132,12 +139,23 @@ jobs: END { printf "=== phase 2 load (2 vCPU): avg busy %d%% peak %d%% | avg runq %.0f peak %d | avg wa %d%%\n", sum_b/n, pk_b, sum_r/n, pk_r, sum_wa/n }' /tmp/vmstat-phase2.log - echo "=== golangci-lint ==="&& cat /tmp/golangci-lint.log - echo "=== ocis build ===" && cat /tmp/ocis-build.log - echo "=== unit tests ===" && cat /tmp/unit-tests.log + echo "=== golangci-lint ===" && cat /tmp/golangci-lint.log + echo "=== ocis build ===" && cat /tmp/ocis-build.log + echo "=== ociswrapper build ===" && cat /tmp/ociswrapper-build.log + echo "=== unit tests ===" && cat /tmp/unit-tests.log exit $FAILED + - name: Upload build artifacts + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + with: + name: ocis-build-artifacts + path: | + ocis/bin/ocis + tests/ociswrapper/bin/ociswrapper + retention-days: 1 + if-no-files-found: error + local-api-tests: name: ${{ matrix.suite }} needs: [build-and-test] @@ -190,17 +208,6 @@ jobs: - apiCollaboration steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 - with: - go-version-file: go.mod - cache: true - - - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 - with: - node-version: "24" - - - name: Enable pnpm - run: corepack enable && corepack prepare pnpm@10.28.1 --activate - uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # v2.37.0 with: @@ -216,9 +223,7 @@ jobs: key: libcurl-8.12.0-${{ runner.os }} - name: Install libcurl 8.12.0 build dependencies - # Always run: libvips-dev is needed at runtime (govips thumbnails) and for - # pkg-config --exists vips to succeed so oCIS is built with ENABLE_VIPS=true. - # Skipping this on cache hit would cause oCIS to fall back to the imaging library. + # Always run: libvips-dev is needed at runtime (govips thumbnails in the pre-built binary) run: | sudo apt-get update -qq # NEEDRESTART_MODE=a: auto-restart services silently; without this, needrestart can fail with exit code 6 @@ -252,6 +257,14 @@ jobs: } ' + - name: Download build artifacts + uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 + with: + name: ocis-build-artifacts + + - name: Restore binary permissions + run: chmod +x ocis/bin/ocis tests/ociswrapper/bin/ociswrapper + - name: Run ${{ matrix.suite }} run: BEHAT_SUITES=${{ matrix.suite }} python3 tests/acceptance/run-github.py @@ -266,17 +279,6 @@ jobs: - cliCommands,apiServiceAvailability # grouped: both need ClamAV + email services steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 - with: - go-version-file: go.mod - cache: true - - - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 - with: - node-version: "24" - - - name: Enable pnpm - run: corepack enable && corepack prepare pnpm@10.28.1 --activate - uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # v2.37.0 with: @@ -284,6 +286,20 @@ jobs: extensions: curl, xml, mbstring, zip, ldap, gd tools: composer + - name: Install libvips runtime + run: | + sudo apt-get update -qq + # NEEDRESTART_MODE=a: auto-restart services silently; without this, needrestart can fail with exit code 6 + sudo NEEDRESTART_MODE=a apt-get install -y libvips42t64 + + - name: Download build artifacts + uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 + with: + name: ocis-build-artifacts + + - name: Restore binary permissions + run: chmod +x ocis/bin/ocis tests/ociswrapper/bin/ociswrapper + - name: Run ${{ matrix.suite }} run: BEHAT_SUITES="${{ matrix.suite }}" python3 tests/acceptance/run-github.py @@ -306,17 +322,6 @@ jobs: - "coreApiWebdavMove1,coreApiWebdavPreviews,coreApiWebdavUpload,coreApiWebdavUploadTUS" steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 - with: - go-version-file: go.mod - cache: true - - - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 - with: - node-version: "24" - - - name: Enable pnpm - run: corepack enable && corepack prepare pnpm@10.28.1 --activate - uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # v2.37.0 with: @@ -332,9 +337,7 @@ jobs: key: libcurl-8.12.0-${{ runner.os }} - name: Install libcurl 8.12.0 build dependencies - # Always run: libvips-dev is needed at runtime (govips thumbnails) and for - # pkg-config --exists vips to succeed so oCIS is built with ENABLE_VIPS=true. - # Skipping this on cache hit would cause oCIS to fall back to the imaging library. + # Always run: libvips-dev is needed at runtime (govips thumbnails in the pre-built binary) run: | sudo apt-get update -qq # NEEDRESTART_MODE=a: auto-restart services silently; without this, needrestart can fail with exit code 6 @@ -368,6 +371,14 @@ jobs: } ' + - name: Download build artifacts + uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 + with: + name: ocis-build-artifacts + + - name: Restore binary permissions + run: chmod +x ocis/bin/ocis tests/ociswrapper/bin/ociswrapper + - name: Run ${{ matrix.suite }} run: > BEHAT_SUITES="${{ matrix.suite }}" @@ -408,23 +419,29 @@ jobs: oidc_iframe: true steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 - with: - go-version-file: go.mod - cache: true - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 with: # 24.16.0 breaks playwright install (yauzl zip extraction hangs); pin to last known good. # https://github.com/microsoft/playwright/issues/40724 node-version: "24.15.0" - name: Enable pnpm - run: corepack enable && corepack prepare pnpm@10.28.1 --activate - - name: Generate code run: | + corepack enable && corepack prepare pnpm@10.28.1 --activate pnpm config set store-dir ./.pnpm-store - make ci-node-generate - env: - CHROMEDRIVER_SKIP_DOWNLOAD: "true" + + - name: Install libvips runtime + run: | + sudo apt-get update -qq + # NEEDRESTART_MODE=a: auto-restart services silently; without this, needrestart can fail with exit code 6 + sudo NEEDRESTART_MODE=a apt-get install -y libvips42t64 + + - name: Download build artifacts + uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 + with: + name: ocis-build-artifacts + + - name: Restore binary permissions + run: chmod +x ocis/bin/ocis tests/ociswrapper/bin/ociswrapper - name: Cache Playwright Chromium uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 @@ -513,10 +530,21 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 + + - name: Install libvips runtime + run: | + sudo apt-get update -qq + # NEEDRESTART_MODE=a: auto-restart services silently; without this, needrestart can fail with exit code 6 + sudo NEEDRESTART_MODE=a apt-get install -y libvips42t64 + + - name: Download build artifacts + uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 with: - go-version-file: go.mod - cache: true + name: ocis-build-artifacts + + - name: Restore binary permissions + run: chmod +x ocis/bin/ocis + - name: Run litmus run: python3 tests/acceptance/run-litmus.py @@ -526,10 +554,21 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 + + - name: Install libvips runtime + run: | + sudo apt-get update -qq + # NEEDRESTART_MODE=a: auto-restart services silently; without this, needrestart can fail with exit code 6 + sudo NEEDRESTART_MODE=a apt-get install -y libvips42t64 + + - name: Download build artifacts + uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 with: - go-version-file: go.mod - cache: true + name: ocis-build-artifacts + + - name: Restore binary permissions + run: chmod +x ocis/bin/ocis + - name: Run cs3api validator run: python3 tests/acceptance/run-cs3api.py @@ -539,10 +578,21 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 + + - name: Install libvips runtime + run: | + sudo apt-get update -qq + # NEEDRESTART_MODE=a: auto-restart services silently; without this, needrestart can fail with exit code 6 + sudo NEEDRESTART_MODE=a apt-get install -y libvips42t64 + + - name: Download build artifacts + uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 with: - go-version-file: go.mod - cache: true + name: ocis-build-artifacts + + - name: Restore binary permissions + run: chmod +x ocis/bin/ocis + - name: Run WOPI validator (builtin) run: python3 tests/acceptance/run-wopi.py --type builtin @@ -552,10 +602,21 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 + + - name: Install libvips runtime + run: | + sudo apt-get update -qq + # NEEDRESTART_MODE=a: auto-restart services silently; without this, needrestart can fail with exit code 6 + sudo NEEDRESTART_MODE=a apt-get install -y libvips42t64 + + - name: Download build artifacts + uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 with: - go-version-file: go.mod - cache: true + name: ocis-build-artifacts + + - name: Restore binary permissions + run: chmod +x ocis/bin/ocis + - name: Run WOPI validator (cs3) run: python3 tests/acceptance/run-wopi.py --type cs3 diff --git a/tests/acceptance/run-cs3api.py b/tests/acceptance/run-cs3api.py index 0d9de34cb72..f637e82520f 100644 --- a/tests/acceptance/run-cs3api.py +++ b/tests/acceptance/run-cs3api.py @@ -84,7 +84,8 @@ def main() -> int: ocis_bin = repo_root / "ocis/bin/ocis" ocis_config_dir = Path.home() / ".ocis/config" - subprocess.run(["make", "-C", str(repo_root / "ocis"), "build"], check=True) + if not ocis_bin.exists(): + subprocess.run(["make", "-C", str(repo_root / "ocis"), "build"], check=True) # Docker bridge gateway IP: reachable from both the host and Docker containers. # cs3api-validator connects to the GRPC gateway at {bridge_ip}:9142. diff --git a/tests/acceptance/run-github.py b/tests/acceptance/run-github.py index 4e11fd085ee..e35dc301bf3 100755 --- a/tests/acceptance/run-github.py +++ b/tests/acceptance/run-github.py @@ -368,19 +368,20 @@ def main() -> int: f"antivirus={cfg['antivirusNeeded']} federation={cfg['federationServer']} " f"wopi={cfg['collaborationServiceNeeded']}") - # generate IDP web assets (required for IDP service to start; matches drone ci-node-generate) - run(["make", "-C", str(repo_root / "services/idp"), "ci-node-generate"]) - # download web UI assets (required for robots.txt and other static assets; no pnpm needed) - run(["make", "-C", str(repo_root / "services/web"), "ci-node-generate"]) + if not ocis_bin.exists(): + # generate IDP/web assets and build (skipped when pre-built binary is provided) + run(["make", "-C", str(repo_root / "services/idp"), "ci-node-generate"]) + run(["make", "-C", str(repo_root / "services/web"), "ci-node-generate"]) - # build (ENABLE_VIPS=true when libvips-dev is installed, matching drone) - build_env = {} - if subprocess.run(["pkg-config", "--exists", "vips"], - capture_output=True).returncode == 0: - build_env["ENABLE_VIPS"] = "true" - run(["make", "-C", str(repo_root / "ocis"), "build"], env=build_env) - run(["make", "-C", str(repo_root / "tests/ociswrapper"), "build"], - env={"GOWORK": "off"}) + build_env = {} + if subprocess.run(["pkg-config", "--exists", "vips"], + capture_output=True).returncode == 0: + build_env["ENABLE_VIPS"] = "true" + run(["make", "-C", str(repo_root / "ocis"), "build"], env=build_env) + + if not wrapper_bin.exists(): + run(["make", "-C", str(repo_root / "tests/ociswrapper"), "build"], + env={"GOWORK": "off"}) # php deps run(["composer", "install", "--no-progress"], diff --git a/tests/acceptance/run-litmus.py b/tests/acceptance/run-litmus.py index 7b775cbf3a8..380a70afa0f 100644 --- a/tests/acceptance/run-litmus.py +++ b/tests/acceptance/run-litmus.py @@ -163,8 +163,8 @@ def main() -> int: ocis_bin = repo_root / "ocis/bin/ocis" ocis_config_dir = Path.home() / ".ocis/config" - # build (matching drone: restores binary from cache, then runs ocis server directly) - subprocess.run(["make", "-C", str(repo_root / "ocis"), "build"], check=True) + if not ocis_bin.exists(): + subprocess.run(["make", "-C", str(repo_root / "ocis"), "build"], check=True) # Docker bridge gateway IP: reachable from both the host (via docker0 interface) # and Docker containers (via bridge network default gateway). Use this as OCIS_URL diff --git a/tests/acceptance/run-wopi.py b/tests/acceptance/run-wopi.py index d152e72ae1f..a9a6d636885 100644 --- a/tests/acceptance/run-wopi.py +++ b/tests/acceptance/run-wopi.py @@ -242,7 +242,8 @@ def main() -> int: ocis_bin = repo_root / "ocis/bin/ocis" ocis_config_dir = Path.home() / ".ocis/config" - subprocess.run(["make", "-C", str(repo_root / "ocis"), "build"], check=True) + if not ocis_bin.exists(): + subprocess.run(["make", "-C", str(repo_root / "ocis"), "build"], check=True) bridge_ip = get_docker_bridge_ip() print(f"Docker bridge IP: {bridge_ip}", flush=True)