Skip to content

Commit

Permalink
Merge pull request #683 from lucatume/v4-test-v35-automated-build
Browse files Browse the repository at this point in the history
test(unit) remove use of PHPUnit functions from WPLoaderTest
  • Loading branch information
lucatume authored Dec 16, 2023
2 parents 017eac6 + 168a2c9 commit 7644333
Show file tree
Hide file tree
Showing 3 changed files with 218 additions and 187 deletions.
82 changes: 60 additions & 22 deletions .github/workflows/build-35.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,64 @@ jobs:
run: composer validate --no-interaction --strict
- name: Install dependencies
uses: ramsey/composer-install@v2
- name: "Check PSR-4 mapping"
run: "composer dump-autoload --no-interaction --optimize --strict-psr"
- name: "Require rector"
run: "composer require --dev rector/rector"
- name: Build v3.5
run: |
vendor/bin/rector --config=config/rector-35.php
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
- name: Check PSR-4 mapping"
run: composer dump-autoload --no-interaction --optimize --strict-psr
- name: Require rector
run: composer require --dev rector/rector
- name: Get changed files
id: changed-files
uses: yumemi-inc/changed-files@v3
with:
base: "v3.5"
token: ${{ secrets.V35_BUILD_TOKEN }}
commit-message: "v3.5 automated build change"
committer: "lucatume <luca@theaveragedev.com>"
branch: "v3.5-automated-build"
delete-branch: true
title: "v3.5 automated build"
body: "v3.5 automated build changes created by the v3.5 automated build workflow"
assignees: "lucatume"
add-paths: |
includes/*.php
src/*.php
tests/*.php
separator: " "
patterns: |
src/**/*.php
includes/**/*.php
tests/**/*.php
- name: Transpile to v3.5
run: |
vendor/bin/rector process --config=config/rector-35.php -- ${{ steps.changed-files.outputs.files }}
- name: Set up git credentials
run: |
git config --global user.name "Luca Tumedei"
git config --global user.email "luca@theaveragedev.com"
- name: Save changes to stash
run: |
git stash push --include-untracked -- 'src/*.php' 'includes/*.php' 'tests/*.php'
- name: Reset HEAD
run: |
git reset HEAD --hard
- name: Checkout v3.5 from origin
run: |
git fetch origin
git checkout v3.5
git pull origin v3.5
- name: Remove the v3.5-auto-build-from-v4 branch from origin if it exists
run: |
git push origin --delete v3.5-auto-build-from-v4 || true
- name: Create auto-build branch from v3.5
run: |
git checkout -B v3.5-auto-build-from-v4
git push origin v3.5-auto-build-from-v4
- name: Checkout the changed files from the HEAD branch
run: |
git checkout ${{ github.sha }} -- ${{ steps.changed-files.outputs.files }}
- name: Pop changes from stash and commit them
run: |
git stash pop || true
git add -- 'src/*.php' 'includes/*.php' 'tests/*.php'
git commit -m "v3.5 auto-build from v4"
- name: Push changes to v3.5-auto-build-from-v4
run: |
git push origin v3.5-auto-build-from-v4 --force
- name: Create Pull Request on v3.5
run: |
gh pr create \
--base v3.5 \
--draft \
--assignee lucatume \
--title "v4 -> v3.5 auto-build" \
--body "v3.5 automated build changes from v4" \
--label "auto-build" \
--label "v3.5"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"phpstan/extension-installer": "^1.3",
"phpstan/phpstan-symfony": "^1.3",
"squizlabs/php_codesniffer": "^3.7",
"rector/rector": "^0.18.5"
"rector/rector": "^0.18.12"
},
"autoload": {
"psr-4": {
Expand Down
Loading

0 comments on commit 7644333

Please sign in to comment.