Welcome to mirror list, hosted at ThFree Co, Russian Federation.

php-test.yml « workflows « .github - github.com/nextcloud/jsxc.nextcloud.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ec266ef97050ac93e420594371bd101317f2ffa9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59

name: PHP Tests

on:
  pull_request:
  push:
    branches:
      - master

jobs:
  unit-tests:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        php-versions: ['7.3', '7.4']
        nextcloud-versions: ['stable20', 'stable21']
        include:
          - php-versions: '7.2'
            nextcloud-versions: 'stable20'
          - php-versions: '8.0'
            nextcloud-versions: 'stable21'
    name: php${{ matrix.php-versions }} on ${{ matrix.nextcloud-versions }} unit tests
    env:
      CI: true
      XDEBUG_MODE: coverage
    steps:
    - name: Set up php${{ matrix.php-versions }}
      uses: shivammathur/setup-php@master
      with:
        php-version: ${{ matrix.php-versions }}
        extensions: ctype, curl, dom, gd, gmp, iconv, intl, json, mbstring, openssl, pdo_sqlite, posix, sqlite, xml, zip
        coverage: xdebug
    - name: Checkout Nextcloud
      run: git clone https://github.com/nextcloud/server.git --recursive --depth 1 -b ${{ matrix.nextcloud-versions }} nextcloud
    - name: Install Nextcloud
      run: php -f nextcloud/occ maintenance:install --database-name oc_autotest --database-user oc_autotest --admin-user admin --admin-pass admin --database sqlite --database-pass=''
    - name: Checkout the app
      uses: actions/checkout@master
      with:
        path: nextcloud/apps/ojsxc
    - name: Remove OCP
      working-directory: nextcloud/apps/ojsxc
      run: composer remove --no-update --dev christophwurst/nextcloud
    - name: Fix php-parser on stable20 incompatibility with phpunit 9.3+
      if: ${{ matrix.nextcloud-versions == 'stable20' }}
      working-directory: nextcloud/3rdparty
      run: composer require nikic/php-parser:4.10
    - name: Downgrade phpunit for php7.2
      if: ${{ matrix.php-versions == '7.2' }}
      working-directory: nextcloud/apps/ojsxc
      run: composer update phpunit/phpunit -W
    - name: Install dependencies
      working-directory: nextcloud/apps/ojsxc
      run: composer install
    - name: Enable app
      run: php -f nextcloud/occ app:enable ojsxc
    - name: Run unit tests
      working-directory: nextcloud/apps/ojsxc
      run: composer run test