Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH Actions integration. #8

Merged
merged 46 commits into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
25db466
add PHP code sniffer config file.
stopfstedt May 23, 2024
73c1a01
rigs up CI pipeline via GH Actions.
stopfstedt May 23, 2024
50f4e8b
auto-fix PHP code linter errors.
stopfstedt May 23, 2024
a25817f
corrects code linting errors in admin_email script.
stopfstedt May 23, 2024
d410386
corrects code linting errors in admin_email_form.php
stopfstedt May 23, 2024
e513530
corrects code linting errors in email.php
stopfstedt May 24, 2024
fdfa4f5
corrects code linting errors in language files.
stopfstedt May 24, 2024
ee8bdb4
Corrects PHP linter errors in version.php
stopfstedt May 24, 2024
8602a07
corrects PHP linting errors in alternate.php
stopfstedt May 24, 2024
8b08f0b
corrects PHP linting erros in alt_lib.php
stopfstedt May 24, 2024
a0a439d
Corrects PHP linter errors in alt_form.php
stopfstedt May 24, 2024
a62afff
aligns function visibility scope of definition() with overwritten par…
stopfstedt May 24, 2024
04d4941
Corrects PHP linter errors in signature_form.php
stopfstedt May 24, 2024
d0b55a5
Corrects PHP linter errors in signature.php
stopfstedt May 24, 2024
890d321
Corrects PHP linting errors in block_quickmail.php
stopfstedt May 24, 2024
6ca686b
Corrects PHP linter errors in email_form.php
stopfstedt May 24, 2024
22b8a8a
moves login check back where it was.
stopfstedt May 24, 2024
75643aa
Cleans up PHP linter errors in emaillog.php
stopfstedt May 24, 2024
0a08428
Corrects PHP linter errors in lib.php
stopfstedt May 24, 2024
3568408
Corrects PHP linter errors in classes/message.php
stopfstedt May 24, 2024
8775d3a
Corrects PHP linter errors in config_qm.php
stopfstedt May 28, 2024
a15ac29
Corrects PHP linter warnings in config_qm_form.php
stopfstedt May 28, 2024
5729ddd
Corrects PHP linter errors in settings.php
stopfstedt May 28, 2024
91c86cc
Corrects PHP linter warnings in /db files.
stopfstedt May 28, 2024
6b1163f
replace deprecrated constant with its value.
stopfstedt May 28, 2024
53b7d46
Corrects PHP linter errors in classes/event/alternate_email_added.php
stopfstedt May 28, 2024
1d04625
Corrects PHP linter errors in backup/moodle2/restore_quickmail_stepsl…
stopfstedt May 28, 2024
3f6f3cd
Corrects PHP linter errors in backup/moodle2/backup_quickmail_block_t…
stopfstedt May 28, 2024
782f155
corrects param annotation in doc block.
stopfstedt May 28, 2024
a7bb51d
corrects docblock description for backup task.
stopfstedt May 28, 2024
1ef648f
Corrects PHP linter errors in backup/moodle2/backup_stepslib.php
stopfstedt May 28, 2024
a7ee2c4
Corrects PHP linter errors in quickmail/backup/restore_quickmail_bloc…
stopfstedt May 28, 2024
f5d839c
fix up any remaining PHPCS linter errors.
stopfstedt May 28, 2024
adc6416
correct linter warnings by alphabetically sorting lang strings by the…
stopfstedt May 28, 2024
cf162f5
fix up docblock on method that phpdoc was nagging about.
stopfstedt May 28, 2024
013271a
adds missing tags to behat feature.
stopfstedt May 28, 2024
3b34168
corrects failing savepoints checks.
stopfstedt May 28, 2024
7631b4e
applies code standard fixes to behat test features.
stopfstedt May 28, 2024
0ca5a0e
cleans up linter errors in stylesheet.
stopfstedt May 28, 2024
5d91f67
wip: adds privacy provider.
stopfstedt May 30, 2024
153834b
fix up variables names.
stopfstedt May 30, 2024
d23b47f
fixes goobered up lang string.
stopfstedt May 31, 2024
1cd13cf
wip: fixes up behat tests.
stopfstedt May 31, 2024
e02799f
suppress the behat scenarios in the ferpa feature from running.
stopfstedt May 31, 2024
5876d90
rm kruft
stopfstedt May 31, 2024
9467a29
version bump.
stopfstedt May 31, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 109 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: Moodle Plugin CI

on:
push:
pull_request:
schedule:
- cron: '33 2 * * 1' # weekly, on Monday morning

jobs:
test:
runs-on: ubuntu-latest

services:
mariadb:
image: mariadb:10
env:
MYSQL_USER: 'root'
MYSQL_ALLOW_EMPTY_PASSWORD: "true"
MYSQL_CHARACTER_SET_SERVER: "utf8mb4"
MYSQL_COLLATION_SERVER: "utf8mb4_unicode_ci"
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval 10s --health-timeout 5s --health-retries 3

strategy:
fail-fast: false
matrix:
include:
- php: '8.2'
moodle-branch: 'main'
database: 'mariadb'
- php: '8.2'
moodle-branch: 'MOODLE_403_STABLE'
database: 'mariadb'
steps:
- name: Check out repository code
uses: actions/checkout@v3
with:
path: plugin

- name: Setup PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: ${{ matrix.extensions }}
ini-values: max_input_vars=5000
# If you are not using code coverage, keep "none". Otherwise, use "pcov" (Moodle 3.10 and up) or "xdebug".
# If you try to use code coverage with "none", it will fallback to phpdbg (which has known problems).
coverage: none

- name: Initialise moodle-plugin-ci
run: |
composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^4
echo $(cd ci/bin; pwd) >> $GITHUB_PATH
echo $(cd ci/vendor/bin; pwd) >> $GITHUB_PATH
sudo locale-gen en_AU.UTF-8
echo "NVM_DIR=$HOME/.nvm" >> $GITHUB_ENV

- name: Install moodle-plugin-ci
run: |
moodle-plugin-ci install --plugin ./plugin --db-host=127.0.0.1
env:
DB: ${{ matrix.database }}
MOODLE_BRANCH: ${{ matrix.moodle-branch }}

- name: PHP Lint
if: ${{ !cancelled() }}
run: moodle-plugin-ci phplint

- name: PHP Mess Detector
continue-on-error: true # This step will show errors but will not fail
if: ${{ !cancelled() }}
run: moodle-plugin-ci phpmd

- name: Moodle Code Checker
if: ${{ !cancelled() }}
run: moodle-plugin-ci phpcs --max-warnings 0

- name: Moodle PHPDoc Checker
if: ${{ !cancelled() }}
run: moodle-plugin-ci phpdoc --max-warnings 0

- name: Validating
if: ${{ !cancelled() }}
run: moodle-plugin-ci validate

- name: Check upgrade savepoints
if: ${{ !cancelled() }}
run: moodle-plugin-ci savepoints

- name: Mustache Lint
if: ${{ !cancelled() }}
run: moodle-plugin-ci mustache

- name: Grunt
if: ${{ !cancelled() }}
run: moodle-plugin-ci grunt --max-lint-warnings 0

- name: PHPUnit tests
if: ${{ !cancelled() }}
run: moodle-plugin-ci phpunit --fail-on-warning

- name: Behat features
if: ${{ !cancelled() }}
run: moodle-plugin-ci behat --profile chrome

- name: Mark cancelled jobs as failed.
if: ${{ cancelled() }}
run: exit 1
4 changes: 4 additions & 0 deletions .phpcs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="MoodleCore">
<rule ref="moodle-extra"/>
</ruleset>
Loading
Loading