mirror of
https://github.com/owncloud/ocis
synced 2026-04-25 17:25:21 +02:00
feat: [OCISDEV-779] reduce CI duration, PHP-version (#12217)
* feat: [OCISDEV-779] reduce CI duration, php-version * feat: [OCISDEV-779] fix flaky test in apiSharingNgShares * feat: [OCISDEV-779] fix flaky preview comparison * feat: [OCISDEV-779] fix flaky preview comparison * feat: [OCISDEV-779] replace manual PHP installation with shivammathur/setup-php action * feat: [OCISDEV-779] fix Pre-checks and generate step * feat: [OCISDEV-779] fix flaky preview comparison * feat: [OCISDEV-779] fix failing test --------- Co-authored-by: Michal Klos <michal.klos@kiteworks.com>
This commit is contained in:
153
.github/workflows/acceptance-tests.yml
vendored
153
.github/workflows/acceptance-tests.yml
vendored
@@ -22,23 +22,20 @@ jobs:
|
||||
- name: Enable pnpm
|
||||
run: corepack enable && corepack prepare pnpm@10.28.1 --activate
|
||||
|
||||
- uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # v2.37.0
|
||||
with:
|
||||
php-version: "8.4"
|
||||
extensions: curl, xml, mbstring, zip, ldap, gd
|
||||
tools: composer
|
||||
|
||||
- name: Pre-checks and generate
|
||||
run: |
|
||||
# Phase 1 — I/O + light CPU, no contention between tasks.
|
||||
# PHP install (~40s) is moved inside the php-style subshell so it overlaps
|
||||
# with govulncheck (network I/O), node-gen, and go-gen instead of blocking
|
||||
# the entire job sequentially.
|
||||
# wa (I/O wait) will spike during apt-get/npm/pnpm downloads.
|
||||
# wa (I/O wait) will spike during npm/pnpm downloads.
|
||||
# Expected avg load: ~50-60 % CPU on 2 vCPU.
|
||||
vmstat 2 > /tmp/vmstat-phase1.log & MONITOR_PID=$!
|
||||
|
||||
#TODO: use github action to setup/install/cache php
|
||||
(sudo add-apt-repository -y ppa:ondrej/php \
|
||||
&& sudo apt-get update -qq \
|
||||
&& sudo apt-get install -y php8.4 php8.4-curl php8.4-xml php8.4-mbstring php8.4-zip php8.4-ldap php8.4-gd \
|
||||
&& sudo update-alternatives --set php /usr/bin/php8.4 \
|
||||
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
|
||||
&& make vendor-bin-codestyle && make vendor-bin-codesniffer && make test-php-style && make check-env-var-annotations) > /tmp/php-style.log 2>&1 & PIDS=($!)
|
||||
(make vendor-bin-codestyle && make vendor-bin-codesniffer && make test-php-style && make check-env-var-annotations) > /tmp/php-style.log 2>&1 & PIDS=($!)
|
||||
(npm install -g @gherlint/gherlint@1.1.0 && make test-gherkin-lint) > /tmp/gherkin.log 2>&1 & PIDS+=($!)
|
||||
bash tests/acceptance/check-deleted-suites-in-expected-failure.sh > /tmp/suites.log 2>&1 & PIDS+=($!)
|
||||
make govulncheck > /tmp/govulncheck.log 2>&1 & PIDS+=($!)
|
||||
@@ -161,6 +158,12 @@ jobs:
|
||||
- name: Enable pnpm
|
||||
run: corepack enable && corepack prepare pnpm@10.28.1 --activate
|
||||
|
||||
- uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # v2.37.0
|
||||
with:
|
||||
php-version: "8.4"
|
||||
extensions: curl, xml, mbstring, zip, ldap, gd
|
||||
tools: composer
|
||||
|
||||
- name: Cache libcurl 8.12.0
|
||||
id: cache-libcurl
|
||||
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
|
||||
@@ -205,46 +208,6 @@ jobs:
|
||||
}
|
||||
'
|
||||
|
||||
- name: Install PHP 8.4
|
||||
run: |
|
||||
for attempt in {1..5}; do
|
||||
echo "Attempt $attempt/5..."
|
||||
|
||||
OUTPUT=$(sudo add-apt-repository -y ppa:ondrej/php 2>&1)
|
||||
EXIT_CODE=$?
|
||||
|
||||
if [ $EXIT_CODE -eq 0 ]; then
|
||||
echo "PPA added successfully."
|
||||
break
|
||||
fi
|
||||
ERROR_MSG=$(echo "$OUTPUT" | grep -E "(504 Gateway Time-out|502 Bad Gateway|503 Service Unavailable|HTTP Error 5[0-9][0-9])" | head -n 1)
|
||||
|
||||
# Retry on 5xx error
|
||||
if [ -n "$ERROR_MSG" ]; then
|
||||
echo "Error: $ERROR_MSG"
|
||||
echo "Retrying......"
|
||||
else
|
||||
echo "Error: $OUTPUT"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# delay
|
||||
sleep 10
|
||||
done
|
||||
|
||||
if [ $EXIT_CODE -ne 0 ]; then
|
||||
echo "Failed to add PPA after 5 attempts."
|
||||
echo "Error: $OUTPUT"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
sudo apt-get update -qq
|
||||
sudo apt-get install -y php8.4 php8.4-curl php8.4-xml php8.4-mbstring php8.4-zip php8.4-ldap php8.4-gd
|
||||
sudo update-alternatives --set php /usr/bin/php8.4
|
||||
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
|
||||
php -v
|
||||
composer --version
|
||||
|
||||
- name: Run ${{ matrix.suite }}
|
||||
run: BEHAT_SUITES=${{ matrix.suite }} python3 tests/acceptance/run-github.py
|
||||
|
||||
@@ -271,45 +234,11 @@ jobs:
|
||||
- name: Enable pnpm
|
||||
run: corepack enable && corepack prepare pnpm@10.28.1 --activate
|
||||
|
||||
- name: Install PHP 8.4
|
||||
run: |
|
||||
for attempt in {1..5}; do
|
||||
echo "Attempt $attempt/5..."
|
||||
|
||||
OUTPUT=$(sudo add-apt-repository -y ppa:ondrej/php 2>&1)
|
||||
EXIT_CODE=$?
|
||||
|
||||
if [ $EXIT_CODE -eq 0 ]; then
|
||||
echo "PPA added successfully."
|
||||
break
|
||||
fi
|
||||
ERROR_MSG=$(echo "$OUTPUT" | grep -E "(504 Gateway Time-out|502 Bad Gateway|503 Service Unavailable|HTTP Error 5[0-9][0-9])" | head -n 1)
|
||||
|
||||
# Retry on 5xx error
|
||||
if [ -n "$ERROR_MSG" ]; then
|
||||
echo "Error: $ERROR_MSG"
|
||||
echo "Retrying......"
|
||||
else
|
||||
echo "Error: $OUTPUT"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# delay
|
||||
sleep 10
|
||||
done
|
||||
|
||||
if [ $EXIT_CODE -ne 0 ]; then
|
||||
echo "Failed to add PPA after 5 attempts."
|
||||
echo "Error: $OUTPUT"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
sudo apt-get update -qq
|
||||
sudo apt-get install -y php8.4 php8.4-curl php8.4-xml php8.4-mbstring php8.4-zip php8.4-ldap php8.4-gd
|
||||
sudo update-alternatives --set php /usr/bin/php8.4
|
||||
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
|
||||
php -v
|
||||
composer --version
|
||||
- uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # v2.37.0
|
||||
with:
|
||||
php-version: "8.4"
|
||||
extensions: curl, xml, mbstring, zip, ldap, gd
|
||||
tools: composer
|
||||
|
||||
- name: Run ${{ matrix.suite }}
|
||||
run: BEHAT_SUITES="${{ matrix.suite }}" python3 tests/acceptance/run-github.py
|
||||
@@ -345,6 +274,12 @@ jobs:
|
||||
- name: Enable pnpm
|
||||
run: corepack enable && corepack prepare pnpm@10.28.1 --activate
|
||||
|
||||
- uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # v2.37.0
|
||||
with:
|
||||
php-version: "8.4"
|
||||
extensions: curl, xml, mbstring, zip, ldap, gd
|
||||
tools: composer
|
||||
|
||||
- name: Cache libcurl 8.12.0
|
||||
id: cache-libcurl
|
||||
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
|
||||
@@ -389,44 +324,6 @@ jobs:
|
||||
}
|
||||
'
|
||||
|
||||
- name: Install PHP 8.4
|
||||
run: |
|
||||
for attempt in {1..5}; do
|
||||
echo "Attempt $attempt/5..."
|
||||
|
||||
OUTPUT=$(sudo add-apt-repository -y ppa:ondrej/php 2>&1)
|
||||
EXIT_CODE=$?
|
||||
|
||||
if [ $EXIT_CODE -eq 0 ]; then
|
||||
echo "PPA added successfully."
|
||||
break
|
||||
fi
|
||||
ERROR_MSG=$(echo "$OUTPUT" | grep -E "(504 Gateway Time-out|502 Bad Gateway|503 Service Unavailable|HTTP Error 5[0-9][0-9])" | head -n 1)
|
||||
|
||||
# Retry on 5xx error
|
||||
if [ -n "$ERROR_MSG" ]; then
|
||||
echo "Error: $ERROR_MSG"
|
||||
echo "Retrying......"
|
||||
else
|
||||
echo "Error: $OUTPUT"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# delay
|
||||
sleep 10
|
||||
done
|
||||
|
||||
if [ $EXIT_CODE -ne 0 ]; then
|
||||
echo "Failed to add PPA after 5 attempts."
|
||||
echo "Error: $OUTPUT"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
sudo apt-get update -qq
|
||||
sudo apt-get install -y php8.4 php8.4-curl php8.4-xml php8.4-mbstring php8.4-zip php8.4-ldap php8.4-gd
|
||||
sudo update-alternatives --set php /usr/bin/php8.4
|
||||
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
|
||||
|
||||
- name: Run ${{ matrix.suite }}
|
||||
run: >
|
||||
BEHAT_SUITES="${{ matrix.suite }}"
|
||||
|
||||
Reference in New Issue
Block a user