Main #12385
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: Main | |
| run-name: Main | |
| on: | |
| pull_request: | |
| branches: [main] | |
| # on-push trigger is required to analyse long-living branches on SonarCloud | |
| push: | |
| branches: [main] | |
| pull_request_target: | |
| branches: [main] | |
| jobs: | |
| build-main: | |
| if: (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) || (github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository) || (github.event_name == 'workflow_dispatch') || (github.event_name == 'push') | |
| environment: ${{ (github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository) && 'external' || 'internal' }} | |
| strategy: | |
| matrix: | |
| php-version: ["8.3"] | |
| magento-version: ["2.4.8"] | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| permissions: | |
| contents: read | |
| env: | |
| PHP_VERSION: ${{ matrix.php-version }} | |
| MAGENTO_VERSION: ${{ matrix.magento-version }} | |
| ADYEN_API_KEY: ${{secrets.ADYEN_API_KEY}} | |
| ADYEN_CLIENT_KEY: ${{secrets.ADYEN_CLIENT_KEY}} | |
| ADYEN_MERCHANT: ${{secrets.ADYEN_MERCHANT}} | |
| ADMIN_USERNAME: ${{secrets.MAGENTO_ADMIN_USERNAME}} | |
| ADMIN_PASSWORD: ${{secrets.MAGENTO_ADMIN_PASSWORD}} | |
| DONATION_ACCOUNT: ${{secrets.DONATION_ACCOUNT}} | |
| DEPLOY_SAMPLEDATA: 1 | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha || github.ref }} | |
| fetch-depth: 0 | |
| - name: Install Magento | |
| run: docker compose -f .github/docker-compose.yml run --rm web make magento | |
| - name: Start web server in background | |
| run: docker compose -f .github/docker-compose.yml up -d web | |
| - name: Setup permissions | |
| run: docker exec magento2-container make fs | |
| - name: Check install | |
| run: docker exec magento2-container make sys-check | |
| - name: Install plugin | |
| run: docker exec -u www-data magento2-container make plugin | |
| - name: Kill Cron Jobs | |
| run: docker exec magento2-container /etc/init.d/cron stop | |
| - name: Setup permissions | |
| run: docker exec magento2-container make fs | |
| - name: Run PHP_Codesniffer | |
| run: docker exec magento2-container make codesniffer-run | |
| - name: Run PHPUnit | |
| run: docker exec magento2-container make phpunit-run | |
| - name: Format PHPUnit coverage reports | |
| run: docker exec magento2-container make phpunit-fix-report | |
| - name: SonarCloud Scan | |
| if: ${{ env.SONAR_TOKEN }} | |
| uses: SonarSource/sonarqube-scan-action@master | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| - name: Run PHPStan | |
| run: docker exec magento2-container make phpstan-run |