Skip to content

Commit

Permalink
chore: run unit tests using lowest matching dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
fquffio committed Aug 31, 2022
1 parent 6d8305e commit 793691c
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,40 @@ jobs:
name: 'PHP ${{ matrix.php }}'
path: 'clover.xml'

unit-lowest:
name: 'Run unit tests with lowest-matching dependencies versions'
if: "!contains(github.event.commits[0].message, '[skip ci]') && !contains(github.event.commits[0].message, '[ci skip]')"
runs-on: 'ubuntu-20.04'

steps:
- name: 'Checkout current revision'
uses: 'actions/checkout@v2'

- name: 'Setup PHP'
uses: 'shivammathur/setup-php@v2'
with:
php-version: '7.4'
tools: 'composer'
extensions: 'mbstring, intl'

- name: 'Discover Composer cache directory'
id: 'cachedir'
run: 'echo "::set-output name=path::$(composer global config cache-dir)"'

- name: 'Share Composer cache across runs'
uses: 'actions/cache@v2'
with:
path: '${{ steps.cachedir.outputs.path }}'
key: "composer-lowest-${{ hashFiles('**/composer.json') }}"
restore-keys: |
composer-lowest-
composer-
- name: 'Update dependencies with Composer'
run: 'composer update --prefer-lowest --prefer-dist --no-interaction'

- name: 'Dump Composer autoloader'
run: 'composer dump-autoload --classmap-authoritative --no-cache'

- name: 'Run PHPUnit'
run: 'vendor/bin/phpunit'
16 changes: 16 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
codecov:
require_ci_to_pass: true
notify:
after_n_builds: 3

coverage:
precision: 1
round: down
range: "85...100"

comment:
layout: "reach,diff,flags,files,footer"
behavior: default
require_changes: no
after_n_builds: 2

0 comments on commit 793691c

Please sign in to comment.