Skip to content

Commit c17a2c2

Browse files
authored
Temporary CI Fix (#117)
* Fix Syntax for moodle-plugin-ci: Provide path to plugin source as last argument * Temporary fix for CI moodlehq/moodle-plugin-ci#310
1 parent 5129d90 commit c17a2c2

File tree

1 file changed

+44
-25
lines changed

1 file changed

+44
-25
lines changed

.github/workflows/moodle-plugin-ci.yml

+44-25
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on: [push, pull_request]
44

55
jobs:
66
test:
7-
runs-on: ubuntu-latest
7+
runs-on: ubuntu-22.04
88

99
services:
1010
postgres:
@@ -15,11 +15,14 @@ jobs:
1515
ports:
1616
- 5432:5432
1717
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 3
18+
1819
mariadb:
19-
image: mariadb:10.6
20+
image: mariadb:10
2021
env:
2122
MYSQL_USER: 'root'
2223
MYSQL_ALLOW_EMPTY_PASSWORD: "true"
24+
MYSQL_CHARACTER_SET_SERVER: "utf8mb4"
25+
MYSQL_COLLATION_SERVER: "utf8mb4_unicode_ci"
2326
ports:
2427
- 3306:3306
2528
options: --health-cmd="mysqladmin ping" --health-interval 10s --health-timeout 5s --health-retries 3
@@ -96,6 +99,8 @@ jobs:
9699
php-version: ${{ matrix.php }}
97100
extensions: ${{ matrix.extensions }}
98101
ini-values: max_input_vars=5000
102+
# If you are not using code coverage, keep "none". Otherwise, use "pcov" (Moodle 3.10 and up) or "xdebug".
103+
# If you try to use code coverage with "none", it will fallback to phpdbg (which has known problems).
99104
coverage: none
100105

101106
- name: Initialise moodle-plugin-ci
@@ -104,11 +109,11 @@ jobs:
104109
echo $(cd ci/bin; pwd) >> $GITHUB_PATH
105110
echo $(cd ci/vendor/bin; pwd) >> $GITHUB_PATH
106111
sudo locale-gen en_AU.UTF-8
107-
echo "NVM_DIR=$HOME/.nvm" >> $GITHUB_ENV
112+
# echo "NVM_DIR=$HOME/.nvm" >> $GITHUB_ENV
113+
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
108114
109115
- name: Install moodle-plugin-ci
110-
run: |
111-
moodle-plugin-ci install --plugin ./plugin --db-host=127.0.0.1
116+
run: moodle-plugin-ci install --plugin ./plugin --db-host=127.0.0.1
112117
env:
113118
DB: ${{ matrix.database }}
114119
MOODLE_BRANCH: ${{ matrix.moodle-branch }}
@@ -117,42 +122,56 @@ jobs:
117122
PHPDOCCHECKER_IGNORE_PATHS: classes/vendor
118123

119124
- name: PHP Lint
120-
if: ${{ always() }}
121-
run: moodle-plugin-ci phplint
125+
if: ${{ !cancelled() }}
126+
run: moodle-plugin-ci phplint ./plugin
122127

123128
- name: PHP Mess Detector
124129
continue-on-error: true # This step will show errors but will not fail
125-
if: ${{ always() }}
126-
run: moodle-plugin-ci phpmd
130+
if: ${{ !cancelled() }}
131+
run: moodle-plugin-ci phpmd ./plugin
127132

128133
- name: Moodle Code Checker
129-
if: ${{ always() }}
130-
run: moodle-plugin-ci codechecker --max-warnings 0 || true
134+
if: ${{ !cancelled() }}
135+
run: moodle-plugin-ci codechecker --max-warnings 0 ./plugin || true
131136

132137
- name: Moodle PHPDoc Checker
133-
if: ${{ always() }}
134-
run: moodle-plugin-ci phpdoc || true
138+
if: ${{ !cancelled() }}
139+
run: moodle-plugin-ci phpdoc --max-warnings 0 ./plugin || true
135140

136141
- name: Validating
137-
if: ${{ always() }}
138-
run: moodle-plugin-ci validate
142+
if: ${{ !cancelled() }}
143+
run: moodle-plugin-ci validate ./plugin
139144

140145
- name: Check upgrade savepoints
141-
if: ${{ always() }}
142-
run: moodle-plugin-ci savepoints
146+
if: ${{ !cancelled() }}
147+
run: moodle-plugin-ci savepoints ./plugin
143148

144149
- name: Mustache Lint
145-
if: ${{ always() }}
146-
run: moodle-plugin-ci mustache || true
150+
if: ${{ !cancelled() }}
151+
run: moodle-plugin-ci mustache ./plugin || true
147152

148153
- name: Grunt
149-
if: ${{ always() }}
150-
run: moodle-plugin-ci grunt || true
154+
if: ${{ !cancelled() }}
155+
run: moodle-plugin-ci grunt ./plugin || true
151156

152157
- name: PHPUnit tests
153-
if: ${{ always() }}
154-
run: moodle-plugin-ci phpunit --coverage-text || true
158+
if: ${{ !cancelled() }}
159+
run: moodle-plugin-ci phpunit --coverage-text ./plugin || true
155160

156161
- name: Behat features
157-
if: ${{ always() }}
158-
run: moodle-plugin-ci behat --profile chrome
162+
id: behat
163+
if: ${{ !cancelled() }}
164+
run: moodle-plugin-ci behat --profile chrome ./plugin
165+
166+
- name: Upload Behat Faildump
167+
if: ${{ failure() && steps.behat.outcome == 'failure' }}
168+
uses: actions/upload-artifact@v4
169+
with:
170+
name: Behat Faildump (${{ join(matrix.*, ', ') }})
171+
path: ${{ github.workspace }}/moodledata/behat_dump
172+
retention-days: 7
173+
if-no-files-found: ignore
174+
175+
- name: Mark cancelled jobs as failed.
176+
if: ${{ cancelled() }}
177+
run: exit 1

0 commit comments

Comments
 (0)