Bump symfony/validator from 5.4.26 to 5.4.28 #1042
Workflow file for this run
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
--- | |
name: Magento Platform Tests | |
on: | |
push: | |
branches: | |
- 'master' | |
- 'develop' | |
- 'bugfix/*' | |
- 'feature/*' | |
- 'release/*' | |
pull_request_target: | |
branches: | |
- 'master' | |
- 'develop' | |
jobs: | |
phpunit: | |
name: Unit Tests | |
runs-on: ${{ matrix.operating-system }} | |
continue-on-error: ${{ matrix.experimental }} | |
strategy: | |
matrix: | |
include: | |
#- magento-version: magento-ce-2.4-develop | |
# operating-system: ubuntu-latest | |
# php-version: 8.1 | |
# mysql-version: 8.0 | |
# elasticsearch-version: 7.16.0 | |
# composer-version: v2 | |
# use-git-repository: true | |
# git-repository: https://github.com/magento/magento2.git | |
# git-branch: 2.4-develop | |
# experimental: true | |
- magento-version: mage-os-2.4.5-p1 | |
operating-system: ubuntu-latest | |
php-version: 8.1 | |
mysql-version: 8.0 | |
elasticsearch-version: 7.9.0 | |
composer-version: 2.2.17 | |
use-git-repository: false | |
git-repository: '' | |
experimental: false | |
- magento-version: mage-os-2.4.3-p1 | |
operating-system: ubuntu-latest | |
php-version: 7.4 | |
mysql-version: 8.0 | |
elasticsearch-version: 7.9.0 | |
composer-version: 2.2.17 | |
use-git-repository: false | |
git-repository: '' | |
experimental: false | |
- magento-version: magento-ce-2.4.5-p1 | |
operating-system: ubuntu-latest | |
php-version: 8.1 | |
mysql-version: 8.0 | |
elasticsearch-version: 7.16.0 | |
composer-version: 2.2.17 | |
use-git-repository: false | |
git-repository: '' | |
git-branch: '' | |
experimental: false | |
- magento-version: magento-ce-2.4.4-p2 | |
operating-system: ubuntu-latest | |
php-version: 8.1 | |
mysql-version: 8.0 | |
elasticsearch-version: 7.16.0 | |
composer-version: 2.2.17 | |
use-git-repository: false | |
git-repository: '' | |
git-branch: '' | |
experimental: false | |
- magento-version: magento-ce-2.4.3-p2 | |
operating-system: ubuntu-latest | |
php-version: 7.4 | |
mysql-version: 8.0 | |
elasticsearch-version: 7.9.0 | |
composer-version: 2.2.17 | |
use-git-repository: false | |
git-repository: '' | |
git-branch: '' | |
experimental: false | |
- magento-version: magento-ce-2.4.2-p1 | |
operating-system: ubuntu-latest | |
php-version: 7.4 | |
mysql-version: 8.0 | |
elasticsearch-version: 7.9.0 | |
composer-version: 2.2.17 | |
use-git-repository: false | |
git-repository: '' | |
git-branch: '' | |
experimental: false | |
- magento-version: magento-ce-2.4.2 | |
operating-system: ubuntu-latest | |
php-version: 7.4 | |
mysql-version: 8.0 | |
elasticsearch-version: 7.9.0 | |
composer-version: 2.2.17 | |
use-git-repository: false | |
git-repository: '' | |
git-branch: '' | |
experimental: false | |
services: | |
elaticsearch: | |
image: docker.elastic.co/elasticsearch/elasticsearch:${{ matrix.elasticsearch-version }} | |
# we bind the port to the host because the n98-magerun2 install command does not support to pass | |
# ES variables. So we cannot pass the random port via GitHub Action template variable. | |
ports: | |
- 9200:9200 | |
- 9300:9300 | |
options: -e="discovery.type=single-node" --health-cmd="curl http://localhost:9200/_cluster/health" --health-interval=10s --health-timeout=5s --health-retries=10 | |
mysql: | |
image: mysql:${{ matrix.mysql-version }} | |
env: | |
MYSQL_ROOT_PASSWORD: root | |
MYSQL_DATABASE: magento | |
ports: | |
- 3306 | |
options: --tmpfs /tmp:rw --tmpfs /var/lib/mysql:rw --health-cmd="mysqladmin ping" | |
env: | |
MAGENTO_MARKETPLACE_USERNAME: ${{ secrets.MAGENTO_MARKETPLACE_USERNAME }} | |
MAGENTO_MARKETPLACE_PASSWORD: ${{ secrets.MAGENTO_MARKETPLACE_PASSWORD }} | |
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- name: Dump GitHub context | |
run: echo "Register Github context" | |
env: | |
GITHUB_CONTEXT: ${{ toJSON(github) }} | |
- name: Define Magento ROOT for tests | |
run: echo "Set Magento root to $WORKSPACE" | |
env: | |
N98_MAGERUN2_TEST_MAGENTO_ROOT: ${{ github.workspace }}/magento | |
# https://github.com/marketplace/actions/setup-php-action#matrix-setup | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
tools: composer:${{ matrix.composer-version }}, cs2pr | |
php-version: ${{ matrix.php-version }} | |
extensions: mcrypt, mbstring, intl | |
coverage: none | |
- name: Checkout PR | |
uses: actions/checkout@v3.6.0 | |
if: github.event_name == 'pull_request_target' | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Checkout HEAD | |
uses: actions/checkout@v3.6.0 | |
if: github.event_name == 'push' | |
- name: Install Composer Presissimo Plugin | |
run: composer global require hirak/prestissimo | |
if: matrix.composer-version == 'v1' | |
- name: Get Composer Cache Directory | |
id: composer-cache | |
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
- name: Cache Dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: "${{ runner.os }}-php-${{ matrix.php-version }}-composer-${{ hashFiles('composer.lock') }}" | |
restore-keys: "${{ runner.os }}-php-${{ matrix.php-version }}-composer-" | |
- name: Install dependencies | |
# If we have a very broad restore-keys in the previous caching action, | |
# we might pull outdated dependencies from a parent branch for new branches. | |
# Over time, just running composer all the time to give it a chance | |
# to fix the outdated dependencies should be faster than having to pull | |
# everything from scratch for every new branch. | |
run: composer install --no-interaction --prefer-dist --no-progress --no-suggest | |
- name: Run php-cs-fixer | |
run: vendor/bin/php-cs-fixer fix --diff --dry-run | |
- name: Setup Magento Repository Credentials | |
run: | | |
composer global config http-basic.repo.magento.com "${MAGENTO_MARKETPLACE_USERNAME}" "${MAGENTO_MARKETPLACE_PASSWORD}"; | |
- name: Install Magento via git | |
run: | | |
git clone --branch "${{ matrix.git-branch }}" --single-branch ${{ matrix.git-repository }} "$GITHUB_WORKSPACE/magento"; | |
cd "$GITHUB_WORKSPACE/magento"; | |
composer --version; | |
composer install --no-interaction; | |
bin/magento setup:install \ | |
--db-host="127.0.0.1:${{ job.services.mysql.ports[3306] }}" \ | |
--db-user=root \ | |
--db-password=root \ | |
--db-name=magento \ | |
--cleanup-database \ | |
--session-save=db \ | |
--backend-frontname=admin \ | |
--timezone="Europe/Berlin" \ | |
--currency="EUR" \ | |
--base-url="http://github.magerun.test/" \ | |
--use-rewrites=1 \ | |
--use-secure=1 \ | |
--use-secure-admin=1 \ | |
--admin-user=admin \ | |
--admin-password=Password123 \ | |
--admin-firstname=Armin \ | |
--admin-lastname=Admin \ | |
--admin-email="admin@example.com" \ | |
--search-engine="elasticsearch7" \ | |
--elasticsearch-host="127.0.0.1" \ | |
--elasticsearch-port=9200; | |
if: matrix.use-git-repository == true | |
- name: Install ${{ matrix.magento-version }} via n98-magerun2 | |
run: | | |
composer --version; | |
bin/n98-magerun2 --ansi install \ | |
--magentoVersionByName="${{ matrix.magento-version }}" --installationFolder="$GITHUB_WORKSPACE/magento" \ | |
--dbHost=127.0.0.1 --dbPort=${{ job.services.mysql.ports['3306'] }} --dbUser=root --dbPass=root --dbName="magento" \ | |
--useDefaultConfigParams=yes \ | |
--installSampleData=no \ | |
--baseUrl="http://github.magerun.test/"; | |
if: matrix.use-git-repository == false | |
- name: Configure matchers | |
uses: mheap/phpunit-matcher-action@main | |
- name: Run PHPUnit (Developer Mode) | |
run: vendor/bin/phpunit --debug --process-isolation | |
- name: Activate Magento Production Mode | |
working-directory: ./magento | |
run: | | |
rm -Rf generated/code; | |
bin/magento deploy:mode:set production; | |
- name: Run PHPUnit (Production Mode) | |
run: vendor/bin/phpunit --debug --process-isolation | |
# phpstan is temporary disabled until we can find a solution to run against several Magento versions | |
# or run only against the latest version? | |
## we run phpstan after di:compile in production mode to prevent class not found errors in Magerun sources | |
#- name: Run PHPStan | |
# working-directory: ./magento | |
# run: | |
# ../vendor/bin/phpstan analyse --level 1 --autoload-file="../src/bootstrap.php" ../src | |
# if: matrix.magento-version == 'magento-ce-2.4.5-p2' | |
- name: Setup PHP for Composer | |
uses: shivammathur/setup-php@v2 | |
with: | |
tools: composer:2 | |
php-version: '7.4' | |
if: matrix.magento_version == false | |
- name: Build phar file | |
run: | | |
composer self-update --2; | |
composer --version; | |
composer global remove hirak/prestissimo; | |
bash ./build.sh; | |
composer self-update --rollback &> /dev/null || true; | |
- name: Setup PHP for Composer | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-version }} | |
- name: Run phar functional tests | |
run: bash tests/phar-test.sh "./n98-magerun2.phar" "$GITHUB_WORKSPACE/magento" |