Skip to content

Commit

Permalink
fixed badge and PHP 8.4 (experimental)
Browse files Browse the repository at this point in the history
  • Loading branch information
ogmueller committed Mar 18, 2024
1 parent 36bf46d commit 5020276
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
20 changes: 20 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,21 @@ jobs:
"update --no-progress --prefer-dist --prefer-lowest",
"update --no-progress --prefer-dist"
]
experimental: [
# PHP 8.1
"false",
# PHP 8.2
"false",
# PHP 8.3
"false",
# PHP 8.4
"true",
]
name: "PHP ${{ matrix.php-version }} test"
steps:
- name: "Check if PHP ${{ matrix.php-version }} is supported"
if: "matrix.experimental == 'true'"
run: "echo 'PHP ${{ matrix.php-version }} is experimental'"
- name: "checkout project"
uses: "actions/checkout@v4"
with:
Expand All @@ -51,28 +64,34 @@ jobs:

- name: "Validate composer.json and composer.lock"
run: "composer validate"
continue-on-error: "${{ matrix.experimental }}"

- name: "Get composer cache directory"
id: "composer-cache"
run: "echo \"dir=$(composer config cache-dir)\" >> $GITHUB_OUTPUT"
continue-on-error: "${{ matrix.experimental }}"

- name: "Cache composer dependencies"
uses: "actions/cache@v4"
with:
path: "${{ steps.composer-cache.outputs.dir }}"
key: "${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}"
restore-keys: "${{ runner.os }}-composer-"
continue-on-error: "${{ matrix.experimental }}"

- name: "Install dependencies"
run: "composer ${{ matrix.composer-param }}"
continue-on-error: "${{ matrix.experimental }}"

# Run phpunit with code coverage
- name: "PHPUnit Tests"
run: "vendor/bin/phpunit --coverage-clover=coverage.clover"
continue-on-error: "${{ matrix.experimental }}"

# Uploading reports for analysis
- name: "Upload code-coverage to scrutinizer"
run: "vendor/bin/ocular code-coverage:upload --format=php-clover coverage.clover"
continue-on-error: "${{ matrix.experimental }}"

- name: "Publish code coverage to Code Climate"
uses: "paambaati/codeclimate-action@v5"
Expand All @@ -82,5 +101,6 @@ jobs:
coverageCommand: "vendor/bin/phpunit --coverage-clover=coverage.clover"
coverageLocations: |
coverage.clover:clover
continue-on-error: "${{ matrix.experimental }}"

# vim: syntax=yaml ts=2 sw=2 et sr softtabstop=2 autoindent
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# phpunit-stopwatch

[![CI](https://github.com/teqneers/phpunit-stopwatch/workflows/ci/badge.svg)](https://github.com/teqneers/phpunit-stopwatch/actions)
[![CI](https://github.com/teqneers/phpunit-stopwatch/actions/workflows/ci.yml/badge.svg)](https://github.com/teqneers/phpunit-stopwatch/actions)

[![Code Coverage](https://codecov.io/gh/teqneers/phpunit-stopwatch/branch/main/graph/badge.svg)](https://codecov.io/gh/teqneers/phpunit-stopwatch)
[![Type Coverage](https://shepherd.dev/github/teqneers/phpunit-stopwatch/coverage.svg)](https://shepherd.dev/github/teqneers/phpunit-stopwatch)
Expand Down

0 comments on commit 5020276

Please sign in to comment.