Update moodle-ci.yml #3512
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Moodle Plugin CI | |
| on: [push, pull_request] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-22.04 | |
| services: | |
| postgres: | |
| image: postgres:16 | |
| 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.6 | |
| env: | |
| MYSQL_USER: 'root' | |
| MYSQL_ALLOW_EMPTY_PASSWORD: "true" | |
| MYSQL_CHARACTER_SET_SERVER: "utf8mb4" | |
| MYSQL_COLLATION_SERVER: "utf8mb4_unicode_ci" | |
| ports: | |
| - 3306:3306 | |
| options: --health-cmd="mysqladmin ping" --health-interval 10s --health-timeout 5s --health-retries 3 | |
| strategy: | |
| fail-fast: false | |
| matrix: # I don't know why, but mariadb is much slower, so mostly use pgsql. | |
| # We use a mix of SBCL and GCL. | |
| include: | |
| - php: '8.2' | |
| moodle-branch: 'MOODLE_500_STABLE' | |
| database: 'pgsql' | |
| maxima: 'SBCL' | |
| moodle-app: true | |
| steps: | |
| - name: Install Maxima (${{ matrix.maxima }}) | |
| run: | | |
| maxima="${{ (matrix.maxima == 'SBCL' && 'sbcl') || 'gcl' }}" | |
| wget https://sourceforge.net/projects/maxima/files/Maxima-Linux-RPM/5.44.0-Linux/maxima-common_5.44.0-1_all.deb \ | |
| https://sourceforge.net/projects/maxima/files/Maxima-Linux-RPM/5.44.0-Linux/maxima-${maxima}_5.44.0-1_amd64.deb | |
| sudo locale-gen en_AU.UTF-8 | |
| sudo dpkg -i maxima-common_5.44.0-1_all.deb maxima-${maxima}_5.44.0-1_amd64.deb | |
| echo "LANG=en_AU.UTF-8" >> $GITHUB_ENV | |
| echo "adjust_external_format();" | maxima | |
| echo "diff(x^2,x);" | maxima | |
| echo "build_info();" | maxima | |
| - name: Check out repository code | |
| uses: actions/checkout@v3 | |
| with: | |
| path: plugin | |
| - name: Setup PHP ${{ matrix.php }} | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php }} | |
| extensions: ${{ matrix.extensions }} | |
| ini-values: max_input_vars=5000 | |
| coverage: none | |
| - name: Validate composer.json and composer.lock | |
| if: ${{ fromJSON(matrix.php) >= 8.2 }} | |
| run: | | |
| cd plugin/api | |
| composer validate | |
| - name: Cache Composer packages | |
| id: composer-cache | |
| if: ${{ fromJSON(matrix.php) >= 8.2 }} | |
| uses: actions/cache@v3 | |
| with: | |
| path: vendor | |
| key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-php- | |
| - name: Install Dependencies | |
| if: ${{ fromJSON(matrix.php) >= 8.2 }} | |
| run: | | |
| cd plugin/api | |
| composer install | |
| - name: Initialise moodle-plugin-ci | |
| run: | | |
| 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 | |
| echo "NVM_DIR=$HOME/.nvm" >> $GITHUB_ENV | |
| - name: Install moodle-plugin-ci (light unit tests & moodle app) | |
| run: | | |
| moodle-plugin-ci add-plugin maths/moodle-qbehaviour_dfexplicitvaildate | |
| moodle-plugin-ci add-plugin maths/moodle-qbehaviour_dfcbmexplicitvaildate | |
| moodle-plugin-ci add-plugin maths/moodle-qbehaviour_adaptivemultipart | |
| moodle-plugin-ci add-plugin maths/moodle-qbank_importasversion | |
| moodle-plugin-ci install --plugin ./plugin --db-host=127.0.0.1 | |
| moodle-plugin-ci add-config 'define("QTYPE_STACK_TEST_CONFIG_MAXIMAVERSION", "5.44.0");' | |
| moodle-plugin-ci add-config 'define("QTYPE_STACK_TEST_CONFIG_MAXIMACOMMAND", "maxima");' | |
| moodle-plugin-ci add-config 'define("QTYPE_STACK_TEST_CONFIG_MAXIMACOMMANDOPT", "timeout --kill-after=10s 10s ${{ github.workspace }}/maxima_opt_auto -eval '\''(cl-user::run)'\''");' | |
| moodle-plugin-ci add-config 'define("QTYPE_STACK_TEST_CONFIG_MAXIMACOMMANDSERVER", "http://pool.home:8080/MaximaPool/MaximaPool");' | |
| moodle-plugin-ci add-config 'define("QTYPE_STACK_TEST_CONFIG_CASTIMEOUT", "100");' | |
| moodle-plugin-ci add-config 'define("QTYPE_STACK_TEST_CONFIG_MAXIMALIBRARIES", "stats, distrib, descriptive, simplex");' | |
| moodle-plugin-ci add-config 'define("QTYPE_STACK_TEST_CONFIG_CASPREPARSE", "true");' | |
| moodle-plugin-ci add-config 'define("QTYPE_STACK_TEST_CONFIG_PLATFORM", "linux-optimised");' | |
| moodle-plugin-ci add-config 'define("QTYPE_STACK_TEST_CONFIG_CASRESULTSCACHE", "db");' | |
| moodle-plugin-ci add-config 'define("QTYPE_STACK_TEST_CONFIG_PLOTCOMMAND", "");' | |
| moodle-plugin-ci add-config 'define("QTYPE_STACK_TEST_CONFIG_CASDEBUGGING", "0");' | |
| #cat ${{ github.workspace }}/moodle/config.php | |
| cp ${{ github.workspace }}/moodledata/phpu_moodledata/stack/maxima_opt_auto ${{ github.workspace }}/maxima_opt_auto | |
| # Try a command on the command line. | |
| # echo "1+1; quit();" | timeout --kill-after=100s 100s ${{ github.workspace }}/maxima_opt_auto -eval '(cl-user::run)' | |
| env: | |
| DB: ${{ matrix.database }} | |
| MOODLE_BRANCH: ${{ matrix.moodle-branch }} | |
| MOODLE_APP: 'true' | |
| - name: Behat features | |
| if: ${{ always() }} | |
| run: moodle-plugin-ci behat --profile chrome --auto-rerun 3 | |
| env: | |
| MOODLE_BEHAT_SELENIUM_IMAGE: selenium/standalone-chrome:145.0-20260222 | |