Skip to content

Commit

Permalink
ci: move phpunit-nodb to actions
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Kesselberg <[email protected]>
  • Loading branch information
kesselb committed Aug 6, 2023
1 parent c5f72f0 commit 58c960c
Show file tree
Hide file tree
Showing 2 changed files with 126 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/nodb-when-unrelated.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: PHPUnit nodb

on:
pull_request:
paths:
- '!**.json'
- 'package.json'
- 'package-lock.json'
- '!**.sh'
- '!**.yml'
- '!**.xml'
- '!**.php'
- '!**/tests/**'
- '!3rdparty'
- '!apps/theming/css'

permissions:
contents: read

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

jobs:
summary-nodb:
permissions:
contents: none
runs-on: ubuntu-latest

name: phpunit-nodb-summary

steps:
- name: Summary status
run: 'echo "No PHP files changed, skipped PHPUnit"'
92 changes: 92 additions & 0 deletions .github/workflows/nodb.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: PHPUnit nodb

on:
pull_request:
paths:
- '**.json'
- '!package.json'
- '!package-lock.json'
- '**.sh'
- '**.yml'
- '**.xml'
- '**.php'
- '**/tests/**'
- '3rdparty'
- 'apps/theming/css'

push:
branches:
- main
- master
- stable*

permissions:
contents: read

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

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

if: ${{ github.repository_owner != 'nextcloud-gmbh' }}

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

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
tools: phpunit:9
coverage: none
ini-values:
apc.enabled=on,
apc.enable_cli=on
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Nextcloud
env:
DB_PORT: 4444
run: |
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
working-directory: tests
# run: phpunit --configuration phpunit-autotest.xml --exclude-group DB,SLOWDB,PRIMARY-azure,PRIMARY-s3,PRIMARY-swift
run: phpunit --configuration phpunit-autotest.xml --exclude-group DB,SLOWDB

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

if: always()

name: phpunit-nodb-summary

steps:
- name: Summary status
run: if ${{ needs.phpunit-nodb.result != 'success' }}; then exit 1; fi

0 comments on commit 58c960c

Please sign in to comment.