Skip to content

Commit

Permalink
CI ^4
Browse files Browse the repository at this point in the history
  • Loading branch information
vadimonus committed Jan 9, 2024
1 parent 618b1c9 commit b709325
Showing 1 changed file with 38 additions and 29 deletions.
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
name: moodle-plugin-ci
name: Moodle Plugin CI

on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04

services:
postgres:
image: postgres:10
image: postgres:13
env:
POSTGRES_USER: 'postgres'
POSTGRES_HOST_AUTH_METHOD: 'trust'
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 3
mariadb:
image: mariadb:10.5
image: mariadb:10
env:
MYSQL_USER: 'root'
MYSQL_ALLOW_EMPTY_PASSWORD: "true"
Expand All @@ -28,22 +28,27 @@ jobs:
fail-fast: false
matrix:
include:
- php: '7.3'
moodle-branch: 'MOODLE_311_STABLE'
database: mariadb
- php: '7.3'
moodle-branch: 'MOODLE_311_STABLE'
# master with max supported version
- php: '8.3'
moodle-branch: 'master'
database: pgsql
- php: '8.0'
- php: '8.3'
moodle-branch: 'master'
database: mariadb
- php: '8.0'
moodle-branch: 'master'
# Max supported versions
- php: '8.2'
moodle-branch: 'MOODLE_403_STABLE'
database: pgsql
- php: '8.2'
moodle-branch: 'MOODLE_403_STABLE'
database: mariadb
# Some min versions (plugin supports much lower versions, but there are no CI for them)
- php: '7.4'
moodle-branch: 'MOODLE_311_STABLE'
database: mariadb
- php: '7.4'
moodle-branch: 'MOODLE_311_STABLE'
database: pgsql
# matrix:
# php: ['7.3', '7.4', '8.0']
# moodle-branch: ['MOODLE_311_STABLE', 'master']
# database: [pgsql, mariadb]

steps:
- name: Check out repository code
Expand All @@ -61,7 +66,7 @@ jobs:

- name: Initialise moodle-plugin-ci
run: |
composer create-project -n --no-dev --prefer-dist moodlehq/moodle-plugin-ci ci ^3
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
Expand All @@ -75,48 +80,52 @@ jobs:
MOODLE_BRANCH: ${{ matrix.moodle-branch }}

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

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

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

- name: Moodle Code Checker
continue-on-error: true
if: ${{ always() }}
if: ${{ !cancelled() }}
run: moodle-plugin-ci codechecker --max-warnings -1

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

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

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

# - name: Mustache Lint
# if: ${{ always() }}
# if: ${{ !cancelled() }}
# run: moodle-plugin-ci mustache
#
# - name: Grunt
# if: ${{ always() }}
# if: ${{ !cancelled() }}
# run: moodle-plugin-ci grunt --max-lint-warnings 0
#
- name: PHPUnit tests
if: ${{ always() }}
if: ${{ !cancelled() }}
run: moodle-plugin-ci phpunit

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

- name: Mark cancelled jobs as failed.
if: ${{ cancelled() }}
run: exit 1

0 comments on commit b709325

Please sign in to comment.