From aceb6023fa857c2be2d2e58158fe88c6c96857e7 Mon Sep 17 00:00:00 2001 From: Andreas Motl Date: Mon, 24 Nov 2025 21:03:44 +0100 Subject: [PATCH 1/2] Project: Add script entry point for `composer run test` --- composer.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/composer.json b/composer.json index e9fcdd2..eaa06b4 100644 --- a/composer.json +++ b/composer.json @@ -44,5 +44,8 @@ "RatkoR\\Crate\\CrateServiceProvider" ] } + }, + "scripts": { + "test": "phpunit" } } From 4bb8bb569e0e5ad8a736c40f8f78e29e2ceb347d Mon Sep 17 00:00:00 2001 From: Andreas Motl Date: Mon, 24 Nov 2025 21:03:51 +0100 Subject: [PATCH 2/2] CI: Add configuration for running software tests on GitHub Actions --- .github/workflows/tests.yml | 63 +++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..1910766 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,63 @@ +name: Tests + +on: + push: + branches: [ main ] + pull_request: + + # Allow job to be triggered manually. + workflow_dispatch: + +# Cancel in-progress jobs when pushing to the same branch. +concurrency: + cancel-in-progress: true + group: ${{ github.workflow }}-${{ github.ref }} + +jobs: + tests: + + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ + 'ubuntu-latest', + ] + php-version: [ + '8.0', + '8.1', + '8.2', + '8.3', + '8.4', + '8.5', + ] + cratedb-version: [ + 'nightly', + ] + + # https://docs.github.com/en/free-pro-team@latest/actions/guides/about-service-containers + services: + cratedb: + image: crate/crate:${{ matrix.cratedb-version }} + ports: + - 4201:4200 + + # https://github.com/marketplace/actions/setup-php-action + name: PHP ${{ matrix.php-version }}, CrateDB ${{ matrix.cratedb-version }} + steps: + + - name: Acquire sources + uses: actions/checkout@v3 + with: + fetch-depth: 2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + tools: composer + + - uses: ramsey/composer-install@v2 + + - name: Run tests + run: composer run test