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

Migrate to nextcloud/OCP package in stable23 #747

Merged
merged 3 commits into from
Sep 27, 2022
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
127 changes: 96 additions & 31 deletions .github/workflows/oci.yml
Original file line number Diff line number Diff line change
@@ -1,73 +1,138 @@
# This workflow is provided via the organization template repository
#
# https://github.com/nextcloud/.github
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization

name: PHPUnit

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

push:
branches:
- main
- master
- stable*

permissions:
contents: read

env:
APP_NAME: firstrunwizard
# Location of the phpunit.xml and phpunit.integration.xml files
PHPUNIT_CONFIG: ./tests/phpunit.xml
PHPUNIT_INTEGRATION_CONFIG: ./tests/phpunit.integration.xml

jobs:
oci:
phpunit-oci:
runs-on: ubuntu-latest

strategy:
# do not stop on another job's failure
fail-fast: false
matrix:
php-versions: ['7.4']
databases: ['oci']
server-versions: ['stable23']

name: php${{ matrix.php-versions }}-${{ matrix.databases }}-${{ matrix.server-versions }}

services:
oracle:
image: deepdiver/docker-oracle-xe-11g # "wnameless/oracle-xe-11g-r2"
image: deepdiver/docker-oracle-xe-11g # 'wnameless/oracle-xe-11g-r2'
ports:
- "1521:1521"
- 1521:1521/tcp

steps:
- name: Set app env
run: |
# Split and keep last
echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV

- name: Checkout server
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
submodules: true
repository: nextcloud/server
ref: ${{ matrix.server-versions }}

- name: Checkout submodules
shell: bash
run: |
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
git submodule sync --recursive
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1

- name: Checkout app
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
path: apps/${{ env.APP_NAME }}

- name: Set up PHPUnit
working-directory: apps/${{ env.APP_NAME }}
run: composer i

- name: Set up php ${{ matrix.php-versions }}
uses: "shivammathur/setup-php@v2"
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php-versions }}"
extensions: mbstring, iconv, fileinfo, intl, oci8
tools: phpunit:8.5.2
php-version: ${{ matrix.php-versions }}
extensions: mbstring, fileinfo, intl, sqlite, pdo_sqlite, oci8
tools: phpunit
coverage: none

- name: Check composer file existence
id: check_composer
uses: andstor/file-existence-action@v1
with:
files: apps/${{ env.APP_NAME }}/composer.json

- name: Set up PHPUnit
# Only run if phpunit config file exists
if: steps.check_composer.outputs.files_exists == 'true'
working-directory: apps/${{ env.APP_NAME }}
run: composer i

- name: Set up Nextcloud
env:
DB_PORT: 1521
run: |
mkdir data
./occ maintenance:install --verbose --database=oci --database-name=XE --database-host=127.0.0.1 --database-port=1521 --database-user=autotest --database-pass=owncloud --admin-user admin --admin-pass admin
php -f index.php
./occ app:enable --force ${{ env.APP_NAME }}
./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
./occ app:enable ${{ env.APP_NAME }}

- name: Check PHPUnit config file existence
id: check_phpunit
uses: andstor/file-existence-action@v1
with:
files: apps/${{ env.APP_NAME }}/${{ env.PHPUNIT_CONFIG }}

- name: PHPUnit
working-directory: apps/${{ env.APP_NAME }}/tests
run: phpunit -c phpunit.xml
# Only run if phpunit config file exists
if: steps.check_phpunit.outputs.files_exists == 'true'
working-directory: apps/${{ env.APP_NAME }}
run: phpunit -c ${{ env.PHPUNIT_CONFIG }}

- name: Check PHPUnit integration config file existence
id: check_integration
uses: andstor/file-existence-action@v1
with:
files: apps/${{ env.APP_NAME }}/${{ env.PHPUNIT_INTEGRATION_CONFIG }}

- name: Run Nextcloud
# Only run if phpunit integration config file exists
if: steps.check_integration.outputs.files_exists == 'true'
run: php -S localhost:8080 &

- name: PHPUnit integration
# Only run if phpunit integration config file exists
if: steps.check_integration.outputs.files_exists == 'true'
working-directory: apps/${{ env.APP_NAME }}
run: phpunit -c ${{ env.PHPUNIT_INTEGRATION_CONFIG }}

summary:
permissions:
contents: none
runs-on: ubuntu-latest
needs: phpunit-oci

if: always()

name: phpunit-oci-summary

steps:
- name: Summary status
run: if ${{ needs.phpunit-oci.result != 'success' }}; then exit 1; fi
65 changes: 65 additions & 0 deletions .github/workflows/update-nextcloud-ocp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# This workflow is provided via the organization template repository
#
# https://github.com/nextcloud/.github
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization

name: Update nextcloud/ocp

on:
workflow_dispatch:
schedule:
- cron: "5 4 * * 0"

jobs:
update-nextcloud-ocp:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
branches: ["master", "stable25", "stable24", "stable23"]

name: update-nextcloud-ocp-${{ matrix.branches }}

steps:
- uses: actions/checkout@v3
with:
ref: ${{ matrix.branches }}
submodules: true

- name: Set up php7.4
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
extensions: ctype,curl,dom,fileinfo,gd,intl,json,mbstring,openssl,pdo_sqlite,posix,sqlite,xml,zip
coverage: none

- name: Composer install
run: composer install

- name: Composer update nextcloud/ocp
run: composer require --dev nextcloud/ocp:dev-${{ matrix.branches }}
continue-on-error: true

- name: Reset checkout dirs
run: |
git clean -f 3rdparty
git clean -f vendor
git checkout 3rdparty vendor
continue-on-error: true

- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.COMMAND_BOT_PAT }}
commit-message: Update psalm baseline
committer: GitHub <noreply@github.com>
author: nextcloud-command <nextcloud-command@users.noreply.github.com>
signoff: true
branch: automated/noid/${{ matrix.branches }}-update-nextcloud-ocp
title: "[${{ matrix.branches }}] Update nextcloud/ocp dependency"
body: |
Auto-generated update of [nextcloud/ocp](https://github.com/nextcloud-deps/ocp/) dependency
labels: |
dependencies
3. to review
30 changes: 18 additions & 12 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
{
"name": "nextcloud/firstrunwizard",
"description": "The Nextcloud firstrunwizard",
"license": "AGPL",
"config": {
"optimize-autoloader": true,
"classmap-authoritative": true
},
"require": {
},
"scripts": {
"lint": "find . -name \\*.php -not -path './vendor/*' -print0 | xargs -0 -n1 php -l"
}
"name": "nextcloud/firstrunwizard",
"description": "The Nextcloud firstrunwizard",
"license": "AGPL",
"config": {
"optimize-autoloader": true,
"classmap-authoritative": true
},
"scripts": {
"lint": "find . -name \\*.php -not -path './vendor/*' -print0 | xargs -0 -n1 php -l"
},
"require-dev": {
"nextcloud/ocp": "dev-stable23"
},
"autoload-dev": {
"psr-4": {
"OCP\\": "vendor/nextcloud/ocp/OCP"
}
}
}
Loading