Skip to content

Commit 1d1479b

Browse files
authored
Execute tests with higest and lowest stable composer versions (#39)
- Updates PHPUnit to min ^9.5 - Render tests on higest and lowest stable composer versions
2 parents 11f9be8 + e928275 commit 1d1479b

File tree

2 files changed

+59
-11
lines changed

2 files changed

+59
-11
lines changed

.github/workflows/ci.yml

Lines changed: 57 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ concurrency:
1010
cancel-in-progress: true
1111

1212
jobs:
13-
validate-mergable:
13+
validate-master:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- name: "Checkout"
@@ -21,8 +21,8 @@ jobs:
2121
- name: "Validate Mergable"
2222
run: git merge origin/master --no-commit --ff-only
2323

24-
render-php:
25-
needs: validate-mergable
24+
phpunit-composer-latest:
25+
needs: validate-master
2626
runs-on: ${{ matrix.operating-system }}
2727

2828
strategy:
@@ -31,7 +31,6 @@ jobs:
3131
matrix:
3232
operating-system: ["ubuntu-latest"]
3333
php-versions: ["8.0", "8.1", "8.2"]
34-
phpunit-versions: ["latest"]
3534

3635
steps:
3736
- name: "Checkout"
@@ -46,7 +45,6 @@ jobs:
4645
extensions: mbstring, intl
4746
ini-values: post_max_size=256M, max_execution_time=180
4847
coverage: xdebug
49-
tools: phpunit:${{ matrix.phpunit-versions }}
5048

5149
- name: "Composer State"
5250
run: composer update --no-install --with-all-dependencies
@@ -62,8 +60,8 @@ jobs:
6260
uses: actions/cache@v3
6361
with:
6462
path: vendor
65-
key: composer-${{ steps.composer-hash.outputs.hash }}
66-
restore-keys: composer-${{ steps.composer-hash.outputs.hash }}
63+
key: composer-default-${{ steps.composer-hash.outputs.hash }}
64+
restore-keys: composer-default-${{ steps.composer-hash.outputs.hash }}
6765

6866
- name: "Install Dependencies"
6967
if: ${{ steps.cache-composer.outputs.cache-hit != 'true' }}
@@ -76,5 +74,55 @@ jobs:
7674
- name: "PHPUnit"
7775
run: ./vendor/bin/phpunit
7876

79-
- name: "Coverage"
80-
run: echo "$(cat ./.phpunit/coverage.txt)"
77+
phpunit-composer-lowest:
78+
needs: validate-master
79+
runs-on: ${{ matrix.operating-system }}
80+
81+
strategy:
82+
max-parallel: 3
83+
fail-fast: true
84+
matrix:
85+
operating-system: ["ubuntu-latest"]
86+
php-versions: ["8.0", "8.1", "8.2"]
87+
88+
steps:
89+
- name: "Checkout"
90+
uses: actions/checkout@v3
91+
with:
92+
fetch-depth: 0
93+
94+
- name: "Setup PHP"
95+
uses: shivammathur/setup-php@v2
96+
with:
97+
php-version: ${{ matrix.php-versions }}
98+
extensions: mbstring, intl
99+
ini-values: post_max_size=256M, max_execution_time=180
100+
coverage: xdebug
101+
102+
- name: "Composer State"
103+
run: composer update --prefer-lowest --no-install --with-all-dependencies
104+
105+
- name: "Composer Name Hash"
106+
id: composer-hash
107+
uses: KEINOS/gh-action-hash-for-cache@main
108+
with:
109+
path: ./composer.lock
110+
111+
- name: "Caching"
112+
id: cache-composer
113+
uses: actions/cache@v3
114+
with:
115+
path: vendor
116+
key: composer-lowest-${{ steps.composer-hash.outputs.hash }}
117+
restore-keys: composer-lowest-${{ steps.composer-hash.outputs.hash }}
118+
119+
- name: "Install Dependencies"
120+
if: ${{ steps.cache-composer.outputs.cache-hit != 'true' }}
121+
run: composer install
122+
123+
- name: "Linux: Restore Vendor Executable"
124+
if: matrix.operating-system == 'ubuntu-latest'
125+
run: chmod -R 0755 vendor
126+
127+
- name: "PHPUnit"
128+
run: ./vendor/bin/phpunit

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@
4646
"guzzlehttp/guzzle": "^7.0"
4747
},
4848
"require-dev": {
49-
"phpunit/phpunit": "^9.0|^10.0"
49+
"phpunit/phpunit": "^9.5|^10.0"
5050
},
5151
"minimum-stability": "stable",
5252
"prefer-stable": true
53-
}
53+
}

0 commit comments

Comments
 (0)