Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable27] fix(ci): Update CI workflows #11142

Merged
merged 2 commits into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions .github/workflows/appstore-build-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
types: [published]

env:
PHP_VERSION: 8.1
PHP_VERSION: 8.2

jobs:
build_and_publish:
Expand All @@ -32,7 +32,7 @@ jobs:
echo "APP_VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV

- name: Checkout
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
path: ${{ env.APP_NAME }}

Expand All @@ -44,19 +44,19 @@ jobs:
expression: "//info//dependencies//nextcloud/@min-version"

- name: Read package.json node and npm engines version
uses: skjnldsv/read-package-engines-version-actions@0ce2ed60f6df073a62a77c0a4958dd0fc68e32e7 # v2.1
uses: skjnldsv/read-package-engines-version-actions@8205673bab74a63eb9b8093402fd9e0e018663a1 # v2.2
id: versions
# Continue if no package.json
continue-on-error: true
with:
path: ${{ env.APP_NAME }}
fallbackNode: "^16"
fallbackNpm: "^7"
fallbackNode: '^20'
fallbackNpm: '^9'

- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
# Skip if no package.json
if: ${{ steps.versions.outputs.nodeVersion }}
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v3
with:
node-version: ${{ steps.versions.outputs.nodeVersion }}

Expand All @@ -66,7 +66,7 @@ jobs:
run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}"

- name: Set up php ${{ env.PHP_VERSION }}
uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d # v2
uses: shivammathur/setup-php@e6f75134d35752277f093989e72e140eaa222f35 # v2
with:
php-version: ${{ env.PHP_VERSION }}
coverage: none
Expand All @@ -88,6 +88,8 @@ jobs:
- name: Build ${{ env.APP_NAME }}
# Skip if no package.json
if: ${{ steps.versions.outputs.nodeVersion }}
env:
CYPRESS_INSTALL_BINARY: 0
run: |
cd ${{ env.APP_NAME }}
npm ci
Expand Down Expand Up @@ -126,7 +128,7 @@ jobs:
unzip latest-$NCVERSION.zip

- name: Checkout server master fallback
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
if: ${{ steps.server-checkout.outcome != 'success' }}
with:
submodules: true
Expand All @@ -149,7 +151,7 @@ jobs:
tar -zcvf ${{ env.APP_NAME }}.tar.gz ${{ env.APP_NAME }}

- name: Attach tarball to github release
uses: svenstaro/upload-release-action@2b9d2847a97b04d02ad5c3df2d3a27baa97ce689 # v2
uses: svenstaro/upload-release-action@1beeb572c19a9242f4361f4cee78f8e0d9aec5df # v2
id: attach_to_release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/dependabot-approve-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,20 @@ jobs:
pull-requests: write

steps:
# Github actions bot approve
- uses: mdecoleman/pr-branch-name@bab4c71506bcd299fb350af63bb8e53f2940a599 # v2.0.0
id: branchname
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

# GitHub actions bot approve
- uses: hmarr/auto-approve-action@b40d6c9ed2fa10c9a2749eca7eb004418a705501 # v2
if: contains(fromJSON('["/nextcloud/vue-", "/webrtc-adapter-"]'), github.ref) != true
if: contains(steps.branchname.outputs.branch, '/webrtc-adapter-') != true && contains(steps.branchname.outputs.branch, '/nextcloud/vue-') != true
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

# Nextcloud bot approve and merge request
- uses: ahmadnassri/action-dependabot-auto-merge@45fc124d949b19b6b8bf6645b6c9d55f4f9ac61a # v2
if: contains(fromJSON('["/nextcloud/vue-", "/webrtc-adapter-"]'), github.ref) != true
if: contains(steps.branchname.outputs.branch, '/webrtc-adapter-') != true && contains(steps.branchname.outputs.branch, '/nextcloud/vue-') != true
with:
target: minor
github-token: ${{ secrets.DEPENDABOT_AUTOMERGE_TOKEN }}
38 changes: 30 additions & 8 deletions .github/workflows/integration-mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,12 @@
name: Integration mysql

on:
workflow_dispatch:
pull_request:
paths:
# Only running on PR for this file to save CI time (otherwise pgsql only)
- '.github/workflows/integration-mysql.yml'

push:
branches:
- main
- master
- stable*

permissions:
contents: read

Expand All @@ -25,9 +20,36 @@ concurrency:
cancel-in-progress: true

jobs:
changes:
runs-on: ubuntu-latest

outputs:
src: ${{ steps.changes.outputs.src}}

steps:
- uses: dorny/paths-filter@4512585405083f25c027a35db413c2b3b9006d50 # v2.11.1
id: changes
continue-on-error: true
with:
filters: |
src:
- '.github/workflows/**'
- 'appinfo/**'
- 'lib/**'
- 'templates/**'
- 'tests/integration/**'
- 'vendor/**'
- 'vendor-bin/**'
- '.php-cs-fixer.dist.php'
- 'composer.json'
- 'composer.lock'

integration-mysql:
runs-on: ubuntu-latest

needs: changes
if: needs.changes.outputs.src != 'false'

strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -130,12 +152,12 @@ jobs:
permissions:
contents: none
runs-on: ubuntu-latest
needs: integration-mysql
needs: [changes, integration-mysql]

if: always()

name: integration-mysql-summary

steps:
- name: Summary status
run: if ${{ needs.integration-mysql.result != 'success' }}; then exit 1; fi
run: if ${{ needs.changes.outputs.src != 'false' && needs.integration-mysql.result != 'success' }}; then exit 1; fi
38 changes: 30 additions & 8 deletions .github/workflows/integration-oci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,12 @@
name: Integration oci

on:
workflow_dispatch:
pull_request:
paths:
# Only running on PR for this file to save CI time (otherwise pgsql only)
- '.github/workflows/integration-oci.yml'

push:
branches:
- main
- master
- stable*

permissions:
contents: read

Expand All @@ -25,9 +20,36 @@ concurrency:
cancel-in-progress: true

jobs:
changes:
runs-on: ubuntu-latest

outputs:
src: ${{ steps.changes.outputs.src}}

steps:
- uses: dorny/paths-filter@4512585405083f25c027a35db413c2b3b9006d50 # v2.11.1
id: changes
continue-on-error: true
with:
filters: |
src:
- '.github/workflows/**'
- 'appinfo/**'
- 'lib/**'
- 'templates/**'
- 'tests/integration/**'
- 'vendor/**'
- 'vendor-bin/**'
- '.php-cs-fixer.dist.php'
- 'composer.json'
- 'composer.lock'

integration-oci:
runs-on: ubuntu-22.04

needs: changes
if: needs.changes.outputs.src != 'false'

strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -142,12 +164,12 @@ jobs:
permissions:
contents: none
runs-on: ubuntu-latest
needs: integration-oci
needs: [changes, integration-oci]

if: always()

name: integration-oci-summary

steps:
- name: Summary status
run: if ${{ needs.integration-oci.result != 'success' }}; then exit 1; fi
run: if ${{ needs.changes.outputs.src != 'false' && needs.integration-oci.result != 'success' }}; then exit 1; fi
57 changes: 36 additions & 21 deletions .github/workflows/integration-pgsql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,8 @@
name: Integration pgsql

on:
workflow_dispatch:
pull_request:
paths:
- '.github/workflows/**'
- 'appinfo/**'
- 'lib/**'
- 'templates/**'
- 'tests/integration/**'
- 'vendor/**'
- 'vendor-bin/**'
- '.php-cs-fixer.dist.php'
- 'composer.json'
- 'composer.lock'

push:
branches:
- main
- master
- stable*

permissions:
contents: read
Expand All @@ -33,9 +17,36 @@ concurrency:
cancel-in-progress: true

jobs:
changes:
runs-on: ubuntu-latest

outputs:
src: ${{ steps.changes.outputs.src}}

steps:
- uses: dorny/paths-filter@4512585405083f25c027a35db413c2b3b9006d50 # v2.11.1
id: changes
continue-on-error: true
with:
filters: |
src:
- '.github/workflows/**'
- 'appinfo/**'
- 'lib/**'
- 'templates/**'
- 'tests/integration/**'
- 'vendor/**'
- 'vendor-bin/**'
- '.php-cs-fixer.dist.php'
- 'composer.json'
- 'composer.lock'

integration-pgsql:
runs-on: ubuntu-latest

needs: changes
if: needs.changes.outputs.src != 'false'

strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -70,6 +81,10 @@ jobs:
repository: nextcloud/server
ref: ${{ matrix.server-versions }}

- name: Patch version check for nightly PHP
if: ${{ matrix.php-versions == '8.4' }}
run: echo "<?php" > lib/versioncheck.php

- name: Checkout app
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
with:
Expand Down Expand Up @@ -104,8 +119,8 @@ jobs:
extensions: apcu, bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, pgsql, pdo_pgsql
coverage: none
ini-file: development
ini-values:
apc.enable_cli=on
# Temporary workaround for missing pcntl_* in PHP 8.3: ini-values: apc.enable_cli=on
ini-values: apc.enable_cli=on, disable_functions=
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down Expand Up @@ -144,12 +159,12 @@ jobs:
permissions:
contents: none
runs-on: ubuntu-latest
needs: integration-pgsql
needs: [changes, integration-pgsql]

if: always()

name: integration-pgsql-summary

steps:
- name: Summary status
run: if ${{ needs.integration-pgsql.result != 'success' }}; then exit 1; fi
run: if ${{ needs.changes.outputs.src != 'false' && needs.integration-pgsql.result != 'success' }}; then exit 1; fi
Loading
Loading