Skip to content

Commit d481a55

Browse files
authored
Merge v19 -> v20
2 parents 61f1a22 + 7d2e310 commit d481a55

File tree

8,346 files changed

+47096
-42156
lines changed

Some content is hidden

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

8,346 files changed

+47096
-42156
lines changed

.github/phpstan-baseline.neon

Lines changed: 2527 additions & 783 deletions
Large diffs are not rendered by default.

.github/phpstan.neon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ parameters:
4545
# Too much noise from "Variable $this might not be defined"
4646
- */app/code/core/*/*/data/*
4747
- */app/code/core/*/*/sql/*
48-
level: 2
48+
level: 3
4949
checkFunctionNameCase: true
5050
checkInternalClassCaseSensitivity: true
5151

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
includes:
22
- phpstan.neon
33
parameters:
4-
level: 3
4+
paths:
5+
- %currentWorkingDirectory%/app/code/core/Mage
6+
- %currentWorkingDirectory%/lib/Mage
7+
- %currentWorkingDirectory%/lib/Magento
8+
- %currentWorkingDirectory%/lib/Varien
9+
level: 4

.github/workflows/labeler.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111

1212
jobs:
1313
triage:
14-
runs-on: ubuntu-latest
14+
runs-on: [ubuntu-latest]
1515
steps:
1616
- uses: actions/labeler@main
1717
with:

.github/workflows/phpstan.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: "PHPStan Static Code Analyses"
2+
3+
on:
4+
# Run on all pushes and on all pull requests.
5+
# Prevent the build from running when there are only irrelevant changes.
6+
push:
7+
paths:
8+
- '**.php'
9+
pull_request:
10+
paths:
11+
- '**.php'
12+
# Allow manually triggering the workflow.
13+
workflow_dispatch:
14+
15+
jobs:
16+
php_stan:
17+
runs-on: [ubuntu-latest]
18+
19+
strategy:
20+
matrix:
21+
config_files: [
22+
'.github/phpstan.neon',
23+
'.github/phpstan_experimental_level.neon'
24+
]
25+
26+
name: PHP Stan ${{ matrix.config_files }}
27+
28+
steps:
29+
- name: Checkout code
30+
uses: actions/checkout@v3
31+
32+
- name: Validate composer
33+
run: composer validate --strict
34+
35+
- name: Get composer cache directory
36+
id: composer-cache
37+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
38+
39+
- name: Cache dependencies
40+
uses: actions/cache@v2
41+
with:
42+
path: ${{ steps.composer-cache.outputs.dir }}
43+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
44+
restore-keys: ${{ runner.os }}-composer-
45+
46+
- name: Install dependencies
47+
run: composer install --prefer-dist --no-progress --ignore-platform-req=ext-*
48+
49+
- name: ensure existance of ./app/code/local
50+
run: mkdir -p app/code/local
51+
52+
- name: PHPStan Static Analysis
53+
run: php vendor/bin/phpstan.phar analyze -c ${{ matrix.config_files }}
54+
continue-on-error: ${{ matrix.config_files == '.github/phpstan_experimental_level.neon' }}

.github/workflows/unit-tests.yml renamed to .github/workflows/phpunit.yml

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,40 @@
11
name: OpenMage LTS - Unit Tests
22

33
on:
4+
# Run on all pushes and on all pull requests.
5+
# Prevent the build from running when there are only irrelevant changes.
46
push:
7+
paths:
8+
- '**.php'
59
pull_request:
10+
paths:
11+
- '**.php'
12+
# Allow manually triggering the workflow.
13+
workflow_dispatch:
614

715
jobs:
816
unit-tests:
9-
10-
runs-on: ubuntu-latest
17+
runs-on: [ubuntu-latest]
1118

1219
steps:
1320
- uses: actions/checkout@v3
1421
with:
1522
repository: OpenMage/Testfield
1623
path: ./
1724

18-
- name: php & Composer version
19-
run: php --version && composer --version
25+
- name: Validate composer
26+
run: composer validate
27+
28+
- name: Get composer cache directory
29+
id: composer-cache
30+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
31+
32+
- name: Cache dependencies
33+
uses: actions/cache@v2
34+
with:
35+
path: ${{ steps.composer-cache.outputs.dir }}
36+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
37+
restore-keys: ${{ runner.os }}-composer-
2038

2139
- name: Install dependencies
2240
run: composer install --prefer-dist --no-progress --ignore-platform-reqs

.github/workflows/security-php.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: "PHP Security Check"
2+
3+
on:
4+
# Run automatically every Monday on midnight.
5+
schedule:
6+
- cron: '0 0 * * 1'
7+
# Run on pull requests only when composer.lock has changed.
8+
pull_request:
9+
paths:
10+
- 'composer.lock'
11+
# Allow manually triggering the workflow.
12+
workflow_dispatch:
13+
14+
jobs:
15+
check:
16+
runs-on: [ubuntu-latest]
17+
18+
steps:
19+
- uses: actions/checkout@v3
20+
21+
- uses: actions/cache@v2
22+
id: cache-db
23+
with:
24+
path: ~/.symfony/cache
25+
key: db
26+
27+
- uses: symfonycorp/security-checker-action@v4

.github/workflows/sonar.yml

Lines changed: 34 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,61 @@
11
name: OpenMage LTS - Sonar - Full Analyses
22

33
on:
4+
# Run on all pushes and on all pull requests.
5+
# Prevent the build from running when there are only irrelevant changes.
46
push:
7+
paths-ignore:
8+
- '**.md'
59
pull_request:
10+
paths-ignore:
11+
- '**.md'
612
types: [opened, synchronize, reopened]
713

8-
9-
1014
jobs:
1115
unit:
12-
name: Unit Tests on ${{ matrix.php-versions }}
13-
runs-on: ${{ matrix.operating-system }}
16+
name: Unit Tests on ${{ matrix.php }}
17+
runs-on: ${{ matrix.os }}
1418
strategy:
1519
max-parallel: 5
1620
matrix:
17-
operating-system: [ubuntu-latest]
18-
php-versions: ['7.4', '8.1']
21+
os: [ubuntu-latest]
22+
php: ['7.4', '8.1']
1923
steps:
2024
- uses: actions/checkout@v3
2125
- name: Setup PHP
2226
uses: shivammathur/setup-php@v2
2327
with:
24-
php-version: ${{ matrix.php-versions }}
28+
php-version: ${{ matrix.php }}
2529
extensions: mbstring
2630
tools: composer, pecl, phpcs, phpstan, phpunit:9.5
27-
ini-values-csv: pcov.directory=api, post_max_size=256M, short_open_tag=On #optional, setup php.ini configuration
31+
ini-values: pcov.directory=api, post_max_size=256M, short_open_tag=On #optional, setup php.ini configuration
2832
coverage: pcov #optional, setup coverage driver
2933
env:
3034
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31-
- name: Prepare
32-
run: |
33-
php -v
34-
composer --version
35-
composer install --dev -n --prefer-source --ignore-platform-req=php
35+
36+
- name: Validate composer
37+
run: composer validate --strict
38+
39+
- name: Get composer cache directory
40+
id: composer-cache
41+
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
42+
43+
- name: Cache dependencies
44+
uses: actions/cache@v2
45+
with:
46+
path: ${{ steps.composer-cache.outputs.dir }}
47+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
48+
restore-keys: ${{ runner.os }}-composer-
49+
50+
- name: Install dependencies
51+
run: composer install --dev -n --prefer-source --ignore-platform-req=php+
52+
3653
- name: Run Unit Tests
3754
run: phpunit --configuration ./dev/phpunit.xml.dist --testsuite=Unit;
55+
3856
- name: prepare SonarCloud Scan Data
3957
continue-on-error: true
40-
if: ${{ matrix.php-versions == '8.1' }}
58+
if: ${{ matrix.php == '8.1' }}
4159
run: |
4260
echo $PWD
4361
ls -la
@@ -46,10 +64,11 @@ jobs:
4664
sed -i 's@'$GITHUB_WORKSPACE'/@/github/workspace/@g' ./dev/tests/clover.xml
4765
head ./dev/tests/clover.xml
4866
ls -la
67+
4968
- name: SonarCloud Scan
5069
uses: SonarSource/sonarcloud-github-action@master
5170
continue-on-error: true
52-
if: ${{ matrix.php-versions == '8.1' }} && SONAR_TOKEN
71+
if: ${{ matrix.php == '8.1' }} && SONAR_TOKEN
5372
with:
5473
args: >
5574
-Dproject.settings=dev/sonar-project.properties

.github/workflows/static-code-analyses.yml

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

0 commit comments

Comments
 (0)