Skip to content

Commit deb566e

Browse files
authored
Update ci.yml
1 parent e9f4385 commit deb566e

File tree

1 file changed

+9
-106
lines changed

1 file changed

+9
-106
lines changed

.github/workflows/ci.yml

+9-106
Original file line numberDiff line numberDiff line change
@@ -1,110 +1,13 @@
1-
name: Moodle Plugin CI
1+
# .github/workflows/ci.yml
2+
name: ci
23

34
on: [push, pull_request]
45

56
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-
mariadb:
19-
image: mariadb:10
20-
env:
21-
MYSQL_USER: 'root'
22-
MYSQL_ALLOW_EMPTY_PASSWORD: "true"
23-
MYSQL_CHARACTER_SET_SERVER: "utf8mb4"
24-
MYSQL_COLLATION_SERVER: "utf8mb4_unicode_ci"
25-
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: ['7.4', '8.0']
34-
moodle-branch: ['master']
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-
# none to use phpdbg fallback. Specify pcov (Moodle 3.10 and up) or xdebug to use them instead.
50-
coverage: none
51-
52-
- name: Initialise moodle-plugin-ci
53-
run: |
54-
composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^3
55-
echo $(cd ci/bin; pwd) >> $GITHUB_PATH
56-
echo $(cd ci/vendor/bin; pwd) >> $GITHUB_PATH
57-
sudo locale-gen en_AU.UTF-8
58-
echo "NVM_DIR=$HOME/.nvm" >> $GITHUB_ENV
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 codechecker --max-warnings 0
83-
84-
- name: Moodle PHPDoc Checker
85-
if: ${{ always() }}
86-
run: moodle-plugin-ci phpdoc
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
7+
ci:
8+
uses: catalyst/catalyst-moodle-workflows/.github/workflows/ci.yml@main
9+
# Required if you plan to publish (uncomment the below)
10+
secrets:
11+
moodle_org_token: ${{ secrets.MOODLE_ORG_TOKEN }}
12+
with:
13+
disable_phpcpd: true

0 commit comments

Comments
 (0)