Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
name: Moodle Plugin CI
2
 
3
on:
4
  push:
5
  pull_request:
6
  workflow_dispatch:
7
  schedule:
8
    - cron: '0 0 1 * *'
9
 
10
jobs:
11
  ci:
12
    name: CI
13
    runs-on: ubuntu-20.04
14
 
15
    strategy:
16
      fail-fast: false
17
      matrix:
18
        include:
19
          - php: '8.2'
20
            database: 'pgsql'
21
            moodle-branch: 'master'
22
          - php: '8.1'
23
            database: 'pgsql'
24
            moodle-branch: 'MOODLE_403_STABLE'
25
            # EOL 2025-04-14
26
          - php: '8.0'
27
            database: 'mariadb'
28
            moodle-branch: 'MOODLE_402_STABLE'
29
            # EOL 2024-10-07
30
          - php: '7.4'
31
            database: 'mariadb'
32
            moodle-branch: 'MOODLE_401_STABLE'
33
            # LTS, EOL 2025-12-08
34
 
35
    services:
36
      postgres:
37
        image: postgres:13
38
        env:
39
          POSTGRES_USER: 'postgres'
40
          POSTGRES_HOST_AUTH_METHOD: 'trust'
41
        ports:
42
          - 5432:5432
43
        options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 3
44
 
45
      mariadb:
46
        image: mariadb:10.6
47
        env:
48
          MYSQL_USER: 'root'
49
          MYSQL_ALLOW_EMPTY_PASSWORD: "true"
50
        ports:
51
          - 3306:3306
52
        options: --health-cmd="mysqladmin ping" --health-interval 10s --health-timeout 5s --health-retries 3
53
 
54
    steps:
55
    - name: Checkout
56
      uses: actions/checkout@v3
57
      with:
58
        path: plugin
59
 
60
    - name: Setup PHP
61
      uses: shivammathur/setup-php@v2
62
      with:
63
        php-version: ${{ matrix.php }}
64
        extensions: pgsql, zip, gd
65
        ini-values: max_input_vars=5000
66
        coverage: none
67
 
68
    - name: Deploy moodle-plugin-ci
69
      run: |
70
        composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^3
71
        echo $(cd ci/bin; pwd) >> $GITHUB_PATH
72
        echo $(cd ci/vendor/bin; pwd) >> $GITHUB_PATH
73
        sudo locale-gen en_AU.UTF-8
74
        echo "NVM_DIR=$HOME/.nvm" >> $GITHUB_ENV
75
 
76
    - name: Install Moodle
77
      run: moodle-plugin-ci install --plugin ./plugin --db-host=127.0.0.1
78
      env:
79
        DB: ${{ matrix.database }}
80
        MOODLE_BRANCH: ${{ matrix.moodle-branch }}
81
        MOODLE_REPO: https://github.com/moodle/moodle.git
82
 
83
    - name: Run phplint
84
      if: ${{ always() }}
85
      run: moodle-plugin-ci phplint
86
 
87
    - name: Run phpcpd
88
      if: ${{ always() }}
89
      run: moodle-plugin-ci phpcpd
90
 
91
    - name: Run phpmd
92
      if: ${{ always() }}
93
      run: moodle-plugin-ci phpmd
94
 
95
    - name: Run codechecker
96
      if: ${{ always() }}
97
      run: moodle-plugin-ci codechecker
98
 
99
    - name: Run validate
100
      if: ${{ always() }}
101
      run: moodle-plugin-ci validate
102
 
103
    - name: Run savepoints
104
      if: ${{ always() }}
105
      run: moodle-plugin-ci savepoints
106
 
107
    - name: Run grunt
108
      if: ${{ always() }}
109
      run: moodle-plugin-ci grunt
110
 
111
    - name: Run phpdoc
112
      if: ${{ always() }}
113
      run: moodle-plugin-ci phpdoc
114
 
115
    - name: Run phpunit
116
      if: ${{ always() }}
117
      run: moodle-plugin-ci phpunit
118
 
119
    - name: Run behat
120
      if: ${{ always() }}
121
      run: moodle-plugin-ci behat --profile chrome