forked from OpenMage/magento-lts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1,554 changed files
with
7,863 additions
and
4,908 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,19 @@ | ||
#!/bin/bash | ||
|
||
## Description: create local development directory | ||
## Usage: localdev | ||
## Example: ddev localdev <git-url> | ||
|
||
if [ ! -d ".localdev/" ] | ||
then | ||
mkdir ".localdev/" | ||
echo "Directory created." | ||
fi | ||
|
||
if ! grep -q "./.localdev/*" composer.json; then | ||
php vendor/bin/composer config repositories.local '{"type": "path", "url": "./.localdev/*", "canonical": false}' | ||
echo "Patched composer.json." | ||
fi | ||
|
||
cd ".localdev/" || exit | ||
git clone "$@" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,7 @@ | ||
#!/bin/bash | ||
|
||
## Description: run PHPUnit | ||
## Usage: phpunit | ||
## Example: ddev phpunit | ||
|
||
php vendor/bin/phpunit --no-coverage "$@" --testdox |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,9 @@ | ||
#!/bin/bash | ||
|
||
## Description: run PHPUnit with coverage | ||
## Usage: phpunit-coverage | ||
## Example: ddev phpunit-coverage | ||
|
||
enable_xdebug | ||
XDEBUG_MODE=coverage php vendor/bin/phpunit --testdox | ||
disable_xdebug |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,9 @@ | ||
#!/bin/bash | ||
|
||
## Description: run PHPUnit with local HTML coverage | ||
## Usage: phpunit-coverage-local | ||
## Example: ddev phpunit-coverage-local | ||
|
||
enable_xdebug | ||
XDEBUG_MODE=coverage php vendor/bin/phpunit --coverage-html build/coverage --testdox | ||
disable_xdebug |
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,16 10,39 @@ on: | |
|
||
jobs: | ||
unit-tests: | ||
runs-on: [ubuntu-latest] | ||
runs-on: ${{ matrix.operating-system }} | ||
strategy: | ||
matrix: | ||
operating-system: [ubuntu-latest] | ||
php-versions: ['7.4', '8.3'] | ||
mysql-version: ['5.7', '8.0'] | ||
|
||
services: | ||
mysql: | ||
image: mysql:${{ matrix.mysql-version }} | ||
env: | ||
MYSQL_ROOT_PASSWORD: root | ||
MYSQL_DATABASE: db | ||
ports: | ||
- 3306:3306 | ||
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Validate mysql service | ||
run: | | ||
echo "Checking mysql service" | ||
sudo apt-get install -y mysql-client | ||
mysql --host 127.0.0.1 --port ${{ job.services.mysql.ports['3306'] }} -uroot -proot -e "SHOW DATABASES" | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
repository: OpenMage/Testfield | ||
path: ./ | ||
php-version: ${{ matrix.php-versions }} | ||
coverage: pcov #optional, setup coverage driver | ||
env: | ||
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Validate composer | ||
run: composer validate | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Get composer cache directory | ||
id: composer-cache | ||
|
@@ -33,24 56,61 @@ jobs: | |
restore-keys: ${{ runner.os }}-composer- | ||
|
||
- name: Install dependencies | ||
run: composer install --prefer-dist --no-progress --ignore-platform-reqs | ||
|
||
- name: Checkout OpenMage repo | ||
uses: actions/checkout@v4 | ||
with: | ||
path: openmage | ||
run: composer install --prefer-dist --no-progress --ignore-platform-req=ext-* | ||
|
||
- name: Install OpenMage dependencies | ||
working-directory: ./openmage | ||
run: composer install --prefer-dist --no-progress --ignore-platform-reqs --no-dev | ||
- name: Install OpenMage | ||
run: | | ||
php -f install.php -- \ | ||
--license_agreement_accepted 'yes' \ | ||
--locale 'en_US' \ | ||
--timezone 'America/New_York' \ | ||
--db_host '127.0.0.1' \ | ||
--db_name 'db' \ | ||
--db_user 'root' \ | ||
--db_pass 'root' \ | ||
--db_prefix '' \ | ||
--url 'http://openmage.local' \ | ||
--use_rewrites 'yes' \ | ||
--use_secure 'yes' \ | ||
--secure_base_url 'http://openmage.local' \ | ||
--use_secure_admin 'yes' \ | ||
--admin_username 'admin' \ | ||
--admin_lastname 'Administrator' \ | ||
--admin_firstname 'OpenMage' \ | ||
--admin_email '[email protected]' \ | ||
--admin_password 'veryl0ngpassw0rd' \ | ||
--session_save 'files' \ | ||
--admin_frontname 'admin' \ | ||
--backend_frontname 'admin' \ | ||
--default_currency 'USD' \ | ||
--enable_charts 'yes' \ | ||
--skip_url_validation 'yes' | ||
- name: run phpUnit | ||
run: bash ./run_unit_tests.sh | ||
- name: Run phpUnit | ||
run: php -f vendor/bin/phpunit | ||
|
||
- name: Publish Unit Test Results | ||
uses: EnricoMi/publish-unit-test-result-action@v2.7 | ||
uses: EnricoMi/publish-unit-test-result-action@v2 | ||
if: always() | ||
continue-on-error: true | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
files: output/*.xml | ||
files: tests/logging/*.xml | ||
|
||
- name: prepare SonarCloud Scan Data | ||
if: ${{ (matrix.php-versions == '7.4') && (matrix.mysql-version == '5.7') }} | ||
run: | | ||
head tests/coverage/clover.xml | ||
sed -i 's@'$GITHUB_WORKSPACE'/@/github/workspace/@g' tests/logging/junit.xml | ||
sed -i 's@'$GITHUB_WORKSPACE'/@/github/workspace/@g' tests/coverage/clover.xml | ||
head ./tests/coverage/clover.xml | ||
- name: SonarCloud Scan | ||
uses: SonarSource/sonarcloud-github-action@master | ||
continue-on-error: true | ||
if: ${{ (matrix.php-versions == '7.4') && (matrix.mysql-version == '5.7') }} && SONAR_TOKEN | ||
with: | ||
args: > | ||
-Dproject.settings=tests/sonar-project.properties | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,37 @@ | ||
name: Rector | ||
|
||
on: | ||
workflow_call: | ||
# Allow manually triggering the workflow. | ||
workflow_dispatch: | ||
|
||
jobs: | ||
rector: | ||
name: Validation | ||
runs-on: [ubuntu-latest] | ||
|
||
steps: | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 7.4 | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Get composer cache directory | ||
id: composer-cache | ||
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: ${{ steps.composer-cache.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: ${{ runner.os }}-composer- | ||
|
||
- name: Install dependencies | ||
run: composer install --prefer-dist --no-progress --ignore-platform-req=ext-* | ||
|
||
- name: Rector | ||
run: php vendor/bin/rector process --dry-run |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.