From 51e309405ff848a9f097c553e682a5d893bd3df8 Mon Sep 17 00:00:00 2001 From: Roussetos Karafyllakis <35-roussks@users.noreply.git.upmind.io> Date: Thu, 29 Feb 2024 22:10:51 +0000 Subject: [PATCH 1/7] update github actions to latest checkout versions & use cache component. Load tools with php setup --- .github/workflows/build.yaml | 42 ++++++++++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index a7cc4ba..74f00fb 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -11,35 +11,65 @@ jobs: php-stan: name: PHP Stan runs-on: ubuntu-latest + strategy: + matrix: + php: [7.3, 7.4] steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: 7.4 + php-version: "${{ matrix.php }}" + tools: composer, phpstan + + - name: Get composer cache directory + id: composer-cache + run: 'echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT' + + - name: Cache dependencies + uses: actions/cache@v4 + with: + path: "${{ steps.composer-cache.outputs.dir }}" + key: "${{ runner.os }}-php-${{ matrix.php}}-composer-${{ hashFiles('**/composer.json') }}" + restore-keys: "${{ runner.os }}-php-${{ matrix.php}}-composer-" - name: Install dependencies run: composer install --no-ansi --no-interaction --no-progress --no-scripts - name: Run PHPStan - run: ./vendor/bin/phpstan + run: phpstan php-unit: name: PHP Unit runs-on: ubuntu-latest + strategy: + matrix: + php: [ 7.3, 7.4 ] steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: 7.4 + php-version: "${{ matrix.php }}" + tools: composer, phpstan + + - name: Get composer cache directory + id: composer-cache + run: 'echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT' + + - name: Cache dependencies + uses: actions/cache@v4 + with: + path: "${{ steps.composer-cache.outputs.dir }}" + key: "${{ runner.os }}-php-${{ matrix.php}}-composer-${{ hashFiles('**/composer.json') }}" + restore-keys: "${{ runner.os }}-php-${{ matrix.php}}-composer-" - name: Install dependencies run: composer install --no-ansi --no-interaction --no-progress --no-scripts - name: Run PHPUnit - run: ./vendor/bin/phpunit + run: phpunit From d3256ba79465c517e34b4627dc6eeaf6a3f00506 Mon Sep 17 00:00:00 2001 From: Roussetos Karafyllakis <35-roussks@users.noreply.git.upmind.io> Date: Thu, 29 Feb 2024 22:14:27 +0000 Subject: [PATCH 2/7] use vendor phpunit --- .github/workflows/build.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 74f00fb..ff3406a 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -55,7 +55,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: "${{ matrix.php }}" - tools: composer, phpstan + tools: composer, phpunit - name: Get composer cache directory id: composer-cache @@ -72,4 +72,4 @@ jobs: run: composer install --no-ansi --no-interaction --no-progress --no-scripts - name: Run PHPUnit - run: phpunit + run: ./vendor/phpunit/phpunit From dd47d029d80076e17fa84bf4f3f6a9d9eafe2189 Mon Sep 17 00:00:00 2001 From: Roussetos Karafyllakis <35-roussks@users.noreply.git.upmind.io> Date: Thu, 29 Feb 2024 22:16:40 +0000 Subject: [PATCH 3/7] fix phpunit run path --- .github/workflows/build.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index ff3406a..9b00544 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -55,7 +55,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: "${{ matrix.php }}" - tools: composer, phpunit + tools: composer - name: Get composer cache directory id: composer-cache @@ -72,4 +72,4 @@ jobs: run: composer install --no-ansi --no-interaction --no-progress --no-scripts - name: Run PHPUnit - run: ./vendor/phpunit/phpunit + run: ./vendor/bin/phpunit From 1be7016fb110d5dfb5cbce2ce4975f5d49ba3800 Mon Sep 17 00:00:00 2001 From: Roussetos Karafyllakis <35-roussks@users.noreply.git.upmind.io> Date: Thu, 29 Feb 2024 22:20:24 +0000 Subject: [PATCH 4/7] indentation --- phpunit.xml.dist | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 891849f..48dbbcf 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -9,18 +9,18 @@ convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false"> - - - ./src - - - - - - - - ./tests/Unit - - - + + + ./src + + + + + + + + ./tests/Unit + + + From ccc5ea0ff94926a5b27360b4888066d01c9a4204 Mon Sep 17 00:00:00 2001 From: Roussetos Karafyllakis <35-roussks@users.noreply.git.upmind.io> Date: Thu, 29 Feb 2024 22:20:35 +0000 Subject: [PATCH 5/7] test 8.1 & 8.2 php versions as well --- .github/workflows/build.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 9b00544..76bac6e 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php: [7.3, 7.4] + php: [ 7.3, 7.4, 8.1, 8.2 ] steps: - name: Checkout code uses: actions/checkout@v4 @@ -46,7 +46,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php: [ 7.3, 7.4 ] + php: [ 7.3, 7.4, 8.1, 8.2 ] steps: - name: Checkout code uses: actions/checkout@v4 From 640212111b2cc23bc0ae5ebbf43420f7520f5285 Mon Sep 17 00:00:00 2001 From: Roussetos Karafyllakis <35-roussks@users.noreply.git.upmind.io> Date: Thu, 29 Feb 2024 22:24:15 +0000 Subject: [PATCH 6/7] test coverage badge --- .github/workflows/build.yaml | 15 +++++++++++++++ phpunit.xml.dist | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 76bac6e..8ee4c7a 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -73,3 +73,18 @@ jobs: - name: Run PHPUnit run: ./vendor/bin/phpunit + + - name: Make code coverage badge + uses: timkrase/phpunit-coverage-badge@v1.2.1 + with: + coverage_badge_path: output/coverage.svg + push_badge: false + + - name: Git push to image-data branch + uses: peaceiris/actions-gh-pages@v3 + with: + publish_dir: ./output + publish_branch: image-data + github_token: ${{ secrets.GITHUB_TOKEN }} + user_name: 'github-actions[bot]' + user_email: 'github-actions[bot]@users.noreply.github.com' diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 48dbbcf..d90b356 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -9,7 +9,7 @@ convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false"> - + ./src From bef616f6c54f976b911e3be65ee462ce015a5757 Mon Sep 17 00:00:00 2001 From: Roussetos Karafyllakis <35-roussks@users.noreply.git.upmind.io> Date: Thu, 29 Feb 2024 22:26:54 +0000 Subject: [PATCH 7/7] Revert "test coverage badge" This reverts commit 640212111b2cc23bc0ae5ebbf43420f7520f5285. --- .github/workflows/build.yaml | 15 --------------- phpunit.xml.dist | 2 +- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 8ee4c7a..76bac6e 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -73,18 +73,3 @@ jobs: - name: Run PHPUnit run: ./vendor/bin/phpunit - - - name: Make code coverage badge - uses: timkrase/phpunit-coverage-badge@v1.2.1 - with: - coverage_badge_path: output/coverage.svg - push_badge: false - - - name: Git push to image-data branch - uses: peaceiris/actions-gh-pages@v3 - with: - publish_dir: ./output - publish_branch: image-data - github_token: ${{ secrets.GITHUB_TOKEN }} - user_name: 'github-actions[bot]' - user_email: 'github-actions[bot]@users.noreply.github.com' diff --git a/phpunit.xml.dist b/phpunit.xml.dist index d90b356..48dbbcf 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -9,7 +9,7 @@ convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false"> - + ./src