Continuous Integration #23
Workflow file for this run
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: Continuous Integration | |
| on: | |
| workflow_dispatch: ~ | |
| workflow_call: | |
| inputs: | |
| type: | |
| description: "Type of the build" | |
| required: true | |
| type: string | |
| jobs: | |
| get-matrix: | |
| runs-on: ubuntu-latest | |
| name: "Get matrix" | |
| outputs: | |
| matrix: ${{ steps.matrix.outputs.prop }} | |
| steps: | |
| - name: "Checkout" | |
| uses: actions/checkout@v4 | |
| - | |
| name: "Get matrix" | |
| id: matrix | |
| uses: notiz-dev/github-action-json-property@release | |
| with: | |
| path: '.github/workflows/_matrix.json' | |
| prop_path: '${{ inputs.type }}.ci' | |
| tests: | |
| needs: get-matrix | |
| runs-on: ubuntu-latest | |
| name: "Sylius ${{ matrix.sylius }}, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, MySQL ${{ matrix.mysql }}, State Machine ${{ matrix.state_machine }}" | |
| strategy: | |
| fail-fast: false | |
| matrix: ${{ fromJson(needs.get-matrix.outputs.matrix) }} | |
| env: | |
| APP_ENV: test | |
| DATABASE_URL: "mysql://root:root@127.0.0.1/sylius?serverVersion=${{ matrix.mysql }}" | |
| STATE_MACHINE_DEFAULT_ADAPTER: ${{ matrix.state_machine }} | |
| TPAY_CLIENT_ID: '${{ secrets.TPAY_CLIENT_ID }}' | |
| TPAY_CLIENT_SECRET: '${{ secrets.TPAY_CLIENT_SECRET }}' | |
| TPAY_CARDS_API: '${{ secrets.TPAY_CARDS_API }}' | |
| PAYUM_CYPHER_KEY: '${{ secrets.PAYUM_CYPHER_KEY }}' | |
| steps: | |
| - | |
| uses: actions/checkout@v3 | |
| - | |
| name: Run Mockoon CLI | |
| uses: mockoon/cli-action@v2 | |
| with: | |
| version: "latest" | |
| data-file: "./tests/mockoon_tpay.json" | |
| port: 4000 | |
| - name: Build application | |
| uses: SyliusLabs/BuildTestAppAction@v2.4 | |
| with: | |
| build_type: "plugin" | |
| cache_key: "${{ github.run_id }}-${{ runner.os }}-${{ hashFiles('composer.json') }}-sylius-${{ matrix.sylius }}-symfony-${{ matrix.symfony }}" | |
| cache_restore_key: "${{ github.run_id }}-${{ runner.os }}-${{ hashFiles('composer.json') }}-sylius-${{ matrix.sylius }}-symfony-${{ matrix.symfony }}" | |
| database_version: ${{ matrix.mysql }} | |
| php_version: ${{ matrix.php }} | |
| symfony_version: ${{ matrix.symfony }} | |
| sylius_version: ${{ matrix.sylius }} | |
| e2e: "yes" | |
| e2e_js: "yes" | |
| node_version: '20.x' | |
| - name: Install browser drivers | |
| run: vendor/bin/bdi detect drivers | |
| - name: Check dependencies | |
| continue-on-error: true | |
| run: vendor/bin/composer-dependency-analyser | |
| - name: Check service definitions | |
| run: | | |
| tests/Application/bin/console -edev lint:container | |
| tests/Application/bin/console -eprod lint:container | |
| - name: Static analysis | |
| run: vendor/bin/phpstan | |
| - name: Check coding standard | |
| run: vendor/bin/ecs check | |
| - name: Run tests (Unit) | |
| run: vendor/bin/phpunit --testsuite unit --exclude-group requires-fixes | |
| - name: Run tests (API) | |
| run: vendor/bin/phpunit --testsuite api | |
| - name: Run tests (E2E) | |
| run: vendor/bin/phpunit --testsuite e2e --exclude-group requires-fixes | |
| - name: Run Tpay contract tests | |
| if: "${{ inputs.type == 'daily' }}" | |
| run: vendor/bin/phpunit --testsuite contract_external | |
| - name: Upload logs | |
| uses: actions/upload-artifact@v4 | |
| if: failure() | |
| with: | |
| name: "Logs for (Sylius ${{ matrix.sylius }}, PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }}, MySQL ${{ matrix.mysql }}, State Machine ${{ matrix.state_machine }})" | |
| path: | | |
| tests/Application/var/log | |
| tests/Application/var/panther | |
| if-no-files-found: ignore |