Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/#5 add pipeline #6

Merged
merged 4 commits into from
Jun 13, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/actions/composer-cache/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: 'Cache Composer packages'
runs:
using: 'composite'
steps:
- id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ inputs.runner-os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ inputs.runner-os }}-php-
64 changes: 64 additions & 0 deletions .github/workflows/test_extension.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Test Extension

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

permissions:
contents: read

jobs:
validate-composer:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Validate composer.json and composer.lock
run: composer validate

build:

runs-on: ubuntu-latest

needs: validate-composer

steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/composer-cache

- name: Install dependencies
run: composer install --prefer-dist --no-progress

Static-tests:
runs-on: ubuntu-latest

needs: build

steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/composer-cache

- name: sniffer
run: composer sniffer

PHP-Unit:
runs-on: ubuntu-latest

needs: build

steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/composer-cache

- name: Setup PHP with Xdebug
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
coverage: xdebug

- name: PHP Unit
run: composer test
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
vendor
reports
.phpunit.result.cache
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
![build](https://github.com/run-as-root/Magento-2-Google-Shopping-Feed/actions/workflows/test_extension.yml/badge.svg)

## General

Generate feed with product data.
Expand Down
38 changes: 32 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "run_as_root/ext-magento2-google-shopping-feed",
"version": "1.0.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should extract that into a separate PR if this PR takes to long to merge as it fixes a different issue, isn't it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

"description": "This module provides a google shopping product feed csv export.",
"type": "magento2-module",
"license": "MIT",
"require": {
"magento/framework": "*",
"magento/module-store": "*",
Expand All @@ -17,17 +17,43 @@
"magento/module-directory": "*"
},
"require-dev": {
"phpunit/phpunit": "*"
"phpunit/phpunit": "~9.5.20",
"roave/security-advisories": "dev-latest",
"slevomat/coding-standard": "^8.12",
"squizlabs/php_codesniffer": "^3.7",
"magento/magento-coding-standard": "^31.0",
"sebastian/phpcpd": "^6.0",
"pdepend/pdepend": "^2.14"
},
"license": [
"MIT"
"repositories": [
{
"type": "composer",
"url": "https://mirror.mage-os.org/",
"only": [
"magento/*"
]
}
],
"autoload": {
"files": [
"registration.php"
"src/registration.php"
],
"psr-4": {
"RunAsRoot\\GoogleShoppingFeed\\": ""
"RunAsRoot\\GoogleShoppingFeed\\": "src"
}
},
"scripts": {
"post-install-cmd": [
"([ $COMPOSER_DEV_MODE -eq 0 ] || vendor/bin/phpcs --config-set installed_paths ../../slevomat/coding-standard,../../magento/magento-coding-standard/,../../phpcompatibility/php-compatibility)"
],
"test": "./vendor/bin/phpunit -c phpunit.xml",
"sniffer": "vendor/bin/phpcs --colors -p ./src --standard=phpcs-ruleset.xml",
"fix-style": "vendor/bin/phpcbf --colors -p ./src --standard=phpcs-ruleset.xml"
},
"config": {
"allow-plugins": {
"magento/composer-dependency-version-audit-plugin": true,
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
}
Loading