chore(deps): update dependency phpstan/phpstan to v2.2.7 #14
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: PHAR | |
| on: | |
| push: | |
| tags: | |
| - '*' | |
| pull_request: | |
| branches: | |
| - '**' | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| phar: | |
| runs-on: ubuntu-latest | |
| name: Build PHAR | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: '8.4' | |
| extensions: libxml, mbstring, simplexml, dom, intl | |
| tools: composer, box | |
| - name: Install Composer dependencies (production only) | |
| run: composer install --no-dev --no-interaction --no-progress | |
| - name: Compile PHAR | |
| run: box compile --no-interaction | |
| - name: Smoke test (valid files -> exit 0) | |
| run: php composer-translation-validator.phar tests/src/Fixtures/translations/xliff/success | |
| - name: Smoke test (invalid files -> exit 1) | |
| run: | | |
| set +e | |
| php composer-translation-validator.phar tests/src/Fixtures/translations/xliff/fail | |
| code=$? | |
| set -e | |
| if [ "$code" -ne 1 ]; then | |
| echo "Expected exit code 1 for invalid fixtures, got $code" >&2 | |
| exit 1 | |
| fi | |
| - name: Generate checksum | |
| if: startsWith(github.ref, 'refs/tags/') | |
| run: sha256sum composer-translation-validator.phar > composer-translation-validator.phar.sha256 | |
| - name: Attach PHAR to release | |
| if: startsWith(github.ref, 'refs/tags/') | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| tag="${GITHUB_REF_NAME}" | |
| # The release for this tag is created by the separate "Release" workflow, | |
| # which may still be running. `gh release view`/`upload` correctly resolve | |
| # drafts by tag name, unlike the REST /releases/tags/{tag} endpoint used by | |
| # some third-party actions (which excludes drafts and would otherwise cause | |
| # a duplicate, asset-less release to be created here). | |
| for _ in $(seq 1 30); do | |
| if gh release view "$tag" >/dev/null 2>&1; then | |
| break | |
| fi | |
| sleep 5 | |
| done | |
| gh release upload "$tag" \ | |
| composer-translation-validator.phar \ | |
| composer-translation-validator.phar.sha256 \ | |
| --clobber |