-
Notifications
You must be signed in to change notification settings - Fork 13
Add tests and GitHub actions #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
9e74cc9
Use autoload on tests
duboism edae6bc
Remove PHPUnit from dev requirements as it's not required
duboism 0c8f32d
Add GitHub actions
duboism 6779459
Only download and extract Verdana font
duboism a9af332
Group CI commands
duboism e13aa67
Exclude PHP 8 and above as the code is not compatible
duboism File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,69 @@ | ||
name: Main | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
- master | ||
- release/** | ||
pull_request: | ||
branches: | ||
- main | ||
- master | ||
- release/** | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
run: | ||
runs-on: ${{ matrix.operating-system }} | ||
strategy: | ||
matrix: | ||
operating-system: ['ubuntu-latest'] | ||
php-versions: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4'] | ||
steps: | ||
- name: Get source code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php-versions }} | ||
coverage: none | ||
ini-values: post_max_size=256M, max_execution_time=180 | ||
- name: Check package | ||
run: | | ||
sudo pear list | ||
sudo pear channel-update pear.php.net | ||
sudo pear upgrade --force pear/pear | ||
sudo pear list | ||
sudo pear install --force package.xml | ||
sudo pear list | ||
sudo pear package | ||
sudo pear package-validate | ||
sudo pear install --force *.tgz | ||
sudo pear list | ||
# For some reason ttf-mscorefonts-installer doesn't work | ||
# so we only install Verdana | ||
- name: Download and install Verdana font | ||
run: | | ||
sudo apt install cabextract | ||
curl -L -o verdan32.exe 'http://download.sourceforge.net/corefonts/verdan32.exe' | ||
cabextract -d Image/Canvas/Fonts/ verdan32.exe | ||
mv Image/Canvas/Fonts/Verdana.TTF Image/Canvas/Fonts/verdana.ttf | ||
- name: Install pre-requisites and run test scripts | ||
run: | | ||
composer install | ||
php tests/gradients.php > gradients.png | ||
php tests/imagemap.php > imagemap.html | ||
php tests/png.php | ||
php tests/jpg.php | ||
# php tests/ps.php | ||
# php tests/pdf.php | ||
php tests/svg.php | ||
php tests/text.php > text.png | ||
php tests/lineends.php > lineends.png |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't let this stop a merge now, but I'd prefer a more flexible approach here that doesn't force a composer installation before someone could run the testsuite. Just a simple existence check on the vendor autoload in order to require it, and fall back to the old PEAR-style require otherwise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good remark but I'm not sure I understand all the details of it. Just testing the existence of
vendor/autoload.php
would be enough ? Do you know a package that does that (so I can take inspiration from it) ?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.