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

PHPUnit 10 #408

Merged
merged 28 commits into from
Feb 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
00d1189
build: upgrade dom requirement and loosen version range
Jul 24, 2022
3fcbcb9
Merge branch 'master' of github.com:/PhpGt/DomTemplate
Aug 14, 2022
2a79afb
Merge branch 'master' of github.com:/PhpGt/DomTemplate
Aug 18, 2022
5d58fc4
docs: update examples
Aug 18, 2022
e3957a8
Merge branch 'master' of github.com:/PhpGt/DomTemplate
Aug 26, 2022
73d0b85
Merge branch 'master' of github.com:/PhpGt/DomTemplate
Sep 21, 2022
3cbb825
Merge branch 'master' of github.com:/PhpGt/DomTemplate
Oct 5, 2022
fadbba7
Merge branch 'master' of github.com:/PhpGt/DomTemplate
Oct 8, 2022
5403158
Merge branch 'master' of github.com:/PhpGt/DomTemplate
Oct 31, 2022
8dd04d1
build: update dependencies
Dec 18, 2022
224999b
Merge branch 'master' of github.com:/PhpGt/DomTemplate
Jan 10, 2023
3def753
Merge branch 'master' of github.com:/PhpGt/DomTemplate
Jan 17, 2023
3dbda21
feature: trim whitespace when there are only template children
Jan 17, 2023
a28c12c
Merge branch 'master' of github.com:/PhpGt/DomTemplate
Jan 17, 2023
da35c48
Merge branch 'master' of github.com:/PhpGt/DomTemplate
Jan 23, 2023
b2f8fa5
Merge branch 'master' of github.com:/PhpGt/DomTemplate
Jan 26, 2023
2f51576
Merge branch 'master' of github.com:/PhpGt/DomTemplate
Jan 30, 2023
9655705
Merge branch 'master' of github.com:/PhpGt/DomTemplate
Jan 31, 2023
7745df0
maintenance: phpstorm analysis improvements
Jan 31, 2023
5ab8d14
Merge branch 'master' of github.com:/PhpGt/DomTemplate
Feb 15, 2023
0c13109
Merge branch 'master' into deps
Feb 15, 2023
b55fbb3
build: upgrade to phpunit 10
Feb 15, 2023
01a1878
ci: upgrade phpunit
Feb 15, 2023
689eb55
ci: upgrade workflow
Feb 15, 2023
be4748d
ci: increase memory limit
Feb 15, 2023
ff087ba
ci: check variable is being set correctly
Feb 15, 2023
b3b1b00
tweak: remove error suppression
Feb 15, 2023
410dadd
ci: move to v3 phpstan
Feb 15, 2023
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
67 changes: 55 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
name: CI

on: [push, pull_request]
on: [push]

jobs:
composer:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Cache Composer dependencies
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: /tmp/composer-cache
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}

- name: Composer
- name: Composer install
uses: php-actions/composer@v6
with:
php_version: '8.1'
php_version: 8.1

- name: Archive build
run: mkdir /tmp/github-actions/ && tar -cvf /tmp/github-actions/build.tar ./

- name: Upload build archive for test runners
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: build-artifact
path: /tmp/github-actions
Expand All @@ -33,8 +33,11 @@ jobs:
runs-on: ubuntu-latest
needs: [composer]

outputs:
coverage: ${{ steps.store-coverage.outputs.coverage_text }}

steps:
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3
with:
name: build-artifact
path: /tmp/github-actions
Expand All @@ -44,18 +47,46 @@ jobs:

- name: PHP Unit tests
uses: php-actions/phpunit@v3
env:
XDEBUG_MODE: cover
with:
php_version: '8.1'
php_version: 8.1
php_extensions: xdebug
configuration: test/phpunit/phpunit.xml
bootstrap: vendor/autoload.php
coverage_text: _coverage/coverage.txt
coverage_clover: _coverage/clover.xml

- name: Store coverage data
uses: actions/upload-artifact@v3
with:
name: code-coverage
path: _coverage

coverage:
runs-on: ubuntu-latest
needs: [ phpunit ]

steps:
- uses: actions/checkout@v3

- uses: actions/download-artifact@v3
with:
name: code-coverage
path: _coverage

- name: Output coverage
run: cat "_coverage/coverage.txt"

- name: Upload to Codecov
uses: codecov/codecov-action@v3

phpstan:
runs-on: ubuntu-latest
needs: [composer]

steps:
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3
with:
name: build-artifact
path: /tmp/github-actions
Expand All @@ -66,7 +97,19 @@ jobs:
- name: PHP Static Analysis
uses: php-actions/phpstan@v3
with:
php_version: '8.1'
memory_limit: '2G'
path: src/
level: 6

remove_old_artifacts:
runs-on: ubuntu-latest

steps:
- name: Remove old artifacts for prior workflow runs on this repository
env:
GH_TOKEN: ${{ github.token }}
run: |
gh api "/repos/${{ github.repository }}/actions/artifacts?name=build-artifact" | jq ".artifacts[] | select(.name == \"build-artifact\") | .id" > artifact-id-list.txt
while read id
do
echo -n "Deleting artifact ID $id ... "
gh api --method DELETE /repos/${{ github.repository }}/actions/artifacts/$id && echo "Done"
done <artifact-id-list.txt
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
"require": {
"php": ">=8.1",
"ext-dom": "*",
"phpgt/dom": "^v4.0"
"phpgt/dom": "^4.0"
},
"require-dev": {
"phpstan/phpstan": "^v1.8",
"phpunit/phpunit": "^v9.5"
"phpstan/phpstan": "^1.8",
"phpunit/phpunit": "^10.0"
},

"autoload": {
Expand Down
Loading