-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Can Demiralp
committed
Jan 31, 2025
1 parent
648d2a5
commit 99e706a
Showing
2 changed files
with
54 additions
and
30 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,62 @@ | ||
name: PHPStan analysis | ||
name: PHPStan analysis workflow | ||
run-name: PHPStan analysis workflow | ||
|
||
on: | ||
pull_request: | ||
branches: [main] | ||
pull_request_target: | ||
workflow_dispatch: | ||
branches: [main] | ||
|
||
jobs: | ||
build: | ||
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') | ||
environment: ${{ (github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository) && 'external' || 'internal' }} | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
php-version: [8.2,8.3] | ||
|
||
php-version: ["8.3"] | ||
magento-version: ["2.4.7-p2"] | ||
runs-on: | ||
group: larger-runners | ||
labels: ubuntu-latest-8-cores | ||
timeout-minutes: 25 | ||
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: Use PHP ${{ matrix.php-version }} | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php-version }} | ||
tools: composer:v2 | ||
|
||
- name: Test plugin installation | ||
run: | | ||
echo "{\"http-basic\":{\"repo.magento.com\":{\"username\":\"${MAGENTO_USERNAME}\",\"password\":\"${MAGENTO_PASSWORD}\"}}}" > auth.json | ||
composer install --prefer-dist | ||
env: | ||
CI: true | ||
MAGENTO_USERNAME: ${{ secrets.MAGENTO_USERNAME }} | ||
MAGENTO_PASSWORD: ${{ secrets.MAGENTO_PASSWORD }} | ||
|
||
- name: Install Magento PHPStan dependecies | ||
run: | | ||
composer require --dev bitexpert/phpstan-magento | ||
composer config allow-plugins.phpstan/extension-installer true | ||
composer require --dev phpstan/extension-installer | ||
- name: PHPStan | ||
run: vendor/bin/phpstan analyse -c phpstan.neon | ||
- 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: Install PHPStan dependencies | ||
run: docker compose -f .github/docker-compose.yml run --rm web make phpstan-install | ||
|
||
- 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 PHPStan | ||
run: docker exec magento2-container make phpstan-run |