Skip to content

Commit db94516

Browse files
authored
Merge pull request PrestaShop#83 from PrestaShop/dev
Release v2.7.0
2 parents 3908c6c + 237a667 commit db94516

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+2435
-482
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ https://devdocs.prestashop.com/1.7/contribute/contribution-guidelines/#pull-requ
1313
| Type? | bug fix / improvement / new feature / refacto / critical
1414
| BC breaks? | yes / no
1515
| Deprecations? | yes / no
16-
| Fixed ticket? | Fixes PrestaShop/Prestashop#{issue number here}.
16+
| Fixed ticket? | Fixes PrestaShop/PrestaShop#{issue number here}.
1717
| How to test? | Please indicate how to best verify that this PR is correct.
1818

1919
<!-- Click the form's "Preview" button to make sure the table is functional in GitHub. Thank you! -->
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Build
2+
on: [push, pull_request]
3+
4+
jobs:
5+
deploy:
6+
name: build dependencies & create artifact
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout
10+
uses: actions/[email protected]
11+
- name: Install composer dependencies
12+
run: composer install --no-dev -o
13+
- name: Clean-up project
14+
uses: PrestaShopCorp/[email protected]
15+
- name: Prepare auto-index tool
16+
run: composer global require prestashop/autoindex
17+
- name: Generate index.php
18+
run: ~/.composer/vendor/bin/autoindex
19+
- name: Create & upload artifact
20+
uses: actions/upload-artifact@v1
21+
with:
22+
name: ${{ github.event.repository.name }}
23+
path: ../
24+
update_release_draft:
25+
runs-on: ubuntu-latest
26+
needs: [deploy]
27+
if: github.event_name == 'push' && github.event.ref == 'refs/heads/master'
28+
steps:
29+
- name: Download artifact
30+
uses: actions/download-artifact@v1
31+
with:
32+
name: ${{ github.event.repository.name }}
33+
- id: release_info
34+
uses: toolmantim/release-drafter@v5
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
- name: Prepare for Release
38+
run: |
39+
cd ${{ github.event.repository.name }}
40+
zip -r ${{ github.event.repository.name }}.zip ${{ github.event.repository.name }}
41+
- name: Clean existing assets
42+
shell: bash
43+
run: |
44+
curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.1
45+
assets=`bin/hub api -t repos/${{ github.repository }}/releases/${{ steps.release_info.outputs.id }}/assets | awk '/\].url/ { print $2 }'`
46+
for asset in $assets
47+
do
48+
bin/hub api -X DELETE $asset
49+
done
50+
env:
51+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52+
- name: Publish to GitHub Release
53+
uses: actions/[email protected]
54+
env:
55+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56+
with:
57+
upload_url: ${{ steps.release_info.outputs.upload_url }}
58+
asset_path: ./${{ github.event.repository.name }}/${{ github.event.repository.name }}.zip
59+
asset_name: ${{ github.event.repository.name }}.zip
60+
asset_content_type: application/zip

.github/workflows/php.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: PHP tests
2+
on: [push, pull_request]
3+
jobs:
4+
# Check there is no syntax errors in the project
5+
php-linter:
6+
name: PHP Syntax check
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout
10+
uses: actions/[email protected]
11+
12+
- name: PHP syntax checker 5.6
13+
uses: prestashop/github-action-php-lint/5.6@master
14+
15+
- name: PHP syntax checker 7.2
16+
uses: prestashop/github-action-php-lint/7.2@master
17+
18+
- name: PHP syntax checker 7.3
19+
uses: prestashop/github-action-php-lint/7.3@master
20+
21+
- name: PHP syntax checker 7.4
22+
uses: prestashop/github-action-php-lint/7.4@master
23+
24+
# Check the PHP code follow the coding standards
25+
php-cs-fixer:
26+
name: PHP-CS-Fixer
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: Setup PHP
30+
uses: shivammathur/setup-php@v2
31+
with:
32+
php-version: '7.4'
33+
34+
- name: Checkout
35+
uses: actions/[email protected]
36+
37+
- name: Cache dependencies
38+
uses: actions/cache@v2
39+
with:
40+
path: vendor
41+
key: php-${{ hashFiles('composer.lock') }}
42+
43+
- name: Install dependencies
44+
run: composer install
45+
46+
- name: Run PHP-CS-Fixer
47+
run: ./vendor/bin/php-cs-fixer fix --dry-run --diff --using-cache=no --diff-format udiff
48+
49+
# Run PHPStan against the module and a PrestaShop release
50+
phpstan:
51+
name: PHPStan
52+
runs-on: ubuntu-latest
53+
strategy:
54+
matrix:
55+
presta-versions: ['1.7.1.2', '1.7.2.5', '1.7.3.4', '1.7.4.4', '1.7.5.1', '1.7.6.9', '1.7.7.3', 'latest']
56+
steps:
57+
- name: Setup PHP
58+
uses: shivammathur/setup-php@v2
59+
with:
60+
php-version: '7.4'
61+
62+
- name: Checkout
63+
uses: actions/[email protected]
64+
65+
# Add vendor folder in cache to make next builds faster
66+
- name: Cache vendor folder
67+
uses: actions/cache@v1
68+
with:
69+
path: vendor
70+
key: php-${{ hashFiles('composer.lock') }}
71+
72+
# Add composer local folder in cache to make next builds faster
73+
- name: Cache composer folder
74+
uses: actions/cache@v1
75+
with:
76+
path: ~/.composer/cache
77+
key: php-composer-cache
78+
79+
- run: composer install
80+
81+
# Docker images prestashop/prestashop may be used, even if the shop remains uninstalled
82+
- name: Execute PHPStan on PrestaShop (Tag ${{ matrix.presta-versions }})
83+
run: ./tests/phpstan.sh ${{ matrix.presta-versions }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/config_*.xml
22
/translations/*.php
33
/vendor
4+
/.php_cs.cache

.php_cs.dist

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
$config = new PrestaShop\CodingStandards\CsFixer\Config();
4+
5+
$config
6+
->setUsingCache(true)
7+
->getFinder()
8+
->in(__DIR__)
9+
->exclude('vendor');
10+
11+
return $config;

.travis.yml

Lines changed: 0 additions & 69 deletions
This file was deleted.

composer.json

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,17 @@
1212
"require": {
1313
"php": ">=5.4"
1414
},
15+
"require-dev": {
16+
"prestashop/php-dev-tools": "^3.4"
17+
},
1518
"config": {
16-
"preferred-install": "dist"
19+
"preferred-install": "dist",
20+
"prepend-autoloader": false
1721
},
18-
"type": "prestashop-module"
22+
"type": "prestashop-module",
23+
"autoload": {
24+
"classmap": [
25+
"ps_emailsubscription.php"
26+
]
27+
}
1928
}

0 commit comments

Comments
 (0)