From 11a85a54802957812b7e8539f0e741500a65f219 Mon Sep 17 00:00:00 2001 From: Cesar Scur Date: Fri, 13 Nov 2026 15:27:23 -0300 Subject: [PATCH 1/2] test: run PHPUnit in GitHub Actions --- .github/workflows/tests.yml | 31 +++++++++++++++++++++++++++++++ test/ProjectCodeTest.php | 15 +++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 .github/workflows/tests.yml create mode 100644 test/ProjectCodeTest.php diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..bda07a7 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,31 @@ +name: PHPUnit + +on: + pull_request: + push: + branches: [master] + +permissions: + contents: read + +jobs: + tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: shivammathur/setup-php@v2 + with: + php-version: '8.5' + tools: composer:v2, phpunit:13.4.3 + coverage: none + # The Composer 1 lock lacks the content-hash required by Composer 2's + # autoloader generator. Install its pinned archives with Composer 2, + # then generate the autoload files with Composer 1. + - name: Install locked dependencies + run: | + composer install --no-interaction --prefer-dist --no-scripts --no-plugins --ignore-platform-reqs --no-autoloader + curl --fail --location --silent --show-error https://getcomposer.org/download/1.10.27/composer.phar --output /tmp/composer1.phar + echo '230d28fb29f3c6c07ab2382390bef313e36de17868b2bd23b2e070554cae23d2 /tmp/composer1.phar' | sha256sum -c - + php /tmp/composer1.phar dump-autoload --no-scripts --no-plugins + - name: Run unit tests + run: phpunit --no-configuration --bootstrap vendor/autoload.php --do-not-record-test-run-history test diff --git a/test/ProjectCodeTest.php b/test/ProjectCodeTest.php new file mode 100644 index 0000000..514942f --- /dev/null +++ b/test/ProjectCodeTest.php @@ -0,0 +1,15 @@ +setCode('example'); + + self::assertSame('example', $project->getCode()); + } +} From 2636dbfdeb17bb3d8c7a2f5356499d28acde0554 Mon Sep 17 00:00:00 2001 From: Cesar Scur Date: Mon, 16 Nov 2026 14:04:58 -0300 Subject: [PATCH 2/2] ci: remove the added PHPUnit workflow --- .github/workflows/tests.yml | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml deleted file mode 100644 index bda07a7..0000000 --- a/.github/workflows/tests.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: PHPUnit - -on: - pull_request: - push: - branches: [master] - -permissions: - contents: read - -jobs: - tests: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: shivammathur/setup-php@v2 - with: - php-version: '8.5' - tools: composer:v2, phpunit:13.4.3 - coverage: none - # The Composer 1 lock lacks the content-hash required by Composer 2's - # autoloader generator. Install its pinned archives with Composer 2, - # then generate the autoload files with Composer 1. - - name: Install locked dependencies - run: | - composer install --no-interaction --prefer-dist --no-scripts --no-plugins --ignore-platform-reqs --no-autoloader - curl --fail --location --silent --show-error https://getcomposer.org/download/1.10.27/composer.phar --output /tmp/composer1.phar - echo '230d28fb29f3c6c07ab2382390bef313e36de17868b2bd23b2e070554cae23d2 /tmp/composer1.phar' | sha256sum -c - - php /tmp/composer1.phar dump-autoload --no-scripts --no-plugins - - name: Run unit tests - run: phpunit --no-configuration --bootstrap vendor/autoload.php --do-not-record-test-run-history test