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