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
on: [push, pull_request]
3
 
4
jobs:
5
  test:
6
    runs-on: 'ubuntu-latest'
7
 
8
    services:
9
      postgres:
10
        image: postgres:13
11
        env:
12
          POSTGRES_USER: 'postgres'
13
          POSTGRES_HOST_AUTH_METHOD: 'trust'
14
        ports:
15
          - 5432:5432
16
        options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 3
17
      mariadb:
18
        image: mariadb:10
19
        env:
20
          MYSQL_USER: 'root'
21
          MYSQL_ALLOW_EMPTY_PASSWORD: "true"
22
          MYSQL_CHARACTER_SET_SERVER: "utf8mb4"
23
          MYSQL_COLLATION_SERVER: "utf8mb4_unicode_ci"
24
 
25
        ports:
26
          - 3306:3306
27
        options: --health-cmd="mysqladmin ping" --health-interval 10s --health-timeout 5s --health-retries 3
28
 
29
    strategy:
30
      fail-fast: false
31
      matrix:
32
        include:
33
          - php: '8.1'
34
            moodle-branch: 'MOODLE_402_STABLE'
35
            database: 'pgsql'
36
          - php: '8.0'
37
            moodle-branch: 'MOODLE_401_STABLE'
38
            database: 'mariadb'
39
          - php: '7.4'
40
            moodle-branch: 'MOODLE_400_STABLE'
41
            database: 'pgsql'
42
 
43
    steps:
44
      - name: Checkout
45
        uses: actions/checkout@v3
46
        with:
47
          path: plugin
48
 
49
      - name: Setup PHP
50
        uses: shivammathur/setup-php@v2
51
        with:
52
          php-version: ${{ matrix.php }}
53
          extensions: ${{ matrix.extensions }}
54
          ini-values: max_input_vars=5000
55
          # none to use phpdbg fallback. Specify pcov (Moodle 3.10 and up) or xdebug to use them instead.
56
          coverage: none
57
 
58
      - name: Deploy moodle-plugin-ci
59
        run: |
60
          composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^3
61
          # Add dirs to $PATH
62
          echo $(cd ci/bin; pwd) >> $GITHUB_PATH
63
          echo $(cd ci/vendor/bin; pwd) >> $GITHUB_PATH
64
          # PHPUnit depends on en_AU.UTF-8 locale
65
          sudo locale-gen en_AU.UTF-8
66
 
67
      - name: Install Moodle
68
        # Need explicit IP to stop mysql client fail on attempt to use unix socket.
69
        run: moodle-plugin-ci install --plugin ./plugin --db-host=127.0.0.1
70
        env:
71
          DB: ${{ matrix.database }}
72
          MOODLE_BRANCH: ${{ matrix.moodle-branch }}
73
          IGNORE_PATHS: 'templates/local/mobile'
74
 
75
      - name: PHP Lint
76
        if: ${{ always() }}
77
        run: moodle-plugin-ci phplint
78
 
79
      - name: PHP Copy/Paste Detector
80
        continue-on-error: true # This step will show errors but will not fail
81
        if: ${{ always() }}
82
        run: moodle-plugin-ci phpcpd
83
 
84
      - name: PHP Mess Detector
85
        continue-on-error: true # This step will show errors but will not fail
86
        if: ${{ always() }}
87
        run: moodle-plugin-ci phpmd
88
 
89
      - name: Moodle Code Checker
90
        if: ${{ always() }}
91
        run: moodle-plugin-ci codechecker
92
 
93
      - name: Moodle PHPDoc Checker
94
        if: ${{ always() }}
95
        run: moodle-plugin-ci phpdoc
96
 
97
      - name: Validating
98
        if: ${{ always() }}
99
        run: moodle-plugin-ci validate
100
 
101
      - name: Check upgrade savepoints
102
        if: ${{ always() }}
103
        run: moodle-plugin-ci savepoints
104
 
105
      - name: Mustache Lint
106
        if: ${{ always() }}
107
        run: moodle-plugin-ci mustache
108
 
109
      - name: Grunt
110
        if: ${{ always() }}
111
        run: moodle-plugin-ci grunt
112
 
113
      - name: PHPUnit tests
114
        if: ${{ always() }}
115
        run: moodle-plugin-ci phpunit
116
 
117
      - name: Behat features
118
        if: ${{ always() }}
119
        run: moodle-plugin-ci behat --profile chrome