Skip to content

Performance improvements #41

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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
110 changes: 54 additions & 56 deletions .github/workflows/moodle-ci.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
name: Moodle Plugin CI
name: Run all tests

# Run this workflow every time a new commit pushed to your repository
on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-18.04

setup:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:9.6
image: postgres:10
env:
POSTGRES_USER: 'postgres'
POSTGRES_HOST_AUTH_METHOD: 'trust'
# Health check to wait for postgres to start.
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 3
Expand All @@ -23,96 +24,93 @@ jobs:
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval 10s --health-timeout 5s --health-retries 3

strategy:
fail-fast: false
matrix:
include:
- php: '7.4'
moodle-branch: 'MOODLE_39_STABLE'
database: pgsql
- php: '7.4'
moodle-branch: 'MOODLE_39_STABLE'
database: mariadb
- php: '7.2'
moodle-branch: 'MOODLE_39_STABLE'
database: pgsql
- php: '7.2'
moodle-branch: 'MOODLE_39_STABLE'
database: mariadb

php-versions: ['7.3', '7.4']
database: ['pgsql', 'mariadb']
steps:
- name: Check out repository code
uses: actions/checkout@v2
with:
# Clone in plugin subdir, so we can setup CI in default directory.
path: plugin

- name: Setup PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
- name: Install node
uses: actions/setup-node@v1
with:
php-version: ${{ matrix.php }}
coverage: none
# TODO: Check if we can support .nvmrc
node-version: '14.15.0'

- name: Initialise moodle-plugin-ci
- name: Setup PHP environment
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, pgsql, mysqli
tools: phpunit

- name: Deploy moodle-plugin-ci
run: |
composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^3
# Add dirs to $PATH
echo $(cd ci/bin; pwd) >> $GITHUB_PATH
echo $(cd ci/vendor/bin; pwd) >> $GITHUB_PATH
# PHPUnit depends on en_AU.UTF-8 locale
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
# Need explicit IP to stop mysql client fail on attempt to use unix socket.
run: moodle-plugin-ci install -vvv --plugin ./plugin --db-host=127.0.0.1
env:
DB: ${{ matrix.database }}
MOODLE_BRANCH: ${{ matrix.moodle-branch }}
MUSTACHE_IGNORE_NAMES: 'mobile_*.mustache'
# TODO: Omitted MOODLE_BRANCH results in regex failure, investigate.
MOODLE_BRANCH: 'master'

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

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

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

- name: Moodle Code Checker
if: ${{ always() }}
run: moodle-plugin-ci codechecker --max-warnings 0

- name: Moodle PHPDoc Checker
- name: Run codechecker
if: ${{ always() }}
run: moodle-plugin-ci phpdoc
run: moodle-plugin-ci codechecker

- name: Validating
- name: Run validate
if: ${{ always() }}
run: moodle-plugin-ci validate

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

- name: Mustache Lint
- name: Run mustache
if: ${{ always() }}
run: moodle-plugin-ci mustache
run: moodle-plugin-ci phpcpd || true
env:
MUSTACHE_IGNORE_NAMES: mobile_teacher_form.mustache

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

- name: PHPUnit tests
- name: Run phpdoc
if: ${{ always() }}
run: |
moodle-plugin-ci phpunit
cd moodle
vendor/bin/phpunit --fail-on-risky --disallow-test-output -v admin/tool/dataprivacy/tests/metadata_registry_test.php
vendor/bin/phpunit --fail-on-risky --disallow-test-output -v lib/tests/externallib_test.php
vendor/bin/phpunit --fail-on-risky --disallow-test-output -v privacy/tests/provider_test.php
- name: Behat features
run: moodle-plugin-ci phpdoc

- name: Run phpunit
if: ${{ always() }}
run: |
moodle-plugin-ci phpunit
cd moodle
vendor/bin/phpunit --fail-on-risky --disallow-test-output --filter tool_dataprivacy_metadata_registry_testcase
vendor/bin/phpunit --fail-on-risky --disallow-test-output --testsuite core_privacy_testsuite --filter provider_testcase

- name: Run behat
if: ${{ always() }}
run: moodle-plugin-ci behat --profile chrome
run: moodle-plugin-ci behat --profile chrome
5 changes: 3 additions & 2 deletions amd/build/appear.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading