diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b8c75ccb..811cedcf 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -16,7 +16,7 @@ jobs: run: composer install --prefer-dist --no-dev PHPunit: - name: PHP ${{ matrix.php-versions }} unit tests on ${{ matrix.operating-system }} + name: PHP ${{ matrix.php-versions }} unit tests runs-on: ubuntu-latest # https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs#handling-failures continue-on-error: "${{ matrix.experimental }}" @@ -75,6 +75,7 @@ jobs: - name: Get composer cache directory id: composer-cache run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT + # http://man7.org/linux/man-pages/man1/date.1.html # https://github.com/actions/cache#creating-a-cache-key - name: Get Date @@ -111,6 +112,97 @@ jobs: name: Test Results (PHP ${{ matrix.php-versions }}) path: tst/results.xml + PHPunitConfigCombinations: + name: PHP configuration combination unit tests + runs-on: ubuntu-latest + env: + php-version: '8.4' + extensions: gd, sqlite3 + extensions-cache-key-name: phpextensions + + steps: + + # let's get started! + - name: Checkout + uses: actions/checkout@v4 + + # cache PHP extensions + - name: Setup cache environment + id: extcache + uses: shivammathur/cache-extensions@v1 + with: + php-version: ${{ env.php-version }} + extensions: ${{ env.extensions }} + key: ${{ runner.os }}-${{ env.extensions-cache-key }} + + - name: Cache extensions + uses: actions/cache@v4 + with: + path: ${{ steps.extcache.outputs.dir }} + key: ${{ steps.extcache.outputs.key }} + restore-keys: ${{ runner.os }}-${{ env.extensions-cache-key }} + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ env.php-version }} + extensions: ${{ env.extensions }} + + # Setup GitHub CI PHP problem matchers + # https://github.com/shivammathur/setup-php#problem-matchers + - name: Setup problem matchers for PHP + run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" + + - name: Setup problem matchers for PHPUnit + run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" + + # composer cache + - name: Remove composer lock + run: rm composer.lock + + - name: Get composer cache directory + id: composer-cache + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT + + # http://man7.org/linux/man-pages/man1/date.1.html + # https://github.com/actions/cache#creating-a-cache-key + - name: Get Date + id: get-date + run: echo "date=$(/bin/date -u "+%Y%m%d")" >> $GITHUB_OUTPUT + shell: bash + + - name: Cache dependencies + uses: actions/cache@v4 + with: + path: "${{ steps.composer-cache.outputs.dir }}" + key: "${{ runner.os }}-composer-${{ steps.get-date.outputs.date }}-${{ hashFiles('**/composer.json') }}" + restore-keys: "${{ runner.os }}-composer-${{ steps.get-date.outputs.date }}-" + + # composer installation + - name: Unset platform requirement + run: composer config --unset platform + + - name: Setup PHPunit + run: composer install -n + + - name: Install Google Cloud Storage + run: composer require google/cloud-storage + + # testing + - name: Generate configuration combination unit tests + run: bin/configuration-test-generator + + - name: Run unit tests + run: ../vendor/bin/phpunit --no-coverage --log-junit results.xml ConfigurationCombinationsTest.php + working-directory: tst + + - name: Upload Test Results + if: always() + uses: actions/upload-artifact@v4 + with: + name: Test Results + path: tst/results.xml + Mocha: runs-on: ubuntu-latest steps: