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