ci(deps): bump codecov/codecov-action from 7.0.0 to 7.1.1 #2852
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Test | |
| on: | |
| push: | |
| pull_request: | |
| release: | |
| types: | |
| - published | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| runs-on: "ubuntu-22.04" | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php-versions: [ '8.0', '8.1', '8.2', '8.3', '8.4', '8.5' ] | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Install PHP | |
| uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2 | |
| with: | |
| php-version: ${{ matrix.php-versions }} | |
| coverage: pcov | |
| tools: composer:v2.2 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Validate composer.json and composer.lock | |
| run: composer validate | |
| - name: Cache Composer packages | |
| id: composer-cache | |
| uses: actions/cache@v6 | |
| with: | |
| path: | | |
| vendor | |
| tools/psalm/vendor | |
| key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-php- | |
| - name: Install dependencies | |
| run: composer install --prefer-dist | |
| # Psalm 6 needs PHP >= 8.1 to run; the analysis target stays 8.0 (phpVersion in psalm.xml) | |
| - name: Static Analysis | |
| if: ${{ matrix.php-versions == '8.1' }} | |
| run: | | |
| composer install --prefer-dist -d tools/psalm | |
| tools/psalm/vendor/bin/psalm --no-cache | |
| - name: Test with coverage | |
| if: ${{ matrix.php-versions == '8.0' }} | |
| run: ./bin/phpunit -d memory_limit=-1 --coverage-clover clover.xml | |
| - name: Test without coverage | |
| if: ${{ matrix.php-versions != '8.0' }} | |
| run: ./bin/phpunit -d memory_limit=-1 | |
| - name: Upload coverage to Codecov | |
| if: ${{ matrix.php-versions == '8.0' }} | |
| uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| phar: | |
| runs-on: "ubuntu-22.04" | |
| needs: build | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Install PHP | |
| uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2 | |
| with: | |
| php-version: 8.2 | |
| tools: composer:v2.2 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # Box 4.x requires PHP 8.2+ to run, but the released PHAR must still | |
| # support PHP 8.0+. Pin the resolver platform so composer installs the | |
| # PHP 8.0-compatible dependency set regardless of the runner's PHP. | |
| - name: "Pin composer platform to PHP 8.0 for the released PHAR" | |
| run: composer config platform.php 8.0 | |
| - name: Install dependencies | |
| run: composer install --prefer-dist --no-dev -o | |
| - name: "Install box" | |
| run: composer install --prefer-dist -d tools/box | |
| - name: "Compile phparkitect phar" | |
| run: tools/box/vendor/bin/box compile -c ./box.json | |
| - name: "Check phar" | |
| run: php ./phparkitect.phar | |
| - name: "Rename phar to avoid conflicts" | |
| run: mv ./phparkitect.phar phparkitect-${{ github.sha }}.phar | |
| - name: "Upload phar file artifact" | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: phar-artifact | |
| path: ./phparkitect-${{ github.sha }}.phar | |
| retention-days: 1 | |
| smoke-test-phar: | |
| needs: phar | |
| runs-on: "ubuntu-22.04" | |
| strategy: | |
| matrix: | |
| php-versions: [ '8.0', '8.1', '8.2', '8.3', '8.4', '8.5' ] | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Install PHP | |
| uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2 | |
| with: | |
| php-version: ${{ matrix.php-versions }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: "Download phar ./phparkitect-${{ github.sha }}.phar" | |
| uses: actions/download-artifact@v8 | |
| with: | |
| # will download phar in project root | |
| name: phar-artifact | |
| - name: "Smoke test phar" | |
| run: php ./phparkitect-${{ github.sha }}.phar | |
| - name: "End-to-end test phar: run check on fixture" | |
| run: | | |
| php ./phparkitect-${{ github.sha }}.phar check \ | |
| --config tests/E2E/_fixtures/autoload/phparkitect.php \ | |
| --autoload tests/E2E/_fixtures/autoload/autoload.php | |
| - name: "End-to-end test phar: generate, use and prune a baseline" | |
| run: | | |
| php ./phparkitect-${{ github.sha }}.phar generate-baseline smoke-baseline.json \ | |
| --config tests/E2E/_fixtures/configMvcForYieldBug.php \ | |
| --autoload tests/E2E/_fixtures/autoload/autoload.php | |
| test -s smoke-baseline.json | |
| php ./phparkitect-${{ github.sha }}.phar check \ | |
| --config tests/E2E/_fixtures/configMvcForYieldBug.php \ | |
| --autoload tests/E2E/_fixtures/autoload/autoload.php \ | |
| --use-baseline smoke-baseline.json | |
| php ./phparkitect-${{ github.sha }}.phar prune-baseline smoke-baseline.json \ | |
| --config tests/E2E/_fixtures/configMvcForYieldBug.php \ | |
| --autoload tests/E2E/_fixtures/autoload/autoload.php | |
| test -s smoke-baseline.json | |
| publish_phar: | |
| needs: [build, smoke-test-phar] | |
| runs-on: "ubuntu-22.04" | |
| if: github.event_name == 'release' | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: "Download phar ./phparkitect-${{ github.sha }}.phar" | |
| uses: actions/download-artifact@v8 | |
| with: | |
| # will download phar in project root | |
| name: phar-artifact | |
| - name: Import GPG key | |
| uses: crazy-max/ghaction-import-gpg@2dc316deee8e90f13e1a351ab510b4d5bc0c82cd # v7.0.0 | |
| with: | |
| gpg_private_key: ${{ secrets.GPG_KEY_47CD54B6398FE21B3709D0A4D9C905CED1932CA2 }} | |
| passphrase: ${{ secrets.GPG_KEY_47CD54B6398FE21B3709D0A4D9C905CED1932CA2_PASSPHRASE }} | |
| - name: Rename phar | |
| run: mv ./phparkitect-${{ github.sha }}.phar phparkitect.phar | |
| - name: Sign the PHAR | |
| run: | | |
| gpg --local-user 47CD54B6398FE21B3709D0A4D9C905CED1932CA2 \ | |
| --batch \ | |
| --yes \ | |
| --passphrase="${{ secrets.GPG_KEY_47CD54B6398FE21B3709D0A4D9C905CED1932CA2_PASSPHRASE }}" \ | |
| --detach-sign \ | |
| --output ./phparkitect.phar.asc \ | |
| ./phparkitect.phar | |
| - name: Add phar to the release | |
| uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| files: | | |
| phparkitect.phar | |
| phparkitect.phar.asc | |