Skip to content

Commit

Permalink
Merge branch 'main' into issue/683
Browse files Browse the repository at this point in the history
  • Loading branch information
LuigiPulcini committed Jan 16, 2025
2 parents a53322a + 2a94985 commit ef36a2f
Show file tree
Hide file tree
Showing 424 changed files with 32,093 additions and 27,210 deletions.
8 changes: 8 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
source .composer-root-version

export XDEBUG_MODE=off

use nix --packages \
gnumake

[[ -f .envrc.local ]] && source_env .envrc.local
11 changes: 7 additions & 4 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,27 @@
*.php text eol=lf

# Ignore all test and documentation with "export-ignore".
/.composer-root-version export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.styleci.yml export-ignore
/.travis.yml export-ignore
/.github/ export-ignore
/.php-cs-fixer.dist.php export-ignore
/.scrutinizer.yml export-ignore
/_specs/ export-ignore
/bin/infection.sh export-ignore
/box.json.dist export-ignore
/build/ export-ignore
/composer-root-version-checker/ export-ignore
/docs/ export-ignore
/Dockerfile export-ignore
/infection.json.dist export-ignore
/fixtures/ export-ignore
/.makefile/ export-ignore
/Makefile export-ignore
/phpstan.neo.dist export-ignore
/phpstan.neon.dist export-ignore
/phpunit.xml.dist export-ignore
/rector.php export-ignore
/scoper.inc.php export-ignore
/specs/ export-ignore
/tests/ export-ignore
/vendor-bin/ export-ignore
/phpunit.xml.dist export-ignore
13 changes: 7 additions & 6 deletions .github/ISSUE_TEMPLATE/Bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,15 @@ For general support, please use the #humbug Slack channel: https://symfony.com/s

<details>
<summary>scoper.inc.php</summary>

```php
<?php

declare(strict_types=1);

use Isolated\Symfony\Component\Finder\Finder;


/** @var Symfony\Component\Finder\Finder $finder */
$finder = Isolated\Symfony\Component\Finder\Finder::class;

return [
];

Expand All @@ -45,7 +46,7 @@ For general support, please use the #humbug Slack channel: https://symfony.com/s

<details>
<summary>Output</summary>

```bash
$ command
> output
Expand Down
25 changes: 25 additions & 0 deletions .github/actions/install-tool/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: 'Install a vendor-bin tool'

description: >
Install a tool installed via bamarni/composer-bin-plugin and runs the associated Makefile command to ensure the
target is up to date.
inputs:
vendor-bin-tool:
required: true
type: string
makefile-command:
required: true
type: string

runs:
using: composite
steps:
- name: Install PHP-CS-Fixer
uses: ramsey/composer-install@v2
with:
working-directory: 'vendor-bin/${{ inputs.vendor-bin-tool }}'

- name: Ensure PHP-CS-Fixer Makefile target is up to date
run: make ${{ inputs.makefile-command }}
shell: sh
25 changes: 25 additions & 0 deletions .github/actions/install-vendor/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: 'Install Composer dependencies'

description: >
Install the dependencies installed via Composer.
inputs:
dependency-versions:
description: The ramsey/composer-install dependency-versions used.
required: false
default: locked

runs:
using: composite
steps:
# https://docs.github.com/en/actions/learn-github-actions/workflow-commands-for-github-actions#setting-an-environment-variable
- name: Configure composer root version
run: |
. ./.composer-root-version
echo "COMPOSER_ROOT_VERSION=${COMPOSER_ROOT_VERSION}" >> $GITHUB_ENV
shell: sh

- name: Install Composer dependencies
uses: ramsey/composer-install@v2
with:
dependency-versions: ${{ inputs.dependency-versions }}
48 changes: 48 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
version: 2
updates:
- package-ecosystem: "composer"
directory: "."
schedule:
interval: "weekly"
groups:
dependencies:
patterns:
- "*"

- package-ecosystem: "composer"
directory: "."
schedule:
interval: "weekly"
groups:
jetbrains-phpstorm-stubs:
patterns:
- "jetbrains/phpstorm-stubs"
update-types:
- "major"

- package-ecosystem: "composer"
directory: "vendor-bin/*/"
schedule:
interval: "weekly"
groups:
dependencies:
patterns:
- "*"

- package-ecosystem: "composer"
directory: "composer-root-version-checker"
schedule:
interval: "weekly"
groups:
dependencies:
patterns:
- "*"

- package-ecosystem: "github-actions"
directory: ".github/workflows"
schedule:
interval: "weekly"
groups:
dependencies:
patterns:
- "*"
74 changes: 57 additions & 17 deletions .github/workflows/composer-root-version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,32 +24,24 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.2'
tools: composer
coverage: none

# https://docs.github.com/en/actions/learn-github-actions/workflow-commands-for-github-actions#setting-an-environment-variable
- name: Configure composer root version
run: |
source .composer-root-version
echo "COMPOSER_ROOT_VERSION=${COMPOSER_ROOT_VERSION}" >> $GITHUB_ENV
- name: Install the Composer (root) dependencies
uses: ramsey/composer-install@v2
- name: Install Composer dependencies
uses: ./.github/actions/install-vendor

- name: Ensure that the root dependencies are updated correctly
run: make vendor_install

- name: Install PHP-CS-Fixer
uses: ramsey/composer-install@v2
uses: ./.github/actions/install-tool
with:
working-directory: 'vendor-bin/php-cs-fixer'

- name: Ensure that PHP-CS-Fixer dependencies are updated correctly
run: make php_cs_fixer_install
vendor-bin-tool: php-cs-fixer
makefile-command: php_cs_fixer_install

- name: Install the Composer dependencies
uses: ramsey/composer-install@v2
uses: ramsey/composer-install@v3
with:
working-directory: 'composer-root-version-checker'

Expand All @@ -62,7 +54,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [ '8.1', '8.2' ]
php: [ '8.3' ]

steps:
- name: Checkout
Expand All @@ -75,7 +67,7 @@ jobs:
tools: composer

- name: Install the Composer dependencies
uses: ramsey/composer-install@v2
uses: ramsey/composer-install@v3
with:
working-directory: 'composer-root-version-checker'

Expand All @@ -100,3 +92,51 @@ jobs:
- name: Failing run
if: ${{ contains(needs.*.result, 'failure') }}
run: exit 1

update-composer-root-version:
name: Update the Composer root version
if: ${{ github.repository == 'humbug/php-scoper' && github.ref_name == 'main' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
fetch-depth: '0' # Ensures the tags are fetched
token: ${{ secrets.GITHUB_TOKEN }}

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
tools: composer
coverage: none

- name: Install the Composer dependencies
uses: ramsey/composer-install@v3
with:
working-directory: 'composer-root-version-checker'

- name: Dump the Composer too version
working-directory: composer-root-version-checker
run: make dump_root_version

- name: Check for changes
run: |
if git diff --exit-code; then
echo "🟢 No change detected."
echo "composer_root_version_changed=false" >> $GITHUB_ENV
else
echo "composer_root_version_changed=true" >> $GITHUB_ENV
fi
- name: Create Pull Request
if: env.composer_root_version_changed == 'true'
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch-suffix: random
delete-branch: true
title: "build: Update the Composer root version"
committer: "php-scoper-bot <[email protected]>"
commit-message: "Update the Composer root version"
Loading

0 comments on commit ef36a2f

Please sign in to comment.