mirror of
https://github.com/netzbegruenung/user_saml.git
synced 2024-05-03 17:43:41 +02:00
507a2c420a
Signed-off-by: Joas Schilling <coding@schilljs.com>
85 lines
2.5 KiB
YAML
85 lines
2.5 KiB
YAML
name: PHPUnit
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- master
|
|
- stable*
|
|
|
|
env:
|
|
APP_NAME: user_saml
|
|
|
|
jobs:
|
|
php:
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
# do not stop on another job's failure
|
|
fail-fast: false
|
|
matrix:
|
|
php-versions: ['7.4', '8.0']
|
|
databases: ['sqlite']
|
|
server-versions: ['stable21', 'stable22', 'stable23', 'stable24', 'stable25', 'master']
|
|
include:
|
|
- php-versions: '8.1'
|
|
server-versions: 'master'
|
|
databases: 'sqlite'
|
|
- php-versions: '8.1'
|
|
server-versions: 'stable25'
|
|
databases: 'sqlite'
|
|
- php-versions: '8.1'
|
|
server-versions: 'stable24'
|
|
databases: 'sqlite'
|
|
|
|
name: php${{ matrix.php-versions }}-${{ matrix.databases }}-${{ matrix.server-versions }}
|
|
|
|
steps:
|
|
- name: Checkout server
|
|
uses: actions/checkout@v2
|
|
with:
|
|
repository: nextcloud/server
|
|
ref: ${{ matrix.server-versions }}
|
|
submodules: true
|
|
|
|
- name: Checkout app
|
|
uses: actions/checkout@v2
|
|
with:
|
|
path: apps/${{ env.APP_NAME }}
|
|
|
|
- name: Set up php ${{ matrix.php-versions }}
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: ${{ matrix.php-versions }}
|
|
tools: phpunit
|
|
extensions: mbstring, iconv, fileinfo, intl, sqlite, pdo_sqlite, gd, zip
|
|
|
|
- name: Set up PHPUnit
|
|
working-directory: apps/${{ env.APP_NAME }}
|
|
run: composer i
|
|
|
|
- name: Set up Nextcloud
|
|
env:
|
|
DB_PORT: 4444
|
|
run: |
|
|
mkdir data
|
|
./occ maintenance:install --verbose --database=${{ matrix.databases }} --database-name=nextcloud --database-host=127.0.0.1 --database-port=$DB_PORT --database-user=root --database-pass=rootpassword --admin-user admin --admin-pass password
|
|
./occ app:enable --force ${{ env.APP_NAME }}
|
|
php -S localhost:8080 &
|
|
|
|
- name: PHPUnit & coverage
|
|
working-directory: apps/${{ env.APP_NAME }}
|
|
run: |
|
|
cd tests/unit
|
|
../../vendor/phpunit/phpunit/phpunit --coverage-clover coverage.xml -c phpunit.xml
|
|
|
|
# - name: PHPUnit integration
|
|
# working-directory: apps/${{ env.APP_NAME }}
|
|
# run: ../../vendor/phpunit/phpunit/phpunit -c phpunit.integration.xml
|
|
|
|
- name: Upload coverage
|
|
working-directory: apps/${{ env.APP_NAME }}
|
|
env:
|
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
|
run: bash <(curl -s https://codecov.io/bash)
|