update coverage badge #9
Workflow file for this run
This file contains 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: ci | |
on: [ push, pull_request ] | |
jobs: | |
test: | |
name: Run tests | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
php-versions: [ '8.1', '8.2', '8.3' ] | |
steps: | |
- name: Checkout codebase | |
uses: actions/checkout@v4 | |
- name: Setup PHP Action | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-versions }} | |
- name: Get composer cache directory | |
id: composer-cache | |
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | |
- name: Cache dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: ${{ runner.os }}-composer- | |
- name: Install dependencies | |
run: composer install --prefer-dist | |
- name: Recreate autoload file | |
run: composer dump-autoload | |
- name: Run Psalm | |
run: ./vendor/bin/psalm | |
- name: Run Unit Tests | |
run: XDEBUG_MODE_COVERAGE=coverage vendor/bin/phpunit | |
- if: ${{ (matrix.php-versions == '8.3') }} | |
name: Generate test coverage badge | |
uses: timkrase/[email protected] | |
with: | |
coverage_badge_path: output/coverage.svg | |
push_badge: false | |
- if: ${{ (matrix.php-versions == '8.3') }} | |
name: Git push to image-data branch | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
publish_dir: ./output | |
publish_branch: image-data | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
user_name: 'github-actions[bot]' | |
user_email: 'github-actions[bot]@users.noreply.github.com' | |
release: | |
permissions: | |
contents: write | |
name: "Tagged Release" | |
needs: test | |
if: startsWith(github.ref, 'refs/tags/v') | |
runs-on: ubuntu-latest | |
steps: | |
- uses: "marvinpinto/action-automatic-releases@latest" | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
prerelease: false |