Fix license headers #85
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: PHP tests | |
on: [push, pull_request] | |
jobs: | |
php-lint: | |
name: PHP Lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Run PHP 7.2 | |
uses: prestashop/github-action-php-lint/7.2@master | |
- name: Run PHP 7.3 | |
uses: prestashop/github-action-php-lint/7.3@master | |
- name: Run PHP 7.4 | |
uses: prestashop/github-action-php-lint/7.4@master | |
- name: Run PHP 8.0 | |
uses: prestashop/github-action-php-lint/8.0@master | |
- name: Run PHP 8.1 | |
uses: prestashop/github-action-php-lint/8.1@master | |
php-cs-fixer: | |
name: PHP-CS-Fixer | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup composer | |
uses: ./.github/actions/setup-composer | |
- name: Run PHP-CS-Fixer | |
run: | | |
cd ${{ github.workspace }} | |
./vendor/bin/php-cs-fixer --version | |
./vendor/bin/php-cs-fixer fix --dry-run --diff --config="tests/php/.php-cs-fixer.dist.php" | |
phpstan: | |
name: PHPStan | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
presta-versions: ["1.7.8.9", "8.0.0", "latest"] | |
steps: | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: '8.1' | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup composer | |
uses: ./.github/actions/setup-composer | |
- name: Cache PrestaShop source code | |
id: cache_prestashop_source | |
uses: actions/cache@v3 | |
with: | |
path: ${{ runner.temp }}/prestashop/ | |
key: ${{ runner.os }}-${{ matrix.presta-versions }} | |
- name: Get latest PrestaShop version | |
run: | | |
echo "LATEST_VERSION=$(curl -sL https://api.github.com/repos/PrestaShop/PrestaShop/releases/latest | jq -r ".tag_name")" >> $GITHUB_ENV | |
- name: Set PrestaShop version | |
run: | | |
echo "VERSION=$( \ | |
[[ ${{ matrix.presta-versions }} == "latest" ]] \ | |
&& echo "${{ env.LATEST_VERSION }}" \ | |
|| echo "${{ matrix.presta-versions }}" \ | |
)" >> $GITHUB_ENV | |
- name: Extract PrestaShop | |
if: steps.cache_prestashop_source.outputs.cache-hit != 'true' | |
run: | | |
echo "no cache for Prestashop ${{ env.VERSION }} source. Fectching and extracting source code..." | |
wget https://github.com/PrestaShop/PrestaShop/releases/download/${{ env.VERSION }}/prestashop_${{ env.VERSION }}.zip \ | |
--quiet --output-document ${{ runner.temp }}/prestashop.zip | |
unzip -q ${{ runner.temp }}/prestashop.zip -d ${{ runner.temp }}/prestashop_zip | |
unzip -q ${{ runner.temp }}/prestashop_zip/prestashop.zip -d ${{ runner.temp }}/prestashop | |
- name: Run PHPStan | |
run: _PS_ROOT_DIR_=${{ runner.temp }}/prestashop/ php ./vendor/bin/phpstan analyse --configuration=tests/php/phpstan_${{ matrix.presta-versions }}.dist.neon |