Skip to content

Commit b182bba

Browse files
committed
Github actions config update to match upstream's template
1 parent 7bbc917 commit b182bba

File tree

1 file changed

+34
-37
lines changed

1 file changed

+34
-37
lines changed

.github/workflows/ci.yml

Lines changed: 34 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
name: Moodle Plugin CI checks
1+
name: Moodle Plugin CI
22

33
on: [push, pull_request]
44

55
jobs:
6-
moodle-plugin-ci:
7-
runs-on: ubuntu-latest
6+
test:
7+
runs-on: ubuntu-18.04
88

99
services:
1010
postgres:
@@ -18,96 +18,93 @@ jobs:
1818

1919
strategy:
2020
fail-fast: false
21+
matrix:
22+
php: ['7.3']
23+
moodle-branch: ['MOODLE_310_STABLE']
24+
database: [pgsql]
2125

2226
steps:
2327
- name: Check out repository code
2428
uses: actions/checkout@v2
2529
with:
2630
path: plugin
2731

28-
- name: Install node
29-
uses: actions/setup-node@v1
30-
with:
31-
node-version: '14.15.0'
32-
33-
- name: Setup PHP environment
32+
- name: Setup PHP ${{ matrix.php }}
3433
uses: shivammathur/setup-php@v2
3534
with:
36-
php-version: '7.3'
37-
extensions: mbstring, pgsql
38-
tools: phpunit
35+
php-version: ${{ matrix.php }}
36+
coverage: none
3937

40-
- name: Deploy moodle-plugin-ci
38+
- name: Initialise moodle-plugin-ci
4139
run: |
4240
composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^3
4341
echo $(cd ci/bin; pwd) >> $GITHUB_PATH
4442
echo $(cd ci/vendor/bin; pwd) >> $GITHUB_PATH
4543
sudo locale-gen en_AU.UTF-8
44+
echo "NVM_DIR=$HOME/.nvm" >> $GITHUB_ENV
4645
4746
- name: Install moodle-plugin-ci
48-
run: moodle-plugin-ci install -vvv --plugin ./plugin
47+
run: |
48+
moodle-plugin-ci install --plugin ./plugin --db-host=127.0.0.1
4949
env:
50-
DB: 'pgsql'
51-
MOODLE_BRANCH: 'MOODLE_310_STABLE'
50+
DB: ${{ matrix.database }}
51+
MOODLE_BRANCH: ${{ matrix.moodle-branch }}
5252
IGNORE_PATHS: 'tests/fixtures/'
5353

54-
- name: Run phplint
54+
- name: PHP Lint
5555
if: ${{ always() }}
5656
run: moodle-plugin-ci phplint
5757

58-
- name: Run phpcpd
59-
continue-on-error: true
58+
- name: PHP Copy/Paste Detector
59+
continue-on-error: true # This step will show errors but will not fail
6060
if: ${{ always() }}
6161
run: moodle-plugin-ci phpcpd
6262

63-
- name: Run phpmd
64-
continue-on-error: true
63+
- name: PHP Mess Detector
64+
continue-on-error: true # This step will show errors but will not fail
6565
if: ${{ always() }}
6666
run: moodle-plugin-ci phpmd
6767

68-
- name: Run codechecker
68+
- name: Moodle Code Checker
6969
if: ${{ always() }}
7070
run: moodle-plugin-ci codechecker --max-warnings 0
7171

72-
- name: Run validate
73-
# AMOS has its own tables prefixed with 'amos' instead of 'local_amos' for legacy reasons.
74-
continue-on-error: true
72+
- name: Moodle PHPDoc Checker
73+
if: ${{ always() }}
74+
run: moodle-plugin-ci phpdoc
75+
76+
- name: Validating
77+
continue-on-error: true # AMOS has its own tables prefixed with 'amos' instead of 'local_amos' for legacy reasons.
7578
if: ${{ always() }}
7679
run: moodle-plugin-ci validate
7780

78-
- name: Run savepoints
81+
- name: Check upgrade savepoints
7982
if: ${{ always() }}
8083
run: moodle-plugin-ci savepoints
8184

82-
- name: Run mustache
83-
# Some validation warnings are unavoidable as individual templates may not be fully valid HTML (e.g. table rows).
84-
continue-on-error: true
85+
- name: Mustache Lint
8586
if: ${{ always() }}
8687
run: moodle-plugin-ci mustache
8788

88-
- name: Run grunt
89+
- name: Grunt
8990
if: ${{ always() }}
9091
run: moodle-plugin-ci grunt --tasks=compile --max-lint-warnings 0
9192

92-
- name: Run phpdoc
93-
if: ${{ always() }}
94-
run: moodle-plugin-ci phpdoc
95-
96-
- name: Run AMOS phpunit tests
93+
- name: PHPUnit tests
9794
if: ${{ always() }}
9895
# AMOS runs git as a part of unit tests.
9996
run: |
10097
git config --global user.name "Github Runner"
10198
git config --global user.email "[email protected]"
10299
moodle-plugin-ci phpunit
103100
104-
- name: Run related core phpunit tests
101+
- name: Privacy tests
105102
if: ${{ always() }}
106103
run: |
107104
cd moodle
108105
vendor/bin/phpunit --fail-on-risky --disallow-test-output -v admin/tool/dataprivacy/tests/metadata_registry_test.php
109106
vendor/bin/phpunit --fail-on-risky --disallow-test-output -v privacy/tests/provider_test.php
110107
111-
- name: Run behat
108+
- name: Behat features
112109
if: ${{ always() }}
113110
run: moodle-plugin-ci behat --profile chrome

0 commit comments

Comments
 (0)