fix: checkout correct branch in scheduler #529
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: Test | |
| on: | |
| push: | |
| branches: | |
| - 'v4' | |
| tags-ignore: | |
| - '*' | |
| pull_request: | |
| workflow_call: | |
| jobs: | |
| get-matrix: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| matrix: ${{ steps.matrix.outputs.matrix }} | |
| steps: | |
| - name: Checkout v4 | |
| if: github.event_name != 'pull_request' | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: v4 | |
| - name: Checkout Pull Request | |
| if: github.event_name == 'pull_request' | |
| uses: actions/checkout@v4 | |
| - name: Get Shopware Version | |
| id: shopware-constraint | |
| run: echo "shopware_constraint=$(cat composer.json | jq -r '.require."shopware/core"')" >> $GITHUB_OUTPUT | |
| - name: Get Shopware Matrix | |
| uses: tinect/github-shopware-matrix-generator@main | |
| id: matrix | |
| with: | |
| versionConstraint: ${{ steps.shopware-constraint.outputs.shopware_constraint }} | |
| allowEol: false | |
| justMinMaxShopware: false | |
| allowShopwareNext: true | |
| allowShopwareRC: false | |
| test: | |
| env: | |
| PLUGIN_NAME: FroshPlatformThumbnailProcessor | |
| needs: get-matrix | |
| strategy: | |
| fail-fast: false | |
| matrix: ${{ fromJson(needs.get-matrix.outputs.matrix) }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Setup Shopware | |
| uses: shopware/setup-shopware@main | |
| with: | |
| shopware-version: ${{ matrix.shopware }} | |
| php-version: ${{ matrix.php }} | |
| php-extensions: pcov | |
| - name: Info | |
| run: | | |
| php bin/console -V | |
| mysql -V | |
| php -v | |
| composer -V | |
| echo ${{ github.workspace }} | |
| - name: Checkout v4 | |
| if: github.event_name != 'pull_request' | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: v4 | |
| path: ${{ github.workspace }}/custom/plugins/${{ env.PLUGIN_NAME }} | |
| - name: Checkout Pull Request | |
| if: github.event_name == 'pull_request' | |
| uses: actions/checkout@v4 | |
| with: | |
| path: ${{ github.workspace }}/custom/plugins/${{ env.PLUGIN_NAME }} | |
| - name: PHPUnit | |
| working-directory: ${{ github.workspace }}/custom/plugins/${{ env.PLUGIN_NAME }} | |
| run: | | |
| composer create-placeholders | |
| php -d pcov.enabled=1 ${{ github.workspace }}/vendor/bin/phpunit --coverage-clover clover.xml | |
| - uses: codecov/codecov-action@v3 | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| with: | |
| files: ./clover.xml | |
| root_dir: ${{ github.workspace }}/custom/plugins/${{ env.PLUGIN_NAME }} | |
| working-directory: ${{ github.workspace }}/custom/plugins/${{ env.PLUGIN_NAME }} | |
| # we call this after PHPUnit to make sure that the generated files are available | |
| - name: PHPStan | |
| run: | | |
| ${{ github.workspace }}/vendor/bin/phpstan analyse -c ${{ github.workspace }}/custom/plugins/${{ env.PLUGIN_NAME }}/phpstan.neon |