diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2147205..3fbabb5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -182,8 +182,13 @@ jobs: composer-dependencies: lowest functional-tests: name: "Functional tests" - runs-on: ubuntu-18.04 + runs-on: ubuntu-22.04 needs: php-lint + env: + DB_DATABASE: typo3 + DB_USER: root + DB_PASSWORD: root + DB_HOST: localhost steps: - name: "Checkout" uses: actions/checkout@v3 @@ -222,12 +227,15 @@ jobs: composer show - name: "Start MySQL" run: "sudo /etc/init.d/mysql start" + # This workaround for MySQL 8 can be removed once we drop support for PHP 7.2/7.3. + - name: "Configure the MySQL user to work with PHP 7.2/7.3" + run: mysql -u root --password=root -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root'" - name: "Run functional tests" run: | - export typo3DatabaseName="typo3"; - export typo3DatabaseHost="127.0.0.1"; - export typo3DatabaseUsername="root"; - export typo3DatabasePassword="root"; + export typo3DatabaseName="$DB_DATABASE"; + export typo3DatabaseHost="$DB_HOST"; + export typo3DatabaseUsername="$DB_USER"; + export typo3DatabasePassword="$DB_PASSWORD"; composer ci:tests:functional strategy: fail-fast: false diff --git a/.github/workflows/codecoverage.yml b/.github/workflows/codecoverage.yml index 6c47540..5a4eec5 100644 --- a/.github/workflows/codecoverage.yml +++ b/.github/workflows/codecoverage.yml @@ -9,7 +9,12 @@ on: jobs: code-coverage: name: "Calculate code coverage" - runs-on: ubuntu-18.04 + runs-on: ubuntu-22.04 + env: + DB_DATABASE: typo3 + DB_USER: root + DB_PASSWORD: root + DB_HOST: localhost steps: - name: "Checkout" uses: actions/checkout@v3 @@ -46,14 +51,17 @@ jobs: composer show - name: "Start MySQL" run: "sudo /etc/init.d/mysql start" + # This workaround for MySQL 8 can be removed once we drop support for PHP 7.2/7.3. + - name: "Configure the MySQL user to work with PHP 7.2/7.3" + run: mysql -u root --password=root -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root'" - name: "Run unit tests with coverage" run: composer ci:coverage:unit - name: "Run functional tests with coverage" run: | - export typo3DatabaseName="typo3"; - export typo3DatabaseHost="127.0.0.1"; - export typo3DatabaseUsername="root"; - export typo3DatabasePassword="root"; + export typo3DatabaseName="$DB_DATABASE"; + export typo3DatabaseHost="$DB_HOST"; + export typo3DatabaseUsername="$DB_USER"; + export typo3DatabasePassword="$DB_PASSWORD"; composer ci:coverage:functional - name: "Merge coverage results" run: composer ci:coverage:merge diff --git a/.github/workflows/predefined.yml b/.github/workflows/predefined.yml index e5625fa..6b41407 100644 --- a/.github/workflows/predefined.yml +++ b/.github/workflows/predefined.yml @@ -202,8 +202,13 @@ jobs: - "^10.4" functional-tests: name: "Functional tests" - runs-on: ubuntu-18.04 + runs-on: ubuntu-22.04 needs: php-lint + env: + DB_DATABASE: typo3 + DB_USER: root + DB_PASSWORD: root + DB_HOST: localhost steps: - name: "Checkout" uses: actions/checkout@v3 @@ -240,12 +245,15 @@ jobs: composer show - name: "Start MySQL" run: "sudo /etc/init.d/mysql start" + # This workaround for MySQL 8 can be removed once we drop support for PHP 7.2/7.3. + - name: "Configure the MySQL user to work with PHP 7.2/7.3" + run: mysql -u root --password=root -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root'" - name: "Run functional tests" run: | - export typo3DatabaseName="typo3"; - export typo3DatabaseHost="127.0.0.1"; - export typo3DatabaseUsername="root"; - export typo3DatabasePassword="root"; + export typo3DatabaseName="$DB_DATABASE"; + export typo3DatabaseHost="$DB_HOST"; + export typo3DatabaseUsername="$DB_USER"; + export typo3DatabasePassword="$DB_PASSWORD"; composer ci:tests:functional strategy: fail-fast: false