From d396f47f9632c11aa085b193174c36f93dd3927b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20M=C3=BCnch?= Date: Tue, 7 Nov 2023 16:21:08 +0100 Subject: [PATCH] Try to use the existing workflow together with a composer script --- .github/workflows/unit-tests.yml | 28 ++++++++++++++-------------- composer.json | 3 +++ 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index c6d00be..b8b8253 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -12,17 +12,17 @@ permissions: contents: write jobs: - run-unit-tests: - # TODO: Add the right Github Action here - #uses: mage-os/infrastructure/.github/workflows/unit-tests.yml@main - - - name: Checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Install dependencies - run: composer install --prefer-dist --no-progress --no-suggest --no-interaction --no-scripts - - - name: Run unit tests - run: vendor/bin/phpunit + unit-test: + strategy: + matrix: + php_version: + - 7.4 + - 8.1 + - 8.2 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: mage-os/github-actions/unit-test@main + with: + php_version: ${{ matrix.php_version }} + composer_auth: ${{ secrets.COMPOSER_AUTH }} diff --git a/composer.json b/composer.json index 73eca34..c2a0fbe 100644 --- a/composer.json +++ b/composer.json @@ -30,6 +30,9 @@ "MageOS\\GraphQlPlayground\\": "" } }, + "scripts": { + "test": "phpunit" + }, "config": { "allow-plugins": { "magento/composer-dependency-version-audit-plugin": false,