Releasing v1.1.1 #54
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 CI | |
env: | |
GITHUB_TOKEN: ${{ secrets.GIT_ACCESS_TOKEN }} | |
MAGENTO_PUBLIC_ACCESS_KEY: ${{ secrets.MAGENTO_PUBLIC_ACCESS_KEY }} | |
MAGENTO_PRIVATE_ACCESS_KEY: ${{ secrets.MAGENTO_PRIVATE_ACCESS_KEY }} | |
DB_DATABASE: magento | |
DB_USER: root | |
DB_PASSWORD: root | |
ES_VERSION: 7.10.0 | |
PHP_VERSION: 8.3 | |
on: [pull_request] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
environment: | |
name: build | |
steps: | |
# Set up PHP | |
- name: Setup - PHP, with composer and extensions | |
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php | |
with: | |
php-version: ${{ env.PHP_VERSION }} | |
tools: composer | |
extensions: mbstring, gd, bcmath, soap, dom, xml, json, tokenizer, mysql, zip, xdebug | |
# Use composer cache | |
- name: Setup - Get Composer Cache Directory | |
id: composer-cache | |
run: | | |
echo "::set-output name=dir::$(composer config cache-files-dir)" | |
- uses: actions/cache@v2 | |
with: | |
path: ${{ steps.composer-cache.outputs.dir }} | |
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: | | |
${{ runner.os }}-composer- | |
# Configure composer global credentials | |
- name: Setup - Configure Composer | |
run: | | |
composer config -g github-oauth.github.com ${GITHUB_TOKEN} | |
composer config -g http-basic.repo.magento.com ${MAGENTO_PUBLIC_ACCESS_KEY} ${MAGENTO_PRIVATE_ACCESS_KEY} | |
# Setup required software for Magento Installation | |
# Set up MySQL | |
- name: Setup - MySQL | |
run: | | |
sudo /etc/init.d/mysql start | |
mysql -e 'CREATE DATABASE ${{ env.DB_DATABASE }};' -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }} | |
# Set Up ElasticSearch | |
- name: Setup - Configure sysctl limits | |
run: | | |
sudo swapoff -a | |
sudo sysctl -w vm.swappiness=1 | |
sudo sysctl -w fs.file-max=262144 | |
sudo sysctl -w vm.max_map_count=262144 | |
- name: Setup - ElasticSearch | |
uses: elastic/elastic-github-actions/elasticsearch@master | |
with: | |
stack-version: ${{ env.ES_VERSION }} | |
# Install the latest Magento Open Source via composer | |
- name: Setup - Install Magento Codebase | |
run: composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition ./ | |
# Install the Bloomreach module via composer | |
- name: Setup - Install Module Codebase | |
run: | | |
composer config repositories.github vcs https://github.com/${GITHUB_REPOSITORY}.git | |
composer require bloomreach/bloomreach-engagement-connector-magento:dev-${GITHUB_HEAD_REF} | |
composer install --dev | |
# Copy config file for integrations tests | |
- name: Setup - Copy `install-config-mysql` file | |
run: cp ./vendor/bloomreach/bloomreach-engagement-connector-magento/.github/config/mysql-config.php ./dev/tests/integration/etc/install-config-mysql.php | |
# Run tests | |
- name: Test - Magento Coding Standart | |
if: always() | |
run: ./vendor/bin/phpcs --standard=Magento2 vendor/bloomreach/bloomreach-engagement-connector-magento | |
- name: Test - Magento 2 PHP Mess Detector | |
if: always() | |
run: ./vendor/bin/phpmd vendor/bloomreach/bloomreach-engagement-connector-magento text dev/tests/static/testsuite/Magento/Test/Php/_files/phpmd/ruleset.xml | |
- name: Test - Magento Integrations | |
if: always() | |
run: cd dev/tests/integration && ../../../vendor/bin/phpunit ../../../vendor/bloomreach/bloomreach-engagement-connector-magento/Test/Integration |