From 012a4c5cf8fb73ac2c8ec6b0b5731a50ee9bd6ed Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Mon, 2 Jan 2023 17:28:19 +0100 Subject: [PATCH] MDL-74905 ci: travis and gha, raise to agreed requirements Basically, we only need to change: - PHP 8.0 - MySQL 8.0 - PostgreSQL 13 Also, remove any php-xmlrpc installation because they aren't needed since Moodle 4.1. Finally, ensure that we aren't using mysql bin logs ever, because they are huge and can make the 1Gb tmpfs to become full. This is specifically needed for MySQL 8.0, because it comes with bin logs enabled by default. We have forked the mysql-action to achieve that: https://github.com/moodlehq/mysql-action Worth blaming travis because, after PG 11 and 12 using port 5433, now they are back (in PG 13) to port 5432. Surely there is some logic behind the undocumented ping-pong but... --- .github/workflows/push.yml | 11 ++++++----- .travis.yml | 25 +++++++++++++------------ 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 4af195a9538..9c055dbf767 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -55,31 +55,32 @@ jobs: matrix: include: - os: ubuntu-22.04 - php: 7.4 + php: 8.0 extensions: db: mysqli - os: ubuntu-22.04 php: 8.0 db: pgsql - extensions: xmlrpc-beta steps: - name: Setting up DB mysql if: ${{ matrix.db == 'mysqli' }} - uses: johanmeiring/mysql-action@tmpfs-patch + uses: moodlehq/mysql-action@v1 with: collation server: utf8mb4_bin - mysql version: 5.7 + mysql version: 8.0 mysql database: test mysql user: test mysql password: test use tmpfs: true + tmpfs size: '1024M' + extra conf: --skip-log-bin - name: Setting up DB pgsql if: ${{ matrix.db == 'pgsql' }} uses: m4nu56/postgresql-action@v1 with: - postgresql version: 12 + postgresql version: 13 postgresql db: test postgresql user: test postgresql password: test diff --git a/.travis.yml b/.travis.yml index 301ffd3dc05..5d515cf5121 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,11 +17,11 @@ services: - docker addons: - postgresql: "12" + postgresql: "13" apt: packages: - - postgresql-12 - - postgresql-client-12 + - postgresql-13 + - postgresql-client-13 branches: except: @@ -36,18 +36,18 @@ jobs: fast_finish: true include: - # First all the lowest php ones (7.4) - - php: 7.4 + # First all the lowest php ones (8.0) + - php: 8.0 env: DB=none TASK=CITEST - - php: 7.4 + - php: 8.0 env: DB=none TASK=GRUNT - if: env(MOODLE_DATABASE) = "pgsql" OR env(MOODLE_DATABASE) = "all" OR env(MOODLE_DATABASE) IS NOT present - php: 7.4 + php: 8.0 env: DB=pgsql TASK=PHPUNIT - if: env(MOODLE_DATABASE) = "mysqli" OR env(MOODLE_DATABASE) = "all" - php: 7.4 + php: 8.0 env: DB=mysqli TASK=PHPUNIT # Then, conditionally, all the highest php ones (8.0) @@ -78,8 +78,8 @@ before_install: env: global: - - PGVER=12 - - PGPORT=5433 + - PGVER=13 + - PGPORT=5432 install: - > @@ -90,7 +90,8 @@ install: sudo service mysql stop sudo mv /var/lib/mysql /mnt/ramdisk sudo ln -s /mnt/ramdisk/mysql /var/lib/mysql - sudo service mysql restart + echo -e "[mysqld]\nskip-log-bin" | sudo tee -a /etc/mysql/my.cnf + sudo service mysql start fi - > if [ "$DB" = 'pgsql' ]; @@ -101,6 +102,7 @@ install: sudo mv /var/lib/postgresql /mnt/ramdisk sudo ln -s /mnt/ramdisk/postgresql /var/lib/postgresql sudo service postgresql start + sh -c 'until pg_isready -p $PGPORT; do echo "Waiting for the DB to be up..."; sleep 2; done' fi - > if [ "$TASK" = 'PHPUNIT' ]; @@ -127,7 +129,6 @@ install: fi before_script: - - if [[ ${TRAVIS_PHP_VERSION:0:1} -gt 7 ]]; then pecl install xmlrpc-beta; fi - echo 'max_input_vars=5000' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini - phpenv config-rm xdebug.ini - >