forked from rvvup/magento-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce a pipeline workflow using Github Actions
- Loading branch information
1 parent
e36591c
commit 0385dd1
Showing
3 changed files
with
146 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: "Build Magento" | ||
description: "Build" | ||
inputs: | ||
php-version: | ||
description: 'PHP Version to use' | ||
required: true | ||
magento-version: | ||
description: 'Magento Version to use' | ||
required: true | ||
composer-version: | ||
description: 'Composer Version to use' | ||
required: false | ||
default: 'v2' | ||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ inputs.php-version }} | ||
tools: composer:${{ inputs.composer-version }} | ||
|
||
- if: "${{ inputs.composer-version == 'v2' }}" | ||
run: | | ||
composer config -g allow-plugins.laminas/* true | ||
composer config -g allow-plugins.magento/* true | ||
composer config -g allow-plugins.dealerdirect/phpcodesniffer-composer-installer true | ||
shell: bash | ||
|
||
- run: | | ||
composer config repositories.repo.magento.com composer https://repo.magento.com | ||
COMPOSER_MEMORY_LIMIT=-1 composer create-project --repository-url=https://repo.magento.com/ ${{ inputs.magento-version }} build | ||
cd build | ||
composer require rvvup/sdk | ||
cp ../CI/config.php app/etc/config.php | ||
mkdir -p app/code/Rvvup/Payments | ||
rsync -a --exclude=.gitignore --exclude=*.md --exclude=phpcs.xml --exclude=phpunit.xml --exclude=phpstan.neon --exclude=renovate.json --exclude=composer.json --exclude=.github/ --exclude=build/ --exclude=.git/ ../ app/code/Rvvup/Payments | ||
ls -la app/code/Rvvup/Payments | ||
php -d memory_limit=-1 bin/magento setup:di:compile | ||
php -d memory_limit=-1 bin/magento setup:static-content:deploy en_GB en_US --jobs=10 -f | ||
shell: bash |
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 |
---|---|---|
@@ -0,0 +1,104 @@ | ||
name: Workflow | ||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
pull_request: | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
jobs: | ||
php-stan: | ||
name: PHP Stan | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 7.4 | ||
|
||
- name: Configure | ||
run: composer config repositories.repo.magento.com composer https://repo.magento.com && composer config -g http-basic.repo.magento.com ${{ secrets.REPO_PUB_KEY }} ${{ secrets.REPO_SEC_KEY }} | ||
|
||
- name: Install dependencies | ||
run: composer install --no-ansi --no-interaction --no-progress --no-scripts | ||
|
||
- name: Run PHPStan | ||
run: ./vendor/bin/phpstan | ||
|
||
php-cs: | ||
name: PHP CS | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 7.4 | ||
|
||
- name: Configure | ||
run: composer config repositories.repo.magento.com composer https://repo.magento.com && composer config -g http-basic.repo.magento.com ${{ secrets.REPO_PUB_KEY }} ${{ secrets.REPO_SEC_KEY }} | ||
|
||
- name: Install dependencies | ||
run: composer install --no-ansi --no-interaction --no-progress --no-scripts | ||
|
||
- name: Run PHPCS | ||
run: ./vendor/bin/phpcs | ||
|
||
php-unit: | ||
name: PHP Unit | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 7.4 | ||
|
||
- name: Configure | ||
run: composer config repositories.repo.magento.com composer https://repo.magento.com && composer config -g http-basic.repo.magento.com ${{ secrets.REPO_PUB_KEY }} ${{ secrets.REPO_SEC_KEY }} | ||
|
||
- name: Install dependencies | ||
run: composer install --no-ansi --no-interaction --no-progress --no-scripts | ||
|
||
- name: Run PHPUnit | ||
run: ./vendor/bin/phpunit | ||
|
||
build-php74-magento-ce-237: | ||
name: Build (Magento Community 2.3.7-p3 w/ PHP 7.4) | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Configure | ||
run: composer config -g http-basic.repo.magento.com ${{ secrets.REPO_PUB_KEY }} ${{ secrets.REPO_SEC_KEY }} | ||
|
||
- name: Build | ||
uses: ./.github/actions/magento-build | ||
with: | ||
php-version: 7.4 | ||
magento-version: magento/project-community-edition:2.3.7-p3 | ||
|
||
build-php81-magento-ce-245: | ||
name: Build (Magento Community 2.4.5 w/ PHP 8.1) | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Configure | ||
run: composer config -g http-basic.repo.magento.com ${{ secrets.REPO_PUB_KEY }} ${{ secrets.REPO_SEC_KEY }} | ||
|
||
- name: Build | ||
uses: ./.github/actions/magento-build | ||
with: | ||
php-version: 8.1 | ||
magento-version: magento/project-community-edition:2.4.5 |
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