Skip to content
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

Remove Travis CI and add GitHub workflows CI #167

Merged
merged 41 commits into from
Sep 16, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
32d00f6
Remove travis and add ci.yml
unfulvio Sep 14, 2022
b28d620
Update phpunit.xml and composer.json
unfulvio Sep 14, 2022
5a7be51
Update gh actions versions
unfulvio Sep 14, 2022
5ef2c5b
Add notes to ci.yml
unfulvio Sep 14, 2022
7382cdf
Remove redundant 7.3 from matrix
unfulvio-godaddy Sep 14, 2022
2f2f08b
Update .gitignore file
unfulvio-godaddy Sep 14, 2022
c062c8d
Update composer.json to disable platform check
unfulvio-godaddy Sep 14, 2022
cd11289
Fix covers tag errors
unfulvio-godaddy Sep 14, 2022
8289333
Toggle strict covers annotations
unfulvio-godaddy Sep 14, 2022
ee91113
Fix failing tests
unfulvio-godaddy Sep 14, 2022
682dc3f
Remove filter from phpunit config file
unfulvio-godaddy Sep 14, 2022
eb2fa85
Use expectExceptionMessageMatches
unfulvio-godaddy Sep 14, 2022
82d4ec6
Set platform to 7.1
unfulvio-godaddy Sep 14, 2022
65227f8
Bump requred php to 7.3
unfulvio-godaddy Sep 14, 2022
acdf53f
Try code coverage
unfulvio-godaddy Sep 15, 2022
486bb45
Try different filename for code coverage
unfulvio-godaddy Sep 15, 2022
2374a18
Try different filename without path for code coverage
unfulvio-godaddy Sep 15, 2022
29e43e6
Try ./coverage.xml
unfulvio-godaddy Sep 15, 2022
ba85e88
Use absolute path for coverage report
unfulvio-godaddy Sep 15, 2022
6d13dd0
Split php code coverage to different job
unfulvio-godaddy Sep 15, 2022
a94492b
Run coverage conditionally to 8.1
unfulvio-godaddy Sep 15, 2022
d520f17
output coverage.xml for debugging
unfulvio-godaddy Sep 15, 2022
d1a2306
Change output to cobertura format
unfulvio-godaddy Sep 15, 2022
a46ce89
Add Coverage PR comment
unfulvio-godaddy Sep 15, 2022
05fc2d5
Read only first line from code coverage in comment
unfulvio-godaddy Sep 15, 2022
a4dab3b
Try to output only the badge
unfulvio-godaddy Sep 15, 2022
11529f8
Remove runs on uses action step
unfulvio-godaddy Sep 15, 2022
9a9564b
Close expression in workflow
unfulvio-godaddy Sep 15, 2022
49bd9b7
Read first line from code coverage results
unfulvio-godaddy Sep 15, 2022
69221e7
Update ci.yml with path to code coverage result file
unfulvio-godaddy Sep 15, 2022
91232d5
Echo output in comment update
unfulvio-godaddy Sep 15, 2022
dd125f1
Write code coverage badge to file
unfulvio-godaddy Sep 15, 2022
b1e6db5
Update path to code coverage badge
unfulvio-godaddy Sep 15, 2022
1dd6a36
Debug code coverage results output
unfulvio-godaddy Sep 15, 2022
fff8939
Update step to output first line of coverage to badge
unfulvio-godaddy Sep 15, 2022
6d5eb6b
No need for quotes in path to code coverage badge
unfulvio-godaddy Sep 15, 2022
bbdd53a
Delete and recreate previous comment
unfulvio-godaddy Sep 15, 2022
88141ec
Try coveralls support
unfulvio-godaddy Sep 15, 2022
58828e0
Fix json path for coveralls
unfulvio-godaddy Sep 15, 2022
de8077e
ignore coveralls for now
unfulvio-godaddy Sep 15, 2022
fe08881
remove debug file
unfulvio-godaddy Sep 15, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Read only first line from code coverage in comment
  • Loading branch information
unfulvio-godaddy committed Sep 15, 2022
commit 05fc2d525b92a7e562b6371735285f8eae00227d
13 changes: 8 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
steps:
- uses: actions/checkout@7884fcad6b5d53d10323aee724dc68d8b9096a2e # v2.4.2

# TODO: replace with https://github.com/marketplace/actions/setup-php-action
- name: Switch to PHP ${{ env.PHP_VERSION }}
run: |
sudo update-alternatives --set php /usr/bin/php$PHP_VERSION
Expand Down Expand Up @@ -70,9 +71,9 @@ jobs:
# Tests should be run randomly to catch any test dependency issue.
run: |
vendor/bin/phpunit --order-by="random" --coverage-cache="$COVERAGE_CACHE_PATH" --coverage-cobertura=./coverage.xml --coverage-text
cat ./coverage.xml

- name: Generate code coverage summary
# https://github.com/irongut/CodeCoverageSummary
uses: irongut/CodeCoverageSummary@51cc3a756ddcd398d447c044c02cb6aa83fdae95 # v1.3.0
if: ${{ env.PHP_VERSION == '8.1' }}
with:
Expand All @@ -81,12 +82,14 @@ jobs:
format: markdown
fail_below_min: false
hide_branch_rate: false
hide_complexity: true
indicators: false
hide_complexity: false
indicators: true
output: both
- name: Add Coverage PR Comment

- name: Add comment to PR with coverage results
# https://github.com/marocchino/sticky-pull-request-comment
uses: marocchino/sticky-pull-request-comment@39c5b5dc7717447d0cba270cd115037d32d28443 # v2.2.0
if: ${{ env.PHP_VERSION == '8.1' && github.event_name == 'pull_request'}}
with:
recreate: true
path: code-coverage-results.md
message: ${{ read -r firstline<file code-coverage-results.md}}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ composer.lock

# Tests
.phpunit.cache
coverage.xml
phpunit.local.xml
.phpunit.local.xml
/html