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

test.yml « workflows « .github - github.com/nextcloud/tasks.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 95bcc73828b532d3bda03b088c44ea1a8e8c53ed (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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Test
on:
  pull_request:
  push:
    branches:
      - master
      - stable*

jobs:
  php-test:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        php-versions: ['7.2', '7.3', '7.4']
    name: php${{ matrix.php-versions }} test
    steps:
    - name: Checkout
      uses: actions/checkout@master
    - name: Set up php${{ matrix.php-versions }}
      if: matrix.php-versions != '7.4'
      uses: shivammathur/setup-php@master
      with:
        php-version: ${{ matrix.php-versions }}
        coverage: none
    - name: Set up php${{ matrix.php-versions }} with coverage
      if: matrix.php-versions == '7.4'
      uses: shivammathur/setup-php@master
      with:
        php-version: ${{ matrix.php-versions }}
        coverage: xdebug
    - name: Setup Nextcloud
      run: |
        mysql -u root -proot -e 'create database oc_autotest;'
        mysql -u root -proot -e "CREATE USER 'oc_autotest'@'localhost' IDENTIFIED BY '';"
        mysql -u root -proot -e "GRANT ALL ON oc_autotest.* TO 'oc_autotest'@'localhost';"
        cd ..
        git clone https://github.com/nextcloud/server.git --recursive --depth 1 -b master core
        cp -r tasks core/apps/
        php -f core/occ maintenance:install --database-name oc_autotest --database-user oc_autotest --admin-user admin --admin-pass admin --database mysql --database-pass=''
    - name: Setup Tasks
      run: |
        cd ..
        php -f ./core/occ app:enable tasks
        # Enable app twice to check occ errors of registered commands
        php -f core/occ app:enable tasks
        cd core/apps/tasks
        php ../../occ app:check-code tasks
    - name: Test PHP
      if: matrix.php-versions != '7.4'
      run: |
        cd ../core/apps/tasks
        make test-php
        # Check php test coverage and upload to codecov
    - name: Test PHP with coverage
      if: matrix.php-versions == '7.4'
      run: |
        cd ../core/apps/tasks
        make test-php-coverage
        bash <(curl -s https://codecov.io/bash) -cF php -t ${{ secrets.CODECOV_TOKEN }};

  node-test:
    runs-on: ubuntu-latest
    name: Javascript test
    steps:
    - uses: actions/checkout@master
    - name: Set up Node
      uses: actions/setup-node@v1
      with:
        node-version: 12.x
    - name: npm install
      run: npm ci
    - name: Set up Codecov
      run: npm install -g codecov
    - name: Test
      run: npm run test
      env:
        CI: true
    - name: Upload coverage
      run: bash <(curl -s https://codecov.io/bash) -cF javascript -t ${{ secrets.CODECOV_TOKEN }};