|
| 1 | +name: moodle-docker CI |
| 2 | + |
| 3 | +on: [push, pull_request] |
| 4 | + |
| 5 | +jobs: |
| 6 | + PHPUnit: |
| 7 | + runs-on: ubuntu-18.04 |
| 8 | + |
| 9 | + strategy: |
| 10 | + fail-fast: false |
| 11 | + matrix: |
| 12 | + include: |
| 13 | + # PostgreSQL (highest, lowest php supported) |
| 14 | + - { branch: master, php: "8.0", database: pgsql, suite: phpunit-full } # Full run only for mater. |
| 15 | + - { branch: master, php: "7.3", database: pgsql, suite: phpunit-full } |
| 16 | + - { branch: MOODLE_311_STABLE, php: "8.0", database: pgsql, suite: phpunit } # Other branches, quicker run. |
| 17 | + - { branch: MOODLE_311_STABLE, php: "7.3", database: pgsql, suite: phpunit } |
| 18 | + - { branch: MOODLE_310_STABLE, php: "7.4", database: pgsql, suite: phpunit } |
| 19 | + - { branch: MOODLE_310_STABLE, php: "7.2", database: pgsql, suite: phpunit } |
| 20 | + - { branch: MOODLE_39_STABLE, php: "7.4", database: pgsql, suite: phpunit } |
| 21 | + - { branch: MOODLE_39_STABLE, php: "7.2", database: pgsql, suite: phpunit } |
| 22 | + # MariaDB (lowest php supported) |
| 23 | + - { branch: master, php: "7.3", database: mariadb, suite: phpunit } |
| 24 | + - { branch: MOODLE_311_STABLE, php: "7.3", database: mariadb, suite: phpunit } |
| 25 | + - { branch: MOODLE_310_STABLE, php: "7.2", database: mariadb, suite: phpunit } |
| 26 | + - { branch: MOODLE_39_STABLE, php: "7.2", database: mariadb, suite: phpunit } |
| 27 | + # Other databases (highest php supported) |
| 28 | + - { branch: master, php: "8.0", database: mssql, suite: phpunit } |
| 29 | + - { branch: MOODLE_311_STABLE, php: "8.0", database: mssql, suite: phpunit } |
| 30 | + - { branch: MOODLE_310_STABLE, php: "7.4", database: mssql, suite: phpunit } |
| 31 | + - { branch: MOODLE_39_STABLE, php: "7.4", database: mssql, suite: phpunit } |
| 32 | + - { branch: master, php: "8.0", database: mysql, suite: phpunit } |
| 33 | + - { branch: MOODLE_311_STABLE, php: "8.0", database: mysql, suite: phpunit } |
| 34 | + - { branch: MOODLE_310_STABLE, php: "7.4", database: mysql, suite: phpunit } |
| 35 | + - { branch: MOODLE_39_STABLE, php: "7.4", database: mysql, suite: phpunit } |
| 36 | + - { branch: master, php: "8.0", database: oracle, suite: phpunit } |
| 37 | + - { branch: MOODLE_311_STABLE, php: "8.0", database: oracle, suite: phpunit } |
| 38 | + - { branch: MOODLE_310_STABLE, php: "7.4", database: oracle, suite: phpunit } |
| 39 | + - { branch: MOODLE_39_STABLE, php: "7.4", database: oracle, suite: phpunit } |
| 40 | + |
| 41 | + steps: |
| 42 | + - name: Checking out moodle-docker |
| 43 | + uses: actions/checkout@v2 |
| 44 | + |
| 45 | + - name: Checking out moodle |
| 46 | + uses: actions/checkout@v2 |
| 47 | + with: |
| 48 | + repository: moodle/moodle |
| 49 | + path: moodle |
| 50 | + ref: ${{ matrix.branch }} |
| 51 | + |
| 52 | + - name: Prepare moodle-docker environment |
| 53 | + run: | |
| 54 | + cp config.docker-template.php moodle/config.php |
| 55 | + export MOODLE_DOCKER_DB="${{ matrix.database }}" |
| 56 | + export MOODLE_DOCKER_PHP_VERSION="${{ matrix.php }}" |
| 57 | + export SUITE="${{ matrix.suite }}" |
| 58 | + tests/phpunit-setup.sh |
| 59 | +
|
| 60 | + - name: Run moodle-docker tests |
| 61 | + run: | |
| 62 | + export MOODLE_DOCKER_DB="${{ matrix.database }}" |
| 63 | + export SUITE="${{ matrix.suite }}" |
| 64 | + tests/phpunit-test.sh |
| 65 | +
|
| 66 | + - name: Stop moodle-docker |
| 67 | + run: | |
| 68 | + export MOODLE_DOCKER_DB="${{ matrix.database }}" |
| 69 | + export SUITE="${{ matrix.suite }}" |
| 70 | + tests/phpunit-teardown.sh |
| 71 | +
|
| 72 | + Behat: |
| 73 | + runs-on: ubuntu-18.04 |
| 74 | + |
| 75 | + strategy: |
| 76 | + fail-fast: false |
| 77 | + matrix: |
| 78 | + include: |
| 79 | + # PostgreSQL (highest, lowest php supported) |
| 80 | + - { branch: master, php: "8.0", database: pgsql, browser: chrome, suite: behat } |
| 81 | + - { branch: master, php: "7.3", database: pgsql, browser: firefox, suite: behat } |
| 82 | + - { branch: MOODLE_311_STABLE, php: "8.0", database: pgsql, browser: chrome, suite: behat } |
| 83 | + - { branch: MOODLE_311_STABLE, php: "7.3", database: pgsql, browser: firefox, suite: behat } |
| 84 | + - { branch: MOODLE_310_STABLE, php: "7.4", database: pgsql, browser: chrome, suite: behat } |
| 85 | + - { branch: MOODLE_310_STABLE, php: "7.2", database: pgsql, browser: firefox, suite: behat } |
| 86 | + - { branch: MOODLE_39_STABLE, php: "7.4", database: pgsql, browser: chrome, suite: behat } |
| 87 | + - { branch: MOODLE_39_STABLE, php: "7.2", database: pgsql, browser: firefox, suite: behat } |
| 88 | + # MariaDB (lowest php supported) |
| 89 | + - { branch: master, php: "7.3", database: mariadb, browser: chrome, suite: behat } |
| 90 | + - { branch: MOODLE_311_STABLE, php: "7.3", database: mariadb, browser: firefox, suite: behat } |
| 91 | + - { branch: MOODLE_310_STABLE, php: "7.2", database: mariadb, browser: chrome, suite: behat } |
| 92 | + - { branch: MOODLE_39_STABLE, php: "7.2", database: mariadb, browser: firefox, suite: behat } |
| 93 | + # Other databases (highest php supported") |
| 94 | + - { branch: master, php: "8.0", database: mssql, browser: chrome, suite: behat } |
| 95 | + - { branch: MOODLE_311_STABLE, php: "8.0", database: mssql, browser: firefox, suite: behat } |
| 96 | + - { branch: MOODLE_310_STABLE, php: "7.4", database: mssql, browser: chrome, suite: behat } |
| 97 | + - { branch: MOODLE_39_STABLE, php: "7.4", database: mssql, browser: firefox, suite: behat } |
| 98 | + - { branch: master, php: "8.0", database: mysql, browser: chrome, suite: behat } |
| 99 | + - { branch: MOODLE_311_STABLE, php: "8.0", database: mysql, browser: firefox, suite: behat } |
| 100 | + - { branch: MOODLE_310_STABLE, php: "7.4", database: mysql, browser: chrome, suite: behat } |
| 101 | + - { branch: MOODLE_39_STABLE, php: "7.4", database: mysql, browser: firefox, suite: behat } |
| 102 | + - { branch: master, php: "8.0", database: oracle, browser: chrome, suite: behat } |
| 103 | + - { branch: MOODLE_311_STABLE, php: "8.0", database: oracle, browser: firefox, suite: behat } |
| 104 | + - { branch: MOODLE_310_STABLE, php: "7.4", database: oracle, browser: chrome, suite: behat } |
| 105 | + - { branch: MOODLE_39_STABLE, php: "7.4", database: oracle, browser: firefox, suite: behat } |
| 106 | + |
| 107 | + steps: |
| 108 | + - name: Checking out moodle-docker |
| 109 | + uses: actions/checkout@v2 |
| 110 | + |
| 111 | + - name: Checking out moodle |
| 112 | + uses: actions/checkout@v2 |
| 113 | + with: |
| 114 | + repository: moodle/moodle |
| 115 | + path: moodle |
| 116 | + ref: ${{ matrix.branch }} |
| 117 | + |
| 118 | + - name: Prepare moodle-docker environment |
| 119 | + run: | |
| 120 | + cp config.docker-template.php moodle/config.php |
| 121 | + export MOODLE_DOCKER_DB="${{ matrix.database }}" |
| 122 | + export MOODLE_DOCKER_PHP_VERSION="${{ matrix.php }}" |
| 123 | + export SUITE="${{ matrix.suite }}" |
| 124 | + export MOODLE_DOCKER_BROWSER="${{ matrix.browser }}" |
| 125 | + tests/behat-setup.sh |
| 126 | +
|
| 127 | + - name: Run moodle-docker tests |
| 128 | + run: | |
| 129 | + export MOODLE_DOCKER_DB="${{ matrix.database }}" |
| 130 | + export SUITE="${{ matrix.suite }}" |
| 131 | + tests/behat-test.sh |
| 132 | +
|
| 133 | + - name: Stop moodle-docker |
| 134 | + run: | |
| 135 | + export MOODLE_DOCKER_DB="${{ matrix.database }}" |
| 136 | + export SUITE="${{ matrix.suite }}" |
| 137 | + tests/behat-teardown.sh |
| 138 | +
|
| 139 | + App: |
| 140 | + runs-on: ubuntu-18.04 |
| 141 | + |
| 142 | + strategy: |
| 143 | + fail-fast: false |
| 144 | + matrix: |
| 145 | + include: |
| 146 | + # PostgreSQL (highest, lowest php supported) |
| 147 | + - { branch: master, php: "8.0", database: pgsql, suite: app-development, app-version: "3.9.0"} |
| 148 | + - { branch: master, php: "7.3", database: pgsql, suite: app-development, app-version: "3.9.0"} |
| 149 | + - { branch: master, php: "8.0", database: pgsql, suite: app, app-version: "3.9.0"} |
| 150 | + - { branch: master, php: "7.3", database: pgsql, suite: app, app-version: "3.9.0"} |
| 151 | + |
| 152 | + steps: |
| 153 | + - name: Checking out moodle-docker |
| 154 | + uses: actions/checkout@v2 |
| 155 | + |
| 156 | + - name: Checking out moodle |
| 157 | + uses: actions/checkout@v2 |
| 158 | + with: |
| 159 | + repository: moodle/moodle |
| 160 | + path: moodle |
| 161 | + ref: ${{ matrix.branch }} |
| 162 | + |
| 163 | + - name: Prepare moodle-docker environment |
| 164 | + run: | |
| 165 | + cp config.docker-template.php moodle/config.php |
| 166 | + export MOODLE_DOCKER_DB="${{ matrix.database }}" |
| 167 | + export MOODLE_DOCKER_PHP_VERSION="${{ matrix.php }}" |
| 168 | + export SUITE="${{ matrix.suite }}" |
| 169 | + export MOODLE_DOCKER_APP_VERSION="${{ matrix.app-version }}" |
| 170 | + tests/app-setup.sh |
| 171 | +
|
| 172 | + - name: Run moodle-docker tests |
| 173 | + run: | |
| 174 | + export MOODLE_DOCKER_DB="${{ matrix.database }}" |
| 175 | + export SUITE="${{ matrix.suite }}" |
| 176 | + tests/app-test.sh |
| 177 | +
|
| 178 | + - name: Stop moodle-docker |
| 179 | + run: | |
| 180 | + export MOODLE_DOCKER_DB="${{ matrix.database }}" |
| 181 | + export SUITE="${{ matrix.suite }}" |
| 182 | + export MOODLE_DOCKER_APP_VERSION="${{ matrix.app-version }}" |
| 183 | + tests/app-teardown.sh |
0 commit comments