|
1 | | -name: Main CI workflow |
| 1 | +name: Main |
| 2 | +run-name: Main |
2 | 3 |
|
3 | 4 | on: |
4 | 5 | pull_request: |
| 6 | + branches: [main, develop-10] |
5 | 7 | pull_request_target: |
6 | | - workflow_dispatch: |
| 8 | + branches: [main, develop-10] |
7 | 9 |
|
8 | 10 | jobs: |
9 | 11 | build: |
10 | 12 | 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') |
11 | 13 | environment: ${{ (github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository) && 'external' || 'internal' }} |
12 | | - runs-on: ubuntu-latest |
13 | | - timeout-minutes: 25 |
14 | 14 | strategy: |
15 | 15 | matrix: |
16 | | - php-version: [8.2,8.3] |
17 | | - |
| 16 | + php-version: ["8.3"] |
| 17 | + magento-version: ["2.4.8"] |
| 18 | + runs-on: ubuntu-latest |
| 19 | + timeout-minutes: 15 |
| 20 | + env: |
| 21 | + PHP_VERSION: ${{ matrix.php-version }} |
| 22 | + MAGENTO_VERSION: ${{ matrix.magento-version }} |
| 23 | + ADYEN_API_KEY: ${{secrets.ADYEN_API_KEY}} |
| 24 | + ADYEN_CLIENT_KEY: ${{secrets.ADYEN_CLIENT_KEY}} |
| 25 | + ADYEN_MERCHANT: ${{secrets.ADYEN_MERCHANT}} |
| 26 | + ADMIN_USERNAME: ${{secrets.MAGENTO_ADMIN_USERNAME}} |
| 27 | + ADMIN_PASSWORD: ${{secrets.MAGENTO_ADMIN_PASSWORD}} |
| 28 | + DONATION_ACCOUNT: ${{secrets.DONATION_ACCOUNT}} |
| 29 | + DEPLOY_SAMPLEDATA: 1 |
18 | 30 | steps: |
19 | 31 | - uses: actions/checkout@v3 |
20 | 32 | with: |
21 | 33 | ref: ${{ github.event.pull_request.head.sha || github.ref }} |
22 | | - fetch-depth: 0 |
23 | 34 |
|
24 | | - - name: Use PHP ${{ matrix.php-version }} |
25 | | - uses: shivammathur/setup-php@v2 |
26 | | - with: |
27 | | - php-version: ${{ matrix.php-version }} |
28 | | - tools: composer:v2 |
| 35 | + - name: Install Magento |
| 36 | + run: docker compose -f .github/docker-compose.yml run --rm web make magento |
29 | 37 |
|
30 | | - - name: Test plugin installation |
31 | | - run: | |
32 | | - echo "{\"http-basic\":{\"repo.magento.com\":{\"username\":\"${MAGENTO_USERNAME}\",\"password\":\"${MAGENTO_PASSWORD}\"}}}" > auth.json |
33 | | - composer install --prefer-dist |
34 | | - env: |
35 | | - CI: true |
36 | | - MAGENTO_USERNAME: ${{ secrets.MAGENTO_USERNAME }} |
37 | | - MAGENTO_PASSWORD: ${{ secrets.MAGENTO_PASSWORD }} |
| 38 | + - name: Start web server in background |
| 39 | + run: docker compose -f .github/docker-compose.yml up -d web |
38 | 40 |
|
39 | | - - name: Code Sniffer |
40 | | - run: vendor/bin/phpcs . |
| 41 | + - name: Setup permissions |
| 42 | + run: docker exec magento2-container make fs |
41 | 43 |
|
42 | | - - name: Run PHPUnit |
43 | | - run: vendor/bin/phpunit --coverage-clover=build/clover.xml --log-junit=build/tests-log.xml -c Test/phpunit.xml Test/Unit |
| 44 | + - name: Check install |
| 45 | + run: docker exec magento2-container make sys-check |
44 | 46 |
|
45 | | - - name: Fix code coverage paths |
46 | | - run: sed -i "s;`pwd`/;;g" build/*.xml |
| 47 | + - name: Install plugin |
| 48 | + run: docker exec -u www-data magento2-container make plugin |
| 49 | + |
| 50 | + - name: Kill Cron Jobs |
| 51 | + run: docker exec magento2-container /etc/init.d/cron stop |
| 52 | + |
| 53 | + - name: Setup permissions |
| 54 | + run: docker exec magento2-container make fs |
| 55 | + |
| 56 | + - name: Run PHP_Codesniffer |
| 57 | + run: docker exec magento2-container make codesniffer-run |
| 58 | + |
| 59 | + - name: Run PHPUnit |
| 60 | + run: docker exec magento2-container make phpunit-run |
47 | 61 |
|
48 | 62 | - name: SonarCloud Scan |
49 | 63 | if: ${{ env.SONAR_TOKEN }} |
50 | 64 | uses: SonarSource/sonarqube-scan-action@master |
51 | 65 | env: |
52 | 66 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
53 | 67 | SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |
| 68 | + |
| 69 | + - name: Run PHPStan |
| 70 | + run: docker exec magento2-container make phpstan-run |
0 commit comments