Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
name: Tests
2
 
3
on: [push, pull_request]
4
 
5
jobs:
6
  ci:
7
    name: ci
8
    runs-on: ubuntu-latest
9
 
10
    services:
11
      postgres:
12
        image: postgres
13
        env:
14
          POSTGRES_USER: 'postgres'
15
          POSTGRES_HOST_AUTH_METHOD: 'trust'
16
        options: --health-cmd="pg_isready" --health-interval 10s --health-timeout 5s --health-retries 5
17
        ports:
18
          - 5432:5432
19
      mariadb:
20
        image: mariadb:10
21
        env:
22
          MYSQL_USER: 'root'
23
          MYSQL_ALLOW_EMPTY_PASSWORD: "true"
24
          MYSQL_CHARACTER_SET_SERVER: "utf8mb4"
25
          MYSQL_COLLATION_SERVER: "utf8mb4_unicode_ci"
26
        options: --health-cmd="mysqladmin ping" --health-interval 10s --health-timeout 5s --health-retries 3
27
        ports:
28
          - 3306:3306
29
 
30
    strategy:
31
      fail-fast: false
32
      matrix:
33
        php: ['8.2']
34
        moodle-branch: ['MOODLE_402_STABLE', 'MOODLE_403_STABLE', 'MOODLE_404_STABLE']
35
        database: ['mariadb', 'pgsql']
36
        include:
37
          - php: '8.3'
38
            moodle-branch: 'main'
39
            database: 'pgsql'
40
 
41
    steps:
42
      - name: checkout plugin
43
        uses: actions/checkout@v4
44
        with:
45
          path: this-plugin
46
 
47
      - name: setup PHP
48
        uses: shivammathur/setup-php@v2
49
        with:
50
          php-version: ${{ matrix.php }}
51
          ini-values: max_input_vars=5000
52
          tools: composer:v2.5
53
          coverage: pcov
54
 
55
      - name: composer
56
        run: |
57
           composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci
58
           echo $(cd ci/bin; pwd) >> $GITHUB_PATH
59
           echo $(cd ci/vendor/bin; pwd) >> $GITHUB_PATH
60
           sudo locale-gen en_AU.UTF-8
61
 
62
      - name: install Moodle
63
        run: moodle-plugin-ci --ansi install --db-host=127.0.0.1 --plugin this-plugin
64
        env:
65
          DB: ${{ matrix.database }}
66
          MOODLE_BRANCH: ${{ matrix.moodle-branch }}
67
 
68
      - name: phplint
69
        if: ${{ !cancelled() }}
70
        run: moodle-plugin-ci --ansi phplint
71
 
72
      - name: phpmd
73
        if: ${{ !cancelled() }}
74
        run: moodle-plugin-ci --ansi phpmd
75
 
76
      - name: phpdoc
77
        if: ${{ !cancelled() }}
78
        run: moodle-plugin-ci --ansi phpdoc
79
 
80
      - name: codechecker
81
        if: ${{ !cancelled() }}
82
        run: moodle-plugin-ci --ansi codechecker
83
 
84
      - name: validate
85
        if: ${{ !cancelled() }}
86
        run: moodle-plugin-ci --ansi validate
87
 
88
      - name: savepoints
89
        if: ${{ !cancelled() }}
90
        run: moodle-plugin-ci --ansi savepoints
91
 
92
      - name: grunt
93
        if: ${{ matrix.moodle-branch == 'main'}}
94
        run: moodle-plugin-ci --ansi grunt
95
 
96
      - name: mustache
97
        if: ${{ !cancelled() }}
98
        run: moodle-plugin-ci --ansi mustache
99
 
100
      - name: phpunit
101
        if: ${{ !cancelled() }}
102
        run: moodle-plugin-ci --ansi phpunit --coverage-text --coverage-clover
103
 
104
      - name: privacy
105
        if: ${{ matrix.moodle-branch == 'main'}}
106
        run: vendor/bin/phpunit --colors --no-coverage --testsuite tool_dataprivacy_testsuite,tool_policy_testsuite,core_privacy_testsuite
107
        working-directory: moodle
108
 
109
      - name: other
110
        if: ${{ matrix.moodle-branch == 'main'}}
111
        run: vendor/bin/phpunit --colors --no-coverage --testsuite core_availability_testsuite
112
        working-directory: moodle
113
 
114
      - name: coveralls
115
        if: ${{ matrix.moodle-branch == 'main'}}
116
        run: moodle-plugin-ci coveralls-upload || true
117
        env:
118
          COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
119
 
120
      - name: firefox
121
        if: ${{ !cancelled() }}
122
        run: moodle-plugin-ci --ansi behat
123
 
124
      - name: chrome
125
        if: ${{ !cancelled() }}
126
        run: moodle-plugin-ci --ansi behat --profile chrome
127
 
128
      - name: firefox classic
129
        if: ${{ !cancelled() }}
130
        run: moodle-plugin-ci --ansi behat --suite="classic"
131
 
132
      - name: chrome classic
133
        if: ${{ !cancelled() }}
134
        run: moodle-plugin-ci --ansi behat  --suite="classic" --profile chrome
135
 
136
      - name: admin bookmarks
137
        if: ${{ matrix.moodle-branch == 'main'}}
138
        run: moodle-plugin-ci --ansi behat --auto-rerun=0 --profile chrome blocks/admin_bookmarks
139
        working-directory: moodle
140
 
141
      - name: admin xmldb
142
        if: ${{ matrix.moodle-branch == 'main'}}
143
        run: moodle-plugin-ci --ansi behat --auto-rerun=0 --profile chrome admin/tool/xmldb
144
        working-directory: moodle
145