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

ci: move phpunit-nodb to actions #39734

Closed
wants to merge 5 commits into from
Closed
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
13 changes: 13 additions & 0 deletions .github/filters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Filters for https://github.com/dorny/paths-filter

phpunit:
- '**/*.php'
- '**/*.sh'
- '**/*.xml'
- '**/*.yml'
- '**/l10n/*.json'
- '**/tests/**'
- '3rdparty'
- 'apps/theming/css'
- 'composer.(json|lock)'
- 'vendor-bin/phpunit/composer.(json|lock)'
100 changes: 100 additions & 0 deletions .github/workflows/nodb.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: PHPUnit nodb

on:
pull_request:
push:
branches:
- main
- master
- stable*

permissions:
contents: read

concurrency:
group: phpunit-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
changes:
runs-on: ubuntu-latest
name: nodb-changes

# Required permissions
permissions:
pull-requests: read
# Set job outputs to values from filter step
outputs:
phpunit: ${{ steps.filter.outputs.phpunit }}
steps:
- name: Checkout server
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
with:
submodules: true
- uses: dorny/paths-filter@4512585405083f25c027a35db413c2b3b9006d50 # v2.11.1
id: filter
with:
filters: .github/filters.yml

phpunit:
runs-on: ubuntu-latest
name: nodb-phpunit

needs: changes
if: ${{ github.repository_owner != 'nextcloud-gmbh' && needs.changes.outputs.phpunit == 'true' }}

strategy:
matrix:
php-versions: ['8.0', '8.1', '8.2', '8.3']

steps:
- name: Checkout server
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
with:
submodules: true

- name: Install tools
run: |
sudo apt-get update
sudo apt-get install -y ffmpeg imagemagick libmagickcore-6.q16-3-extra

- name: Set up php ${{ matrix.php-versions }}
uses: shivammathur/setup-php@9c77701ae57b0c47f6732beebfbdec76e4e5c90a #debian bookworm fix
with:
php-version: ${{ matrix.php-versions }}
extensions: apcu, ctype, curl, dom, fileinfo, gd, imagick, intl, json, ldap, mbstring, openssl, pcntl, pdo_sqlite, posix, redis, sqlite, xml, zip
coverage: none
ini-file: development
ini-values:
apc.enabled=on, apc.enable_cli=on, disable_functions= # https://github.com/shivammathur/setup-php/discussions/573
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Nextcloud
env:
DB_PORT: 4444
run: |
composer install
mkdir data
./occ maintenance:install --verbose --database=sqlite --database-name=nextcloud --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=autotest --database-pass=rootpassword --admin-user admin --admin-pass admin
php -f index.php

- name: Enable additional apps
run: ./occ app:enable admin_audit encryption federatedfilesharing federation files_sharing files_trashbin files_versions provisioning_api user_ldap

- name: PHPUnit
run: composer run test -- --exclude-group DB,SLOWDB,PRIMARY-azure,PRIMARY-s3,PRIMARY-swift,Memcached,Redis

summary:
runs-on: ubuntu-latest
name: nodb-summary

needs: [changes, phpunit]
if: always()

permissions:
contents: none

steps:
- name: Summary status
run: if ${{ needs.changes.outputs.phpunit == 'true' && needs.phpunit.result != 'success' }}; then exit 1; fi
4 changes: 4 additions & 0 deletions apps/encryption/tests/Crypto/EncryptAllTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
use OCP\Mail\IMailer;
use OCP\Security\ISecureRandom;
use OCP\UserInterface;
use PHPUnit\Framework\MockObject\MockObject;
use Symfony\Component\Console\Formatter\OutputFormatterInterface;
use Symfony\Component\Console\Helper\ProgressBar;
use Symfony\Component\Console\Helper\QuestionHelper;
Expand Down Expand Up @@ -88,6 +89,9 @@ class EncryptAllTest extends TestCase {
/** @var \PHPUnit\Framework\MockObject\MockObject | \OCP\Security\ISecureRandom */
protected $secureRandom;

/** @var MockObject|IFactory */
protected $l10nFactory;

/** @var EncryptAll */
protected $encryptAll;

Expand Down
Loading