Skip to content

Commit 4f5ef48

Browse files
committed
MBS-10358: Implement mod_aichat
@co-authored-by Tobias Garske <tobias.garske@isb.bayern.de>
1 parent d12148e commit 4f5ef48

File tree

17 files changed

+1486
-0
lines changed

17 files changed

+1486
-0
lines changed

.github/workflows/ci.yml

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
name: Moodle Plugin CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
9+
services:
10+
postgres:
11+
image: postgres:17
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+
19+
mariadb:
20+
image: mariadb:10.11
21+
env:
22+
MYSQL_USER: 'root'
23+
MYSQL_ALLOW_EMPTY_PASSWORD: "true"
24+
MYSQL_CHARACTER_SET_SERVER: "utf8mb4"
25+
MYSQL_COLLATION_SERVER: "utf8mb4_unicode_ci"
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: ['8.3', '8.4']
34+
moodle-branch: ['main', 'MOODLE_500_STABLE', 'MOODLE_501_STABLE']
35+
database: [pgsql, mariadb]
36+
37+
steps:
38+
- name: Check out repository code
39+
uses: actions/checkout@v4
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+
# If you are not using code coverage, keep "none". Otherwise, use "pcov" (Moodle 3.10 and up) or "xdebug".
50+
# If you try to use code coverage with "none", it will fallback to phpdbg (which has known problems).
51+
coverage: none
52+
53+
- name: Initialise moodle-plugin-ci
54+
run: |
55+
composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^4
56+
echo $(cd ci/bin; pwd) >> $GITHUB_PATH
57+
echo $(cd ci/vendor/bin; pwd) >> $GITHUB_PATH
58+
sudo locale-gen en_AU.UTF-8
59+
echo "NVM_DIR=$HOME/.nvm" >> $GITHUB_ENV
60+
61+
- name: Install moodle-plugin-ci
62+
run: |
63+
moodle-plugin-ci add-plugin bycs-lp/moodle-block_ai_chat
64+
moodle-plugin-ci install --plugin ./plugin --db-host=127.0.0.1
65+
env:
66+
DB: ${{ matrix.database }}
67+
MOODLE_BRANCH: ${{ matrix.moodle-branch }}
68+
# Uncomment this to run Behat tests using the Moodle App.
69+
# MOODLE_APP: 'true'
70+
71+
- name: PHP Lint
72+
if: ${{ !cancelled() }}
73+
run: moodle-plugin-ci phplint
74+
75+
- name: Moodle Code Checker
76+
if: ${{ !cancelled() }}
77+
run: moodle-plugin-ci phpcs --max-warnings 0
78+
79+
- name: Moodle PHPDoc Checker
80+
if: ${{ !cancelled() }}
81+
run: moodle-plugin-ci phpdoc --max-warnings 0
82+
83+
- name: Validating
84+
if: ${{ !cancelled() }}
85+
run: moodle-plugin-ci validate
86+
87+
- name: Check upgrade savepoints
88+
if: ${{ !cancelled() }}
89+
run: moodle-plugin-ci savepoints
90+
91+
- name: Mustache Lint
92+
if: ${{ !cancelled() }}
93+
# Error in dialog_modal {{$title}} is expected.
94+
run: moodle-plugin-ci mustache || true
95+
96+
- name: Grunt
97+
if: ${{ !cancelled() }}
98+
run: moodle-plugin-ci grunt --max-lint-warnings 0
99+
100+
- name: PHPUnit tests
101+
if: ${{ !cancelled() }}
102+
run: moodle-plugin-ci phpunit --fail-on-warning
103+
104+
- name: Behat features
105+
id: behat
106+
if: ${{ !cancelled() }}
107+
run: moodle-plugin-ci behat --profile chrome
108+
109+
- name: Upload Behat Faildump
110+
if: ${{ failure() && steps.behat.outcome == 'failure' }}
111+
uses: actions/upload-artifact@v4
112+
with:
113+
name: Behat Faildump (${{ join(matrix.*, ', ') }})
114+
path: ${{ github.workspace }}/moodledata/behat_dump
115+
retention-days: 7
116+
if-no-files-found: ignore
117+
118+
- name: Mark cancelled jobs as failed.
119+
if: ${{ cancelled() }}
120+
run: exit 1

0 commit comments

Comments
 (0)