|
| 1 | +name: Continuous Deployment |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - "*" # Should be MASTER after testing |
| 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 | + if: matrix.operating-system == 'ubuntu-latest' |
| 53 | + run: chmod -R 0755 vendor |
| 54 | + |
| 55 | + - name: "PHPUnit" |
| 56 | + run: ./vendor/bin/phpunit |
| 57 | + |
| 58 | + - name: "Make code coverage badge" |
| 59 | + |
| 60 | + with: |
| 61 | + coverage_badge_path: .github/coverage.svg |
| 62 | + # push badge later on |
| 63 | + push_badge: false |
| 64 | + |
| 65 | + - name: "Git push badges to origin/image-data" |
| 66 | + uses: peaceiris/actions-gh-pages@v3 |
| 67 | + with: |
| 68 | + publish_dir: .github |
| 69 | + publish_branch: image-data |
| 70 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 71 | + user_name: "github-actions[bot]" |
| 72 | + user_email: "github-actions[bot]@users.noreply.github.com" |
0 commit comments