Skip to content

Commit f893c44

Browse files
author
Vithusha Kethiri
committed
update ci.yml
1 parent 1b0cd7b commit f893c44

File tree

1 file changed

+6
-123
lines changed

1 file changed

+6
-123
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 123 deletions
Original file line numberDiff line numberDiff line change
@@ -1,127 +1,10 @@
1-
name: Moodle plugin CI for master
1+
# .github/workflows/ci.yml
2+
name: ci
23

3-
# Controls when the action will run.
44
on: [push, pull_request]
55

66
jobs:
7-
citest:
8-
name: CI test
9-
runs-on: 'ubuntu-latest'
10-
11-
services:
12-
postgres:
13-
image: postgres
14-
env:
15-
POSTGRES_USER: 'postgres'
16-
POSTGRES_HOST_AUTH_METHOD: 'trust'
17-
options: >-
18-
--health-cmd pg_isready
19-
--health-interval 10s
20-
--health-timeout 5s
21-
--health-retries 3
22-
ports:
23-
- 5432:5432
24-
25-
mariadb:
26-
image: mariadb:10.5
27-
env:
28-
MYSQL_USER: 'root'
29-
MYSQL_ALLOW_EMPTY_PASSWORD: "true"
30-
ports:
31-
- 3306:3306
32-
options: >-
33-
--health-cmd="mysqladmin ping"
34-
--health-interval 10s
35-
--health-timeout 5s
36-
--health-retries 3
37-
strategy:
38-
fail-fast: false
39-
matrix:
40-
include:
41-
- {moodle-branch: 'MOODLE_311_STABLE', php: '7.3', node: '14.15.1', database: 'mariadb'}
42-
- {moodle-branch: 'MOODLE_311_STABLE', php: '7.3', node: '14.15.1', database: 'pgsql'}
43-
- {moodle-branch: 'MOODLE_400_STABLE', php: '7.3', node: '14.15.1', database: 'mariadb'}
44-
- {moodle-branch: 'MOODLE_400_STABLE', php: '7.3', node: '14.15.1', database: 'pgsql'}
45-
- {moodle-branch: 'MOODLE_401_STABLE', php: '7.4', node: '14.15.1', database: 'mariadb'}
46-
- {moodle-branch: 'MOODLE_401_STABLE', php: '7.4', node: '14.15.1', database: 'pgsql'}
47-
- {moodle-branch: 'MOODLE_401_STABLE', php: '8.0', node: '14.15.1', database: 'mariadb'}
48-
- {moodle-branch: 'MOODLE_401_STABLE', php: '8.0', node: '14.15.1', database: 'pgsql'}
49-
50-
steps:
51-
- name: Check out repository code
52-
uses: actions/checkout@v2
53-
with:
54-
path: plugin
55-
56-
- name: Install node ${{ matrix.node }}
57-
uses: actions/setup-node@v2
58-
with:
59-
node-version: ${{ matrix.node }}
60-
61-
- name: Setup PHP ${{ matrix.php }}
62-
uses: shivammathur/setup-php@v2
63-
with:
64-
php-version: ${{ matrix.php }}
65-
extensions: pgsql, zip, gd, xmlrpc, soap
66-
coverage: none
67-
ini-values: max_input_vars=5000
68-
69-
- name: Initialise moodle-plugin-ci
70-
run: |
71-
composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^3
72-
# Add dirs to $PATH
73-
echo $(cd ci/bin; pwd) >> $GITHUB_PATH
74-
echo $(cd ci/vendor/bin; pwd) >> $GITHUB_PATH
75-
# PHPUnit depends on en_AU.UTF-8 locale
76-
sudo locale-gen en_AU.UTF-8
77-
- name: Install Moodle
78-
run: |
79-
mkdir ~/.npm-global
80-
export PATH=~/.npm-global/bin:$PATH
81-
source ~/.profile
82-
moodle-plugin-ci install -vvv --plugin ./plugin --db-host=127.0.0.1
83-
env:
84-
DB: ${{ matrix.database }}
85-
MOODLE_BRANCH: ${{ matrix.moodle-branch }}
86-
87-
- name: Run phplint
88-
if: ${{ always() }}
89-
run: moodle-plugin-ci phplint
90-
91-
- name: Run phpcpd
92-
if: ${{ always() }}
93-
run: moodle-plugin-ci phpcpd || true
94-
95-
- name: Run phpmd
96-
if: ${{ always() }}
97-
run: moodle-plugin-ci phpmd
98-
99-
# This should be fixed as part of https://github.com/catalyst/moodle-local_datacleaner/issues/132
100-
# - name: Run codechecker
101-
# if: ${{ always() }}
102-
# run: moodle-plugin-ci codechecker
103-
104-
- name: Run validate
105-
if: ${{ always() }}
106-
run: moodle-plugin-ci validate
107-
108-
- name: Run savepoints
109-
if: ${{ always() }}
110-
run: moodle-plugin-ci savepoints
111-
112-
- name: Run mustache
113-
if: ${{ always() }}
114-
run: moodle-plugin-ci phpcpd
115-
116-
- name: Run grunt
117-
if: ${{ always() }}
118-
run: moodle-plugin-ci grunt
119-
120-
# This should be fixed as part of https://github.com/catalyst/moodle-local_datacleaner/issues/131
121-
# - name: Run phpdoc
122-
# if: ${{ always() }}
123-
# run: moodle-plugin-ci phpdoc
124-
125-
- name: Run phpunit
126-
if: ${{ always() }}
127-
run: moodle-plugin-ci phpunit
7+
ci:
8+
uses: catalyst/catalyst-moodle-workflows/.github/workflows/ci.yml@main
9+
secrets:
10+
moodle_org_token: ${{ secrets.MOODLE_ORG_TOKEN }}

0 commit comments

Comments
 (0)