Skip to content

Commit

Permalink
Merge pull request #167 from spryker-sdk/feature/integrator-with-lock…
Browse files Browse the repository at this point in the history
…-file

Add composer.lock file to the project
  • Loading branch information
pavelmaksimov25 authored Dec 12, 2023
2 parents 322cd1a + adef20e commit 9597d9b
Show file tree
Hide file tree
Showing 4 changed files with 5,424 additions and 136 deletions.
164 changes: 34 additions & 130 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,49 +9,6 @@ on:

jobs:
validation:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
php-version: [
'7.4',
'8.2',
]
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: mbstring, intl, pdo_mysql

- name: Validate composer.json and composer.lock
run: composer validate

- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Composer cache
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Composer install
run: composer install --prefer-dist --no-interaction --optimize-autoloader

- name: Check PHP for syntax errors
run: find ./src -path src -prune -o -type f -name '*.php' -print0 | xargs -0 -n1 -P4 php -l -n | (! grep -v "No syntax errors detected" )

- name: PHPStan checks
run: composer stan

cs-check:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
Expand All @@ -70,6 +27,9 @@ jobs:
php-version: ${{ matrix.php-version }}
extensions: mbstring, intl, pdo_mysql

- name: Validate composer.json and composer.lock
run: composer validate

- name: Get Composer Cache Directory
id: composer-cache
run: |
Expand All @@ -83,99 +43,43 @@ jobs:
restore-keys: ${{ runner.os }}-composer-

- name: Composer install
run: composer install --prefer-dist --no-interaction --optimize-autoloader

- name: CodeStyle checks
run: composer cs-check

prefer-lowest:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
php-version: [
'7.4'
]
run: |
composer --version
if [[ ${{ matrix.php-version }} == '8.2' ]]; then
composer update laminas/laminas-servicemanager laminas/laminas-stdlib laminas/laminas-filter --prefer-stable --optimize-autoloader
else
composer install --prefer-dist --no-interaction --optimize-autoloader
fi
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Check PHP for syntax errors
run: find ./src -path src -prune -o -type f -name '*.php' -print0 | xargs -0 -n1 -P4 php -l -n | (! grep -v "No syntax errors detected" )

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: mbstring, intl, pdo_mysql
- name: PHPStan checks
run: composer stan

- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: CodeStyle checks
run: composer cs-check

- name: Composer cache
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Run tests
run: |
if [[ ${{ matrix.php-version }} == '7.4' ]]; then
XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-clover coverage.xml
else
composer test
fi
- name: Composer require spryker-sdk/composer-prefer-lowest package
run: composer require --dev spryker-sdk/composer-prefer-lowest
- name: Code Coverage Report
if: success() && matrix.php-version == '7.4'
uses: codecov/codecov-action@v1

- name: Composer prefer-lowest
run: composer update --prefer-dist --no-interaction --prefer-lowest --prefer-stable -o
- name: Composer require spryker-sdk/composer-prefer-lowest package
run: composer require --dev spryker-sdk/composer-prefer-lowest

- name: Check PHP for syntax errors
run: find ./src -path src -prune -o -type f -name '*.php' -print0 | xargs -0 -n1 -P4 php -l -n | (! grep -v "No syntax errors detected" )
- name: Composer prefer-lowest
run: composer update --prefer-dist --no-interaction --prefer-lowest --prefer-stable -o

- name: Validate prefer lowest
run: vendor/bin/validate-prefer-lowest -m
- name: Check PHP for syntax errors
run: find ./src -path src -prune -o -type f -name '*.php' -print0 | xargs -0 -n1 -P4 php -l -n | (! grep -v "No syntax errors detected" )

tests:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
php-version: [
'7.4',
'8.2',
]
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: mbstring, intl, pdo_mysql

- name: Validate composer.json and composer.lock
run: composer validate

- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Composer cache
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Composer install
run: composer install --prefer-dist --no-interaction --optimize-autoloader

- name: Run tests
run: |
if [[ ${{ matrix.php-version }} == '7.4' ]]; then
XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-clover coverage.xml
else
composer test
fi
- name: Code Coverage Report
if: success() && matrix.php-version == '7.4'
uses: codecov/codecov-action@v1
- name: Validate prefer lowest
run: vendor/bin/validate-prefer-lowest -m
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ nbproject/
# tooling
vendor/
!tests/_data/project_mock/vendor/
composer.lock
!tests/_data/project_mock/composer.lock
!tests/_data/composer/composer.lock
.phpunit.result.cache
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
"ext-simplexml": "*",
"composer-plugin-api": "^1.0.0 || ^2.0.0",
"aws/aws-sdk-php": "^3.257",
"composer/composer": "^2.1.0",
"composer/composer": "^2.6.0",
"czproject/git-php": "^4.1",
"guzzlehttp/guzzle": "^7.4",
"nikic/php-parser": "^4.3.0",
"nikic/php-parser": "^4.13.0",
"sebastian/diff": "^4.0.0",
"spryker-sdk/utils": "^0.1.2",
"symfony/console": "^5.3.0 || ^6.0",
"symfony/finder": "^5.3.0 || ^6.0",
"symfony/console": "^5.4 || ^6.0",
"symfony/finder": "^5.4 || ^6.0",
"symfony/process": "^5.4 || ^6.0"
},
"require-dev": {
Expand All @@ -26,7 +26,7 @@
"phpunit/phpunit": "^9.5.0",
"spryker-sdk/manifest-test-data-provider": "dev-master",
"spryker/code-sniffer": "0.17.18",
"symfony/filesystem": "^5.3.0 || ^6.0"
"symfony/filesystem": "^5.4 || ^6.0"
},
"autoload": {
"psr-4": {
Expand Down
Loading

0 comments on commit 9597d9b

Please sign in to comment.