Skip to content

Commit 821cc14

Browse files
Merge pull request #2454 from nextcloud/ci/master/update-workflows
ci(github): Update workflows
2 parents b9e6428 + 5a80d75 commit 821cc14

11 files changed

Lines changed: 62 additions & 22 deletions

.github/workflows/command-compile.yml

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,41 @@ jobs:
136136
if: ${{ contains(needs.init.outputs.arg1, 'rebase') }}
137137
run: |
138138
git fetch origin '${{ needs.init.outputs.base_ref }}:${{ needs.init.outputs.base_ref }}'
139-
git rebase 'origin/${{ needs.init.outputs.base_ref }}'
139+
140+
# Start the rebase
141+
git rebase 'origin/${{ needs.init.outputs.base_ref }}' || {
142+
# Handle rebase conflicts in a loop
143+
while [ -d .git/rebase-merge ] || [ -d .git/rebase-apply ]; do
144+
echo "Handling rebase conflict..."
145+
146+
# Remove and checkout /dist and /js folders from the base branch
147+
if [ -d "dist" ]; then
148+
rm -rf dist
149+
git checkout origin/${{ needs.init.outputs.base_ref }} -- dist/ 2>/dev/null || echo "No dist folder in base branch"
150+
fi
151+
if [ -d "js" ]; then
152+
rm -rf js
153+
git checkout origin/${{ needs.init.outputs.base_ref }} -- js/ 2>/dev/null || echo "No js folder in base branch"
154+
fi
155+
156+
# Stage all changes
157+
git add .
158+
159+
# Check if there are any changes after resolving conflicts
160+
if git diff --cached --quiet; then
161+
echo "No changes after conflict resolution, skipping commit"
162+
git rebase --skip
163+
else
164+
echo "Changes found, continuing rebase without editing commit message"
165+
git -c core.editor=true rebase --continue
166+
fi
167+
168+
# Break if rebase is complete
169+
if [ ! -d .git/rebase-merge ] && [ ! -d .git/rebase-apply ]; then
170+
break
171+
fi
172+
done
173+
}
140174
141175
- name: Install dependencies & build
142176
env:
@@ -168,11 +202,15 @@ jobs:
168202
169203
- name: Push normally
170204
if: ${{ !contains(needs.init.outputs.arg1, 'rebase') && !contains(needs.init.outputs.arg1, 'amend') }}
171-
run: git push origin '${{ needs.init.outputs.head_ref }}'
205+
env:
206+
HEAD_REF: ${{ needs.init.outputs.head_ref }}
207+
run: git push origin "$HEAD_REF"
172208

173209
- name: Force push
174210
if: ${{ contains(needs.init.outputs.arg1, 'rebase') || contains(needs.init.outputs.arg1, 'amend') }}
175-
run: git push --force origin '${{ needs.init.outputs.head_ref }}'
211+
env:
212+
HEAD_REF: ${{ needs.init.outputs.head_ref }}
213+
run: git push --force-with-lease origin "$HEAD_REF"
176214

177215
- name: Add reaction on failure
178216
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0

.github/workflows/lint-php-cs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1
3535

3636
- name: Set up php${{ steps.versions.outputs.php-min }}
37-
uses: shivammathur/setup-php@0f7f1d08e3e32076e51cae65eb0b0c871405b16e # v2.34.1
37+
uses: shivammathur/setup-php@ccf2c627fe61b1b4d924adfcbd19d661a18133a0 # v2.35.2
3838
with:
3939
php-version: ${{ steps.versions.outputs.php-min }}
4040
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite

.github/workflows/lint-php.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
persist-credentials: false
4949

5050
- name: Set up php ${{ matrix.php-versions }}
51-
uses: shivammathur/setup-php@0f7f1d08e3e32076e51cae65eb0b0c871405b16e # v2.34.1
51+
uses: shivammathur/setup-php@ccf2c627fe61b1b4d924adfcbd19d661a18133a0 # v2.35.2
5252
with:
5353
php-version: ${{ matrix.php-versions }}
5454
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite

.github/workflows/openapi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1
3636

3737
- name: Set up php
38-
uses: shivammathur/setup-php@0f7f1d08e3e32076e51cae65eb0b0c871405b16e # v2.34.1
38+
uses: shivammathur/setup-php@ccf2c627fe61b1b4d924adfcbd19d661a18133a0 # v2.35.2
3939
with:
4040
php-version: ${{ steps.php_versions.outputs.php-available }}
4141
extensions: xml

.github/workflows/phpunit-mysql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ jobs:
103103
path: apps/${{ env.APP_NAME }}
104104

105105
- name: Set up php ${{ matrix.php-versions }}
106-
uses: shivammathur/setup-php@0f7f1d08e3e32076e51cae65eb0b0c871405b16e # v2.34.1
106+
uses: shivammathur/setup-php@ccf2c627fe61b1b4d924adfcbd19d661a18133a0 # v2.35.2
107107
with:
108108
php-version: ${{ matrix.php-versions }}
109109
# https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation

.github/workflows/phpunit-oci.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -70,28 +70,27 @@ jobs:
7070
matrix:
7171
php-versions: ${{ fromJson(needs.matrix.outputs.php-version) }}
7272
server-versions: ${{ fromJson(needs.matrix.outputs.server-max) }}
73+
oci-versions: ['11', '18', '21', '23']
7374

74-
name: OCI PHP ${{ matrix.php-versions }} Nextcloud ${{ matrix.server-versions }}
75+
name: OCI ${{ matrix.oci-versions }} PHP ${{ matrix.php-versions }} Nextcloud ${{ matrix.server-versions }}
7576

7677
services:
7778
oracle:
78-
image: ghcr.io/gvenzl/oracle-xe:11
79+
image: ghcr.io/gvenzl/oracle-${{ matrix.oci-versions < 23 && 'xe' || 'free' }}:${{ matrix.oci-versions }}
7980

8081
# Provide passwords and other environment variables to container
8182
env:
82-
ORACLE_RANDOM_PASSWORD: true
83-
APP_USER: autotest
84-
APP_USER_PASSWORD: owncloud
83+
ORACLE_PASSWORD: oracle
8584

8685
# Forward Oracle port
8786
ports:
88-
- 1521:1521/tcp
87+
- 1521:1521
8988

9089
# Provide healthcheck script options for startup
9190
options: >-
9291
--health-cmd healthcheck.sh
93-
--health-interval 10s
94-
--health-timeout 5s
92+
--health-interval 20s
93+
--health-timeout 10s
9594
--health-retries 10
9695
9796
steps:
@@ -116,7 +115,7 @@ jobs:
116115
path: apps/${{ env.APP_NAME }}
117116

118117
- name: Set up php ${{ matrix.php-versions }}
119-
uses: shivammathur/setup-php@0f7f1d08e3e32076e51cae65eb0b0c871405b16e # v2.34.1
118+
uses: shivammathur/setup-php@ccf2c627fe61b1b4d924adfcbd19d661a18133a0 # v2.35.2
120119
with:
121120
php-version: ${{ matrix.php-versions }}
122121
# https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
@@ -147,7 +146,7 @@ jobs:
147146
DB_PORT: 1521
148147
run: |
149148
mkdir data
150-
./occ maintenance:install --verbose --database=oci --database-name=XE --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=autotest --database-pass=owncloud --admin-user admin --admin-pass admin
149+
./occ maintenance:install --verbose --database=oci --database-name=${{ matrix.oci-versions < 23 && 'XE' || 'FREE' }} --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=system --database-pass=oracle --admin-user admin --admin-pass admin
151150
./occ app:enable --force ${{ env.APP_NAME }}
152151
153152
- name: Check PHPUnit script is defined

.github/workflows/phpunit-pgsql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ jobs:
106106
path: apps/${{ env.APP_NAME }}
107107

108108
- name: Set up php ${{ matrix.php-versions }}
109-
uses: shivammathur/setup-php@0f7f1d08e3e32076e51cae65eb0b0c871405b16e # v2.34.1
109+
uses: shivammathur/setup-php@ccf2c627fe61b1b4d924adfcbd19d661a18133a0 # v2.35.2
110110
with:
111111
php-version: ${{ matrix.php-versions }}
112112
# https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation

.github/workflows/phpunit-sqlite.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ jobs:
9595
path: apps/${{ env.APP_NAME }}
9696

9797
- name: Set up php ${{ matrix.php-versions }}
98-
uses: shivammathur/setup-php@0f7f1d08e3e32076e51cae65eb0b0c871405b16e # v2.34.1
98+
uses: shivammathur/setup-php@ccf2c627fe61b1b4d924adfcbd19d661a18133a0 # v2.35.2
9999
with:
100100
php-version: ${{ matrix.php-versions }}
101101
# https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation

.github/workflows/pr-feedback.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
blocklist=$(curl https://raw.githubusercontent.com/nextcloud/.github/master/non-community-usernames.txt | paste -s -d, -)
3737
echo "blocklist=$blocklist" >> "$GITHUB_OUTPUT"
3838
39-
- uses: nextcloud/pr-feedback-action@d7257d0e6298aace6a627c796390c5490f6be33b # main
39+
- uses: nextcloud/pr-feedback-action@f0cab224dea8e1f282f9451de322f323c78fc7a5 # main
4040
with:
4141
feedback-message: |
4242
Hello there,

.github/workflows/psalm.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
run: grep 'phpVersion="${{ steps.versions.outputs.php-min }}' psalm.xml
3737

3838
- name: Set up php${{ steps.versions.outputs.php-available }}
39-
uses: shivammathur/setup-php@0f7f1d08e3e32076e51cae65eb0b0c871405b16e # v2.34.1
39+
uses: shivammathur/setup-php@ccf2c627fe61b1b4d924adfcbd19d661a18133a0 # v2.35.2
4040
with:
4141
php-version: ${{ steps.versions.outputs.php-available }}
4242
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite
@@ -52,6 +52,9 @@ jobs:
5252
composer remove nextcloud/ocp --dev --no-scripts
5353
composer i
5454
55+
- name: Check for vulnerable PHP dependencies
56+
run: composer require --dev roave/security-advisories:dev-latest
57+
5558
- name: Install nextcloud/ocp
5659
run: composer require --dev nextcloud/ocp:dev-${{ steps.versions.outputs.branches-max }} --ignore-platform-reqs --with-dependencies
5760

0 commit comments

Comments
 (0)