From 48b55db6aa6933a834682b357abef7945be4fcb8 Mon Sep 17 00:00:00 2001 From: Sam Poyigi <6567634+sampoyigi@users.noreply.github.com> Date: Thu, 29 Feb 2024 21:18:33 +0000 Subject: [PATCH] Update GitHub workflow settings and minor tweaks This commit includes several changes related to the GitHub workflows. These include updating OS dependency to 'ubuntu-latest', PHP version to 8.2 and 8.3, adding MySQL service, DB environment variables, as well as adding the steps to create MySQL databases in the workflows. Additionally, '.phpunit.cache' has been added to .gitignore files, and dependabot settings have been updated as well. Signed-off-by: Sam Poyigi <6567634+sampoyigi@users.noreply.github.com> --- .github/workflows/run-tests.yml | 21 +++++++++++++++++++++ .github/workflows/static-analysis.yml | 1 - .gitignore | 1 + 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 7eb2704..af7e336 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -9,9 +9,24 @@ jobs: matrix: os: [ ubuntu-latest ] php: [ 8.2, 8.3 ] + env: + DB_DATABASE: testbench + DB_USERNAME: root + DB_PASSWORD: root name: PHP ${{ matrix.php }} - ${{ matrix.os }} + services: + mysql: + image: 'mysql:8.0' + env: + MYSQL_ALLOW_EMPTY_PASSWORD: false + MYSQL_ROOT_PASSWORD: root + MYSQL_DATABASE: testbench + ports: + - 3306/tcp + options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 + steps: - name: Checkout code uses: actions/checkout@v3 @@ -23,10 +38,16 @@ jobs: extensions: dom, curl, xml, mbstring, zip, pdo, sqlite, bcmath, soap, intl, gd coverage: none + - name: Create MySQL Database + run: | + sudo systemctl start mysql + mysql -u${{ env.DB_USERNAME }} -p${{ env.DB_PASSWORD }} -e 'CREATE DATABASE ${{ env.DB_DATABASE }};' --port ${{ job.services.mysql.ports['3306'] }} + - name: Setup problem matchers run: | echo "::add-matcher::${{ runner.tool_cache }}/php.json" echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" + - name: Install dependencies run: composer update --prefer-stable --prefer-dist --no-interaction diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 53e32fd..ffec679 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -6,7 +6,6 @@ jobs: types: runs-on: ubuntu-latest strategy: - fail-fast: true matrix: php: [ 8.2, 8.3 ] name: PHP ${{ matrix.php }} - Static Analysis diff --git a/.gitignore b/.gitignore index fba33ac..b8ec892 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ .php_cs .php_cs.cache .phpunit.result.cache +.phpunit.cache /build composer.lock coverage