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: [push, pull_request]
4
 
5
jobs:
6
  test:
7
    runs-on: ubuntu-22.04
8
 
9
    services:
10
      postgres:
11
        image: postgres:13
12
        env:
13
          POSTGRES_USER: 'postgres'
14
          POSTGRES_HOST_AUTH_METHOD: 'trust'
15
        ports:
16
          - 5432:5432
17
        options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 3
18
 
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
        ports:
27
          - 3306:3306
28
        options: --health-cmd="mysqladmin ping" --health-interval 10s --health-timeout 5s --health-retries 3
29
 
30
    strategy:
31
      fail-fast: false
32
      matrix:
33
        php: ['8.0', '8.1', '8.2']
34
        moodle-branch: ['MOODLE_403_STABLE']
35
        database: [pgsql, mariadb]
36
 
37
    steps:
38
      - name: Check out repository code
39
        uses: actions/checkout@v3
40
        with:
41
          path: plugin
42
 
43
      - name: Setup PHP ${{ matrix.php }}
44
        uses: shivammathur/setup-php@v2
45
        with:
46
          php-version: ${{ matrix.php }}
47
          extensions: ${{ matrix.extensions }}
48
          ini-values: max_input_vars=5000
49
          coverage: none
50
 
51
      - name: Initialise moodle-plugin-ci
52
        run: |
53
          composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^4
54
          echo $(cd ci/bin; pwd) >> $GITHUB_PATH
55
          echo $(cd ci/vendor/bin; pwd) >> $GITHUB_PATH
56
          sudo locale-gen en_AU.UTF-8
57
          echo "NVM_DIR=$HOME/.nvm" >> $GITHUB_ENV
58
 
59
      - name: Install moodle-plugin-ci
60
        run: |
61
          moodle-plugin-ci install --plugin ./plugin --db-host=127.0.0.1
62
        env:
63
          DB: ${{ matrix.database }}
64
          MOODLE_BRANCH: ${{ matrix.moodle-branch }}
65
 
66
      - name: PHP Lint
67
        if: ${{ always() }}
68
        run: moodle-plugin-ci phplint
69
 
70
      - name: PHP Copy/Paste Detector
71
        continue-on-error: true # This step will show errors but will not fail
72
        if: ${{ always() }}
73
        run: moodle-plugin-ci phpcpd
74
 
75
      - name: PHP Mess Detector
76
        continue-on-error: true # This step will show errors but will not fail
77
        if: ${{ always() }}
78
        run: moodle-plugin-ci phpmd
79
 
80
      - name: Moodle Code Checker
81
        if: ${{ always() }}
82
        run: moodle-plugin-ci phpcs --max-warnings 0
83
 
84
      - name: Moodle PHPDoc Checker
85
        if: ${{ always() }}
86
        run: moodle-plugin-ci phpdoc --max-warnings 0
87
 
88
      - name: Validating
89
        if: ${{ always() }}
90
        run: moodle-plugin-ci validate
91
 
92
      - name: Check upgrade savepoints
93
        if: ${{ always() }}
94
        run: moodle-plugin-ci savepoints
95
 
96
      - name: Mustache Lint
97
        if: ${{ always() }}
98
        run: moodle-plugin-ci mustache
99
 
100
      - name: Grunt
101
        if: ${{ always() }}
102
        run: moodle-plugin-ci grunt --max-lint-warnings 0
103
 
104
      - name: PHPUnit tests
105
        if: ${{ always() }}
106
        run: moodle-plugin-ci phpunit --fail-on-warning
107
 
108
      - name: Behat features
109
        if: ${{ always() }}
110
        run: moodle-plugin-ci behat --profile chrome