Skip to content

Merge pull request #43 from catalyst/docs-typo-fix #132

Merge pull request #43 from catalyst/docs-typo-fix

Merge pull request #43 from catalyst/docs-typo-fix #132

Workflow file for this run

name: Run all tests
# Run this workflow on push and on pull_request.
on: [push, pull_request]
jobs:
setup:
runs-on: ubuntu-latest
env:
IGNORE_PATHS: tests/fixtures
services:
postgres:
image: postgres:9.6
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
mariadb:
image: mariadb:10.5
env:
MYSQL_USER: 'root'
MYSQL_ALLOW_EMPTY_PASSWORD: "true"
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.2'
moodle-branch: 'MOODLE_39_STABLE'
database: 'mariadb'
node: '14.15'
- php: '7.3'
moodle-branch: 'MOODLE_39_STABLE'
database: 'pgsql'
node: '14.15'
- php: '7.4'
moodle-branch: 'MOODLE_39_STABLE'
database: 'mariadb'
node: '14.15'
- php: '7.4'
moodle-branch: 'MOODLE_39_STABLE'
database: 'pgsql'
node: '14.15'
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: Install node
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- name: Setup PHP environment
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php }}
extensions: mbstring, pgsql, mysqli, gd, zip
tools: phpunit
- name: Deploy moodle-plugin-ci
run: |
composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^3
# Use composer V1 for older branches
composer self-update --1
# 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
- name: Add local/aws dependency
run: moodle-plugin-ci add-plugin catalyst/moodle-local_aws
- name: Add local/smartmedia dependency
run: moodle-plugin-ci add-plugin catalyst/moodle-local_smartmedia
- name: Install moodle-plugin-ci
# 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 }}
# TODO: Omitted MOODLE_BRANCH results in regex failure, investigate.
MOODLE_BRANCH: ${{ matrix.moodle-branch }}
- name: Run phplint
run: moodle-plugin-ci phplint
- name: Run phpcpd
run: moodle-plugin-ci phpcpd || true
- name: Run phpmd
run: moodle-plugin-ci phpmd
- name: Run codechecker
run: moodle-plugin-ci codechecker
- name: Run validate
run: moodle-plugin-ci validate
- name: Run savepoints
run: moodle-plugin-ci savepoints
- name: Run mustache
run: moodle-plugin-ci mustache
- name: Run grunt
run: moodle-plugin-ci grunt
# PHPDoc works but needs a *LOT* of love
#- name: Run phpdoc
# if: ${{ always() }}
# run: moodle-plugin-ci phpdoc
- name: Run phpunit
run: moodle-plugin-ci phpunit