From af5445cd37346ea266a27d1f4e162f33af8abaa4 Mon Sep 17 00:00:00 2001 From: Paul Vogel Date: Thu, 15 Oct 2026 11:28:36 +0200 Subject: [PATCH 1/4] update github actions --- .github/workflows/tests.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index b0600e5..52c638e 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -19,7 +19,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v7 - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -31,7 +31,7 @@ jobs: run: echo "COMPOSER_CACHE_DIRECTORY=$(composer config cache-files-dir)" >> $GITHUB_ENV - name: Restore composer from cache - uses: actions/cache@v3 + uses: actions/cache@v6 with: path: ${{ env.COMPOSER_CACHE_DIRECTORY }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} From d2ceba51d3c7dcc93c030d6662ea6446a5726e91 Mon Sep 17 00:00:00 2001 From: Paul Vogel Date: Thu, 15 Oct 2026 11:33:43 +0200 Subject: [PATCH 2/4] add attributes to phpunit.xml.dist --- phpunit.xml.dist | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index dd1d6d0..112b87b 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -2,7 +2,12 @@ + colors="true" + executionOrder="random" + displayDetailsOnTestsThatTriggerDeprecations="true" + displayDetailsOnTestsThatTriggerErrors="true" + displayDetailsOnTestsThatTriggerNotices="true" + displayDetailsOnTestsThatTriggerWarnings="true"> src From 79efa1a60ba96908d4bff74c8d000aa1724b6c37 Mon Sep 17 00:00:00 2001 From: Paul Vogel Date: Thu, 15 Oct 2026 11:34:16 +0200 Subject: [PATCH 3/4] update xsd path in phpunit.xml.dist --- phpunit.xml.dist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 112b87b..0dcdabb 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,6 +1,6 @@ Date: Thu, 15 Oct 2026 11:35:11 +0200 Subject: [PATCH 4/4] update tests.yaml: always run unit tests, only run integration tests on master --- .github/workflows/tests.yaml | 57 ++++++++++++++++++++++++++++++++---- 1 file changed, 51 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 52c638e..cf91a9b 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -8,14 +8,15 @@ on: - master jobs: - tests: + unit-tests: runs-on: ubuntu-latest strategy: + fail-fast: false matrix: php-version: [ '8.3', '8.4', '8.5' ] - name: Run tests on PHP v${{ matrix.php-version }} + name: Run unit tests on PHP v${{ matrix.php-version }} steps: - name: Checkout code @@ -25,6 +26,9 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-version }} + extensions: curl, json, mbstring + coverage: none + tools: composer:v2 - name: Set composer cache directory id: composer-cache @@ -34,13 +38,54 @@ jobs: uses: actions/cache@v6 with: path: ${{ env.COMPOSER_CACHE_DIRECTORY }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: ${{ runner.os }}-composer- + key: ${{ runner.os }}-composer-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-composer-${{ matrix.php-version }}- + ${{ runner.os }}-composer- - name: Install composer dependencies run: composer install --no-interaction --prefer-dist --no-progress - - name: Run phpunit tests - run: vendor/bin/phpunit --colors=always --testdox + - name: Run phpunit unit tests + run: vendor/bin/phpunit --testsuite=unit --colors=always --testdox + + # integration tests send requests to the live CurseForge API and need the CURSEFORGE_API_KEY secret, + # so they only run on the master branch and when started manually + integration-tests: + if: github.event_name != 'pull_request' + runs-on: ubuntu-latest + + name: Run integration tests + + steps: + - name: Checkout code + uses: actions/checkout@v7 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.5' + extensions: curl, json, mbstring + coverage: none + tools: composer:v2 + + - name: Set composer cache directory + id: composer-cache + run: echo "COMPOSER_CACHE_DIRECTORY=$(composer config cache-files-dir)" >> $GITHUB_ENV + + - name: Restore composer from cache + uses: actions/cache@v6 + with: + path: ${{ env.COMPOSER_CACHE_DIRECTORY }} + key: ${{ runner.os }}-composer-8.5-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-composer-8.5- + ${{ runner.os }}-composer- + + - name: Install composer dependencies + run: composer install --no-interaction --prefer-dist --no-progress + + - name: Run phpunit integration tests + run: vendor/bin/phpunit --testsuite=integration --colors=always --testdox env: CURSEFORGE_API_KEY: ${{ secrets.CURSEFORGE_API_KEY }}