Skip to content

chore: use new matrix generator #520

chore: use new matrix generator

chore: use new matrix generator #520

Workflow file for this run

name: Test
on:
push:
branches:
- 'main'
tags-ignore:
- '*'
pull_request:
workflow_call:
jobs:
get-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.matrix.outputs.matrix }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Get Shopware Matrix
uses: tinect/github-shopware-matrix-generator@main
id: matrix
with:
versionConstraint: '~6.6.0'
allowEol: false
justMinMaxShopware: false
allowShopwareNext: true
allowShopwareRC: false
Test:
env:
PLUGIN_NAME: FroshPlatformThumbnailProcessor
needs: get-matrix
strategy:
fail-fast: false
matrix:
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
- name: Checkout
uses: actions/checkout@v3
with:
path: ${{ github.workspace }}/custom/plugins/${{ env.PLUGIN_NAME }}
- name: Run UnitTests
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 --testsuite Unit
- 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
IntegrationTest:
env:
PLUGIN_NAME: FroshPlatformThumbnailProcessor
needs: get-matrix
strategy:
fail-fast: false
matrix:
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
- name: Checkout
uses: actions/checkout@v3
with:
path: ${{ github.workspace }}/custom/plugins/${{ env.PLUGIN_NAME }}
- name: PHPUnit Integration
working-directory: ${{ github.workspace }}/custom/plugins/${{ env.PLUGIN_NAME }}
run: |
composer create-placeholders
php -d pcov.enabled=1 ${{ github.workspace }}/vendor/bin/phpunit --testsuite Integration
- 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 }}