Skip to content

Commit

Permalink
Merge pull request #1 from szepeviktor/patch-2
Browse files Browse the repository at this point in the history
Patch 2
  • Loading branch information
szepeviktor authored Apr 26, 2024
2 parents 231e92f + 2286cee commit 912fda7
Show file tree
Hide file tree
Showing 94 changed files with 5,651 additions and 1,542 deletions.
14 changes: 14 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

A bug report generally means something is not being prefixed that should, or, less commonly, something is being prefixed that should not.

Please provide a minimal `composer.json` with the package that is affected and its precise version.

Please specify an affected file and state clearly the actual (problem) output and the expected output.
6 changes: 3 additions & 3 deletions .github/coverage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 17 additions & 21 deletions .github/workflows/codecoverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ jobs:

steps:

- name: Git checkout
uses: actions/checkout@v2
- name: Checkout repository
uses: actions/checkout@v4

- name: Install PHP
uses: shivammathur/setup-php@v2
Expand All @@ -34,48 +34,44 @@ jobs:
coverage: xdebug

- name: Checkout GitHub Pages branch for code coverage report
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
ref: gh-pages
path: tests/reports/html

- name: Install dependencies
run: composer install --prefer-dist --no-suggest --no-progress
run: composer update --prefer-dist --no-progress

- name: Clear previous code coverage
working-directory: tests/reports/html
run: |
cd tests/reports/html
rm -rf *
cd ../../..
- name: Run tests with code coverage
run: XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-text --coverage-clover tests/reports/clover.xml --coverage-html tests/reports/html
- name: Generate code coverage
run: XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-text --coverage-clover tests/reports/clover.xml --coverage-html tests/reports/html

- name: Edit phpcov html output to work with gh-pages
- name: Add code coverage output to gh-pages
working-directory: tests/reports/html
run: |
cd tests/reports/html
mv _css css; find . -depth -name '*.html' -exec sed -i "s/_css\//css\//" {} +
mv _icons icons; find . -depth -name '*.html' -exec sed -i "s/_icons\//icons\//" {} +
mv _js js; find . -depth -name '*.html' -exec sed -i "s/_js\//js\//" {} +
git add *
cd ../../..
touch .nojekyll
git add -- .nojekyll *
- name: Commit code coverage to gh-pages
uses: stefanzweifel/git-auto-commit-action@v4.1.1
uses: stefanzweifel/git-auto-commit-action@v5
with:
repository: tests/reports/html
branch: gh-pages
commit_message: "🤖 Commit code coverage to gh-pages"
commit_options:
commit_message: "🤖 Update code coverage to gh-pages"
commit_options: ""
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
GITHUB_TOKEN: "${{ github.token }}"

- name: Update README badge
run: vendor/bin/php-coverage-badger tests/reports/clover.xml .github/coverage.svg

- name: Commit code coverage badge
uses: stefanzweifel/git-auto-commit-action@v4.1.1
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "🤖 Commit code coverage badge"
commit_message: "🤖 Update code coverage badge"


23 changes: 13 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,37 @@ on:

jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
php: ['7.4', '8.0']
name: PHP ${{ matrix.php }} tests
php: ['7.4', '8.0', '8.1', '8.2', '8.3']
os: [ubuntu-latest, windows-latest]
fail-fast: false
name: PHP tests ${{ matrix.php }} ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: fileinfo
- name: Debugging
run: |
php --version
php -m
composer --version
- name: Install dependencies
run: composer install --prefer-dist --no-suggest --no-progress
run: composer install --prefer-dist --no-progress
- name: Run tests
run: vendor/bin/phpunit --printer mheap\\GithubActionsReporter\\Printer
run: vendor/bin/phpunit
# TODO: get GitHub Actions annotations working again.
# run: vendor/bin/phpunit --printer mheap\\GithubActionsReporter\\Printer
lint:
runs-on: ubuntu-latest
name: Lint project files
steps:

- uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
- uses: actions/checkout@v3

- name: Install PHP
uses: shivammathur/setup-php@v2
Expand All @@ -52,7 +55,7 @@ jobs:
composer --version
- name: Install dependencies
run: composer install --prefer-dist --no-suggest --no-progress
run: composer install --prefer-dist --no-progress

- name: Run validate
run: |
Expand Down
51 changes: 35 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,24 @@ jobs:
php-version: 7.4

- name: Install dependencies
run: composer install --no-dev --prefer-dist --no-suggest --no-progress
run: composer install --no-dev --prefer-dist --no-progress

- name: "Edit `strauss/bin/strauss` to update the version number"
env:
CURRENT_RELEASE: ${{ github.event.release.tag_name }}
run: |
find bin -name 'strauss' -exec sed -i "s/}, '[[:digit:]]*\.[[:digit:]]*\.[[:digit:]]*');/}, '$CURRENT_RELEASE');/" {} +
- name: Commit updated README.md
uses: stefanzweifel/[email protected]
with:
branch: master
file_pattern: "bin/strauss"
commit_message: "🤖 Update version number in bin"

- name: Create .phar
run: |
wget -O phar-composer.phar https://github.com/clue/phar-composer/releases/download/v1.2.0/phar-composer-1.2.0.phar
wget -O phar-composer.phar https://github.com/clue/phar-composer/releases/download/v1.4.0/phar-composer-1.4.0.phar
mkdir build
mv vendor build/vendor
mv src build/src
Expand All @@ -35,22 +48,28 @@ jobs:
- name: Test run strauss
run: php strauss.phar --version

- uses: meeDamian/[email protected]
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
files: strauss.phar
gzip: false
allow_override: true
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.PASSPHRASE }}

- name: Edit README.md to update the version number
env:
CURRENT_RELEASE: ${{ github.event.release.tag_name }}
- name: Sign the PHAR
run: |
find . -name 'README.md' -exec sed -i "s/download\/[^\/]*/download\/$CURRENT_RELEASE/" {} +
ls strauss.phar
gpg --local-user [email protected] \
--batch \
--yes \
--passphrase="${{ secrets.PASSPHRASE }}" \
--detach-sign \
--output strauss.phar.asc \
strauss.phar
- name: Commit updated README.md
uses: stefanzweifel/[email protected]
- uses: meeDamian/[email protected]
with:
branch: master
file_pattern: "README.md"
commit_message: "🤖 Update version number in README.md"
token: ${{ secrets.GITHUB_TOKEN }}
files: |
strauss.phar
strauss.phar.asc
gzip: false
allow_override: true
39 changes: 39 additions & 0 deletions .github/workflows/updateversionfromchangelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# When a new version number is added to the changelog, update the bin.

name: Update version from changelog

on:
push:
branches:
- master
paths:
- "CHANGELOG.md"


jobs:
update-version:
name: "Create Strauss phar on new release"
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: "Checkout repository"
uses: actions/checkout@v4
with:
ref: master

- name: "Update version number in `bin/strauss`"
run: |
CURRENT_RELEASE="$(sed -n -e '0,/^## \([0-9.]\+\).*$/ s//\1/p' CHANGELOG.md)"
test -n "${CURRENT_RELEASE}"
sed -i -e "s/^}, '[0-9.]\\+');\$/}, '${CURRENT_RELEASE}');/" bin/strauss
- name: "Commit `bin/strauss` changes"
run: |
if git diff --quiet; then
echo "No changes."
exit 0
fi
git add -- bin/strauss
git commit -m "🤖 Update version number in bin"
git push
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ scratch
pcov.sh
xdebug.sh
7.4linux.sh
scripts/builtins.php
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Change Log

## 0.18.0 April 2024



## 0.14.0 07-March-2023

* Merge `in-situ` branch (bugs expected)
* Add: `delete_vendor_packages` option (`delete_vendor_files` is maybe deprecated now)
* Add: GPG .phar signing for Phive
* Breaking: Stop excluding `psr/*` from `file_patterns` prefixing
Loading

0 comments on commit 912fda7

Please sign in to comment.