Skip to content

Commit

Permalink
Merge pull request #6 from cristiano-pacheco/feature/#5-add-pipeline
Browse files Browse the repository at this point in the history
Feature/#5 add pipeline
  • Loading branch information
DavidLambauer authored Jun 13, 2023
2 parents 21c78e6 + 04b0599 commit 48fea17
Show file tree
Hide file tree
Showing 135 changed files with 12,010 additions and 131 deletions.
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
39 changes: 33 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"name": "run_as_root/ext-magento2-google-shopping-feed",
"version": "1.0.0",
"description": "This module provides a google shopping product feed csv export.",
"type": "magento2-module",
"license": "MIT",
"version": "1.0.0",
"require": {
"magento/framework": "*",
"magento/module-store": "*",
Expand All @@ -17,17 +18,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

0 comments on commit 48fea17

Please sign in to comment.