|
1 | 1 | name: Moodle Plugin CI
|
2 |
| - |
3 |
| -on: [push, pull_request] |
| 2 | +on: [ push, pull_request ] |
4 | 3 |
|
5 | 4 | jobs:
|
6 |
| - static: |
7 |
| - runs-on: ubuntu-latest |
8 |
| - |
9 |
| - strategy: |
10 |
| - matrix: |
11 |
| - php: ['8.3'] |
12 |
| - moodle-branch: ['MOODLE_405_STABLE'] |
13 |
| - database: ['pgsql'] |
14 |
| - |
15 |
| - steps: |
16 |
| - - name: Start PostgreSQL |
17 |
| - run: docker run -p 5432:5432 -e POSTGRES_USER=postgres -e POSTGRES_HOST_AUTH_METHOD=trust -d postgres:14 |
18 |
| - |
19 |
| - - name: Check out repository code |
20 |
| - uses: actions/checkout@v3 |
21 |
| - with: |
22 |
| - path: plugin |
23 |
| - |
24 |
| - - name: Setup PHP ${{ matrix.php }} |
25 |
| - uses: shivammathur/setup-php@v2 |
26 |
| - with: |
27 |
| - php-version: ${{ matrix.php }} |
28 |
| - ini-values: max_input_vars=5000 |
29 |
| - coverage: none |
30 |
| - |
31 |
| - - name: Get composer cache directory |
32 |
| - id: composer-cache |
33 |
| - run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT |
34 |
| - |
35 |
| - - name: Composer cache |
36 |
| - uses: actions/cache@v3 |
37 |
| - with: |
38 |
| - path: ${{ steps.composer-cache.outputs.dir }} |
39 |
| - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} |
40 |
| - restore-keys: | |
41 |
| - ${{ runner.os }}-composer- |
42 |
| -
|
43 |
| - - name: npm cache |
44 |
| - uses: actions/cache@v3 |
45 |
| - with: |
46 |
| - path: ~/.npm |
47 |
| - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} |
48 |
| - restore-keys: | |
49 |
| - ${{ runner.os }}-node- |
50 |
| -
|
51 |
| - - name: Initialise moodle-plugin-ci |
52 |
| - run: | |
53 |
| - composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci 4.5.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 --no-init |
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 |
| - if: ${{ always() }} |
72 |
| - run: moodle-plugin-ci phpcpd |
73 |
| - continue-on-error: true |
74 |
| - |
75 |
| - - name: PHP Mess Detector |
76 |
| - if: ${{ always() }} |
77 |
| - run: moodle-plugin-ci phpmd |
78 |
| - |
79 |
| - - name: Moodle Code Checker |
80 |
| - if: ${{ always() }} |
81 |
| - run: moodle-plugin-ci codechecker |
82 |
| - |
83 |
| - - name: Moodle PHPDoc Checker |
84 |
| - if: ${{ always() }} |
85 |
| - run: moodle-plugin-ci phpdoc |
86 |
| - continue-on-error: true |
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 |
| - continue-on-error: true |
100 |
| - |
101 |
| - - name: Grunt |
102 |
| - if: ${{ always() }} |
103 |
| - run: moodle-plugin-ci grunt |
104 |
| - continue-on-error: true |
105 |
| - |
106 |
| - test: |
107 |
| - runs-on: ubuntu-latest |
108 |
| - needs: static |
109 |
| - |
110 |
| - strategy: |
111 |
| - fail-fast: false |
112 |
| - matrix: |
113 |
| - php: ['8.0', '8.1', '8.2', '8.3'] |
114 |
| - moodle-branch: ['MOODLE_403_STABLE', 'MOODLE_404_STABLE', 'MOODLE_405_STABLE'] |
115 |
| - database: ['mariadb', 'pgsql'] |
116 |
| - exclude: |
117 |
| - - php: '8.0' |
118 |
| - moodle-branch: 'MOODLE_404_STABLE' |
119 |
| - - php: '8.0' |
120 |
| - moodle-branch: 'MOODLE_405_STABLE' |
121 |
| - - php: '8.3' |
122 |
| - moodle-branch: 'MOODLE_403_STABLE' |
123 |
| - |
124 |
| - steps: |
125 |
| - - name: Start MariaDB |
126 |
| - if: matrix.database == 'mariadb' |
127 |
| - run: docker run -p 3306:3306 -e MYSQL_USER=root -e MYSQL_ALLOW_EMPTY_PASSWORD=true -d mariadb:10 |
128 |
| - |
129 |
| - - name: Start PostgreSQL |
130 |
| - if: matrix.database == 'pgsql' |
131 |
| - run: docker run -p 5432:5432 -e POSTGRES_USER=postgres -e POSTGRES_HOST_AUTH_METHOD=trust -d postgres:14 |
132 |
| - |
133 |
| - - name: Check out repository code |
134 |
| - uses: actions/checkout@v3 |
135 |
| - with: |
136 |
| - path: plugin |
137 |
| - |
138 |
| - - name: Setup PHP ${{ matrix.php }} |
139 |
| - uses: shivammathur/setup-php@v2 |
140 |
| - with: |
141 |
| - php-version: ${{ matrix.php }} |
142 |
| - ini-values: max_input_vars=5000 |
143 |
| - coverage: none |
144 |
| - |
145 |
| - - name: Get composer cache directory |
146 |
| - id: composer-cache |
147 |
| - run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT |
148 |
| - - name: Composer cache |
149 |
| - uses: actions/cache@v3 |
150 |
| - with: |
151 |
| - path: ${{ steps.composer-cache.outputs.dir }} |
152 |
| - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} |
153 |
| - restore-keys: | |
154 |
| - ${{ runner.os }}-composer- |
155 |
| - - name: npm cache |
156 |
| - uses: actions/cache@v3 |
157 |
| - with: |
158 |
| - path: ~/.npm |
159 |
| - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} |
160 |
| - restore-keys: | |
161 |
| - ${{ runner.os }}-node- |
162 |
| -
|
163 |
| - - name: Initialise moodle-plugin-ci |
164 |
| - run: | |
165 |
| - composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci 4.5.4 |
166 |
| - echo $(cd ci/bin; pwd) >> $GITHUB_PATH |
167 |
| - echo $(cd ci/vendor/bin; pwd) >> $GITHUB_PATH |
168 |
| - sudo locale-gen en_AU.UTF-8 |
169 |
| - echo "NVM_DIR=$HOME/.nvm" >> $GITHUB_ENV |
170 |
| -
|
171 |
| - - name: Install moodle-plugin-ci |
172 |
| - run: | |
173 |
| - moodle-plugin-ci install --plugin ./plugin --db-host=127.0.0.1 |
174 |
| - env: |
175 |
| - DB: ${{ matrix.database }} |
176 |
| - MOODLE_BRANCH: ${{ matrix.moodle-branch }} |
177 |
| - |
178 |
| - - name: PHPUnit tests |
179 |
| - if: ${{ always() }} |
180 |
| - run: moodle-plugin-ci phpunit |
181 |
| - |
182 |
| - - name: Behat features |
183 |
| - if: ${{ always() }} |
184 |
| - run: moodle-plugin-ci behat --auto-rerun 0 |
| 5 | + call: |
| 6 | + name: "" |
| 7 | + uses: learnweb/moodle-workflows-learnweb/.github/workflows/moodle-ci.yml@main |
| 8 | + with: |
| 9 | + allow-mustache-lint-error: true |
0 commit comments