Skip to content

Commit

Permalink
Merge pull request #42 from catalyst/docs-add-40-suppport-table-to-re…
Browse files Browse the repository at this point in the history
…adme

Add new support table with 4.0 support, and update to use reusable workflows (3.5-3.11)
  • Loading branch information
Peterburnett authored Feb 23, 2022
2 parents fffa707 + ba78e35 commit 9ac8357
Showing 2 changed files with 10 additions and 131 deletions.
136 changes: 6 additions & 130 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,134 +1,10 @@
name: Run all tests
# .github/workflows/ci.yml
name: ci

# Run this workflow on push and on pull_request.
on: [push, pull_request]

jobs:
setup:
runs-on: ubuntu-latest
services:
postgres:
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
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_35_STABLE'
database: 'pgsql'
- php: '7.2'
moodle-branch: 'MOODLE_35_STABLE'
database: 'mariadb'
- php: '7.3'
moodle-branch: 'MOODLE_39_STABLE'
database: 'pgsql'
- php: '7.3'
moodle-branch: 'MOODLE_310_STABLE'
database: 'mariadb'
- php: '7.2'
moodle-branch: 'MOODLE_310_STABLE'
database: 'pgsql'
- php: '7.3'
moodle-branch: 'MOODLE_310_STABLE'
database: 'mariadb'
- php: '7.4'
moodle-branch: 'MOODLE_310_STABLE'
database: 'pgsql'
- php: '7.3'
moodle-branch: 'MOODLE_311_STABLE'
database: 'mariadb'
- php: '7.4'
moodle-branch: 'MOODLE_311_STABLE'
database: 'pgsql'
- php: '7.3'
moodle-branch: 'master'
database: 'mariadb'
- php: '7.4'
moodle-branch: 'master'
database: 'pgsql'
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: '14.15'

- name: Setup PHP environment
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
with:
php-version: ${{ matrix.php }}
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
- 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
if: ${{ always() }}
run: moodle-plugin-ci phplint

- name: Run phpcpd
if: ${{ always() }}
run: moodle-plugin-ci phpcpd || true

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

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

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

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

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

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

- name: Run phpunit
if: ${{ always() }}
run: moodle-plugin-ci phpunit
test:
uses: catalyst/catalyst-moodle-workflows/.github/workflows/group-35-to-311-ci.yml@main
with:
disable_behat: true
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -19,7 +19,10 @@ This has the advantage of making caching code-configurable before deployment, an

## Branches

For all Moodle branches please use the master branch.
| Moodle version | Branch | PHP |
|-------------------|------------------|------|
| Moodle 4.0+ | MOODLE_40_STABLE | 7.3+ |
| Moodle 3.5 - 3.11 | master | 7.1+ |


## Installation

0 comments on commit 9ac8357

Please sign in to comment.