| 
 | 1 | +name: Continuous Deployment  | 
 | 2 | + | 
 | 3 | +on:  | 
 | 4 | +  push:  | 
 | 5 | +    branches:  | 
 | 6 | +      - "master"  | 
 | 7 | + | 
 | 8 | +concurrency:  | 
 | 9 | +  group: ${{ github.head_ref || github.run_id }}  | 
 | 10 | +  cancel-in-progress: true  | 
 | 11 | + | 
 | 12 | +jobs:  | 
 | 13 | +  phpunit-render-badge:  | 
 | 14 | +    runs-on: ubuntu-latest  | 
 | 15 | + | 
 | 16 | +    steps:  | 
 | 17 | +      - name: "Checkout"  | 
 | 18 | +        uses: actions/checkout@v3  | 
 | 19 | +        with:  | 
 | 20 | +          fetch-depth: 0  | 
 | 21 | + | 
 | 22 | +      - name: "Setup PHP"  | 
 | 23 | +        uses: shivammathur/setup-php@v2  | 
 | 24 | +        with:  | 
 | 25 | +          php-version: "8.2"  | 
 | 26 | +          extensions: mbstring, intl  | 
 | 27 | +          ini-values: post_max_size=256M, max_execution_time=180  | 
 | 28 | +          coverage: xdebug  | 
 | 29 | + | 
 | 30 | +      - name: "Composer State"  | 
 | 31 | +        run: composer update --no-install --with-all-dependencies  | 
 | 32 | + | 
 | 33 | +      - name: "Composer Name Hash"  | 
 | 34 | +        id: composer-hash  | 
 | 35 | +        uses: KEINOS/gh-action-hash-for-cache@main  | 
 | 36 | +        with:  | 
 | 37 | +          path: ./composer.lock  | 
 | 38 | + | 
 | 39 | +      - name: "Caching"  | 
 | 40 | +        id: cache-composer  | 
 | 41 | +        uses: actions/cache@v3  | 
 | 42 | +        with:  | 
 | 43 | +          path: vendor  | 
 | 44 | +          key: composer-default-${{ steps.composer-hash.outputs.hash }}  | 
 | 45 | +          restore-keys: composer-default-${{ steps.composer-hash.outputs.hash }}  | 
 | 46 | + | 
 | 47 | +      - name: "Install Dependencies"  | 
 | 48 | +        if: ${{ steps.cache-composer.outputs.cache-hit != 'true' }}  | 
 | 49 | +        run: composer install  | 
 | 50 | + | 
 | 51 | +      - name: "Linux: Restore Vendor Executable"  | 
 | 52 | +        run: chmod -R 0755 vendor  | 
 | 53 | + | 
 | 54 | +      - name: "PHPUnit"  | 
 | 55 | +        run: ./vendor/bin/phpunit  | 
 | 56 | + | 
 | 57 | +      - name: "Make code coverage badge"  | 
 | 58 | + | 
 | 59 | +        with:  | 
 | 60 | +          coverage_badge_path: .github/coverage.svg  | 
 | 61 | +          # push badge later on  | 
 | 62 | +          push_badge: false  | 
 | 63 | + | 
 | 64 | +      - name: "Git push badges to origin/image-data"  | 
 | 65 | +        uses: peaceiris/actions-gh-pages@v3  | 
 | 66 | +        with:  | 
 | 67 | +          publish_dir: .github  | 
 | 68 | +          publish_branch: image-data  | 
 | 69 | +          github_token: ${{ secrets.GITHUB_TOKEN }}  | 
 | 70 | +          user_name: "github-actions[bot]"  | 
 | 71 | +          user_email: "github-actions[bot]@users.noreply.github.com"  | 
0 commit comments