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

test.yml « workflows « .github - github.com/nextcloud/twofactor_u2f.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5b0371b11b2d71c0eaabb6d9e0178b1ada0f6121 (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
60
61
62
63
64
65
name: Test

on: [push, pull_request]

jobs:
  unit-tests:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        php-version: [7.4, 8.0]
        nextcloud-version: ['master']
        include:
          - php-version: 7.4
            nextcloud-version: stable20
          - php-version: 8.0
            nextcloud-version: stable21
    name: Nextcloud ${{ matrix.nextcloud-version }} php${{ matrix.php-version }} unit tests
    steps:
    - name: Set up php${{ matrix.php-version }}
      uses: shivammathur/setup-php@master
      with:
        php-version: ${{ matrix.php-version }}
        extensions: ctype,curl,dom,gd,iconv,intl,json,mbstring,openssl,posix,sqlite,xml,zip
        coverage: xdebug
    - name: Checkout Nextcloud
      run: git clone https://github.com/nextcloud/server.git --recursive --depth 1 -b ${{ matrix.nextcloud-version }} 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 app
      uses: actions/checkout@master
      with:
        path: nextcloud/apps/twofactor_u2f
    - name: Install dependencies
      working-directory: nextcloud/apps/twofactor_u2f
      run: composer install
    - name: Fix php-parser on stable20 incompatibility with phpunit 9.3+
      if: ${{ matrix.nextcloud-version == 'stable20' }}
      working-directory: nextcloud/3rdparty
      run: composer require nikic/php-parser:4.10
    - name: Run tests
      working-directory: nextcloud/apps/twofactor_u2f
      run: composer run test:unit
    - name: Report coverage
      uses: codecov/codecov-action@v1
      if: ${{ always() }}
      with:
        file: ./nextcloud/apps/twofactor_u2f/tests/clover.unit.xml
        flags: unittests
        fail_ci_if_error: true

  frontend-unit-test:
      runs-on: ubuntu-latest
      name: Front-end unit tests
      steps:
          - uses: actions/checkout@master
          - name: Set up Node
            uses: actions/setup-node@v1
            with:
                node-version: 14.x
          - name: npm install
            run: npm install
          - name: run tests
            run: npm run test
      env:
          CI: true