|
| 1 | +name: Test Impact |
| 2 | + |
| 3 | +# Run this workflow every time a new commit pushed to your repository |
| 4 | +on: |
| 5 | + push: |
| 6 | + paths-ignore: |
| 7 | + - '**/*.md' |
| 8 | + pull_request: |
| 9 | + paths-ignore: |
| 10 | + - '**/*.md' |
| 11 | + # Allow manually triggering the workflow. |
| 12 | + workflow_dispatch: |
| 13 | + |
| 14 | +jobs: |
| 15 | + kill_previous: |
| 16 | + name: 0️⃣ Kill previous runs |
| 17 | + runs-on: ubuntu-latest |
| 18 | + # We want to run on external PRs, but not on our own internal PRs as they'll be run by the push to the branch. |
| 19 | + if: (github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository) |
| 20 | + steps: |
| 21 | + - name: Cancel Previous Runs |
| 22 | + |
| 23 | + with: |
| 24 | + access_token: ${{ github.token }} |
| 25 | + |
| 26 | + execute_Lychee: |
| 27 | + name: 1️⃣ PHP - Lychee |
| 28 | + runs-on: ubuntu-latest |
| 29 | + needs: |
| 30 | + - kill_previous |
| 31 | + steps: |
| 32 | + - name: Extract branch name |
| 33 | + shell: bash |
| 34 | + run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT |
| 35 | + id: extract_branch |
| 36 | + |
| 37 | + - name: Set up PHP |
| 38 | + uses: shivammathur/setup-php@v2 |
| 39 | + with: |
| 40 | + php-version: 8.0 |
| 41 | + coverage: none |
| 42 | + tools: phpstan |
| 43 | + env: |
| 44 | + COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 45 | + |
| 46 | + - name: Checkout code |
| 47 | + uses: actions/checkout@v3 |
| 48 | + with: |
| 49 | + repository: 'LycheeOrg/Lychee' |
| 50 | + |
| 51 | + - name: Fix composer.json |
| 52 | + run: composer require --dev "lychee-org/phpstan-lychee":"dev-${{ steps.extract_branch.outputs.branch }}" |
| 53 | + |
| 54 | + - name: Run PHPStan |
| 55 | + run: vendor/bin/phpstan analyze |
| 56 | + |
| 57 | + execute_php_exif: |
| 58 | + name: 1️⃣ PHP - php-exif |
| 59 | + runs-on: ubuntu-latest |
| 60 | + needs: |
| 61 | + - kill_previous |
| 62 | + steps: |
| 63 | + - name: Extract branch name |
| 64 | + shell: bash |
| 65 | + run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT |
| 66 | + id: extract_branch |
| 67 | + |
| 68 | + - name: Set up PHP |
| 69 | + uses: shivammathur/setup-php@v2 |
| 70 | + with: |
| 71 | + php-version: 8.0 |
| 72 | + coverage: none |
| 73 | + tools: phpstan |
| 74 | + env: |
| 75 | + COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 76 | + |
| 77 | + - name: Checkout code |
| 78 | + uses: actions/checkout@v3 |
| 79 | + with: |
| 80 | + repository: 'LycheeOrg/php-exif' |
| 81 | + |
| 82 | + - name: Fix composer.json |
| 83 | + run: composer require --dev "lychee-org/phpstan-lychee":"dev-${{ steps.extract_branch.outputs.branch }}" |
| 84 | + |
| 85 | + - name: Run PHPStan |
| 86 | + run: vendor/bin/phpstan analyze |
| 87 | + |
| 88 | + execute_nested_sets: |
| 89 | + if: ${{ false }} # disable for now |
| 90 | + name: 1️⃣ PHP - Nested sets |
| 91 | + runs-on: ubuntu-latest |
| 92 | + needs: |
| 93 | + - kill_previous |
| 94 | + steps: |
| 95 | + - name: Extract branch name |
| 96 | + shell: bash |
| 97 | + run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT |
| 98 | + id: extract_branch |
| 99 | + |
| 100 | + - name: Set up PHP |
| 101 | + uses: shivammathur/setup-php@v2 |
| 102 | + with: |
| 103 | + php-version: 8.0 |
| 104 | + coverage: none |
| 105 | + tools: phpstan |
| 106 | + env: |
| 107 | + COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 108 | + |
| 109 | + - name: Checkout code |
| 110 | + uses: actions/checkout@v3 |
| 111 | + with: |
| 112 | + repository: 'LycheeOrg/laravel-nestedset' |
| 113 | + ref: 'enable-phpstan' |
| 114 | + |
| 115 | + - name: Fix composer.json |
| 116 | + run: | |
| 117 | + composer require --dev "lychee-org/phpstan-lychee":"dev-${{ steps.extract_branch.outputs.branch }}" |
| 118 | +
|
| 119 | + - name: Run PHPStan |
| 120 | + run: vendor/bin/phpstan analyze |
0 commit comments