Skip to content

Commit

Permalink
Upgrade Tests workflow by Vependabot (#227)
Browse files Browse the repository at this point in the history
* Upgrade Tests workflow

* Upgrade codecov/codecov-action

---------

Co-authored-by: Michael Grosse Huelsewiesche <[email protected]>
  • Loading branch information
szepeviktor and MichaelGHSeg authored Aug 17, 2023
1 parent 30988c3 commit 269ebe6
Showing 1 changed file with 21 additions and 30 deletions.
51 changes: 21 additions & 30 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ on:
jobs:

coding-standard:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
name: Coding standards

steps:
- name: Check out code
uses: actions/checkout@v2
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up PHP
uses: shivammathur/setup-php@v2
Expand All @@ -25,7 +25,7 @@ jobs:
# Install dependencies and handle caching in one go.
# @link https://github.com/marketplace/actions/install-composer-dependencies
- name: Install Composer dependencies
uses: "ramsey/composer-install@v1"
uses: "ramsey/composer-install@v2"

- name: Check coding standards
continue-on-error: true
Expand All @@ -35,7 +35,7 @@ jobs:
run: cs2pr ./phpcs-report.xml

lint:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
matrix:
php: ['7.4', '8.0', '8.1', '8.2']
Expand All @@ -45,8 +45,8 @@ jobs:
continue-on-error: ${{ matrix.experimental }}

steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Checkout repository
uses: actions/checkout@v3

- name: Install PHP
uses: shivammathur/setup-php@v2
Expand All @@ -58,7 +58,7 @@ jobs:
# Install dependencies and handle caching in one go.
# @link https://github.com/marketplace/actions/install-composer-dependencies
- name: Install Composer dependencies
uses: "ramsey/composer-install@v1"
uses: "ramsey/composer-install@v2"

- name: Lint against parse errors
if: ${{ matrix.php != '8.1' }}
Expand All @@ -70,7 +70,7 @@ jobs:

test:
needs: ['coding-standard', 'lint']
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
matrix:
php: ['7.4', '8.0', '8.1', '8.2']
Expand All @@ -96,49 +96,40 @@ jobs:
continue-on-error: ${{ matrix.experimental }}

steps:
- name: Check out code
uses: actions/checkout@v2

- name: Set coverage variable
id: set_cov
run: |
if [ ${{ matrix.coverage }} == "true" ]; then
echo '::set-output name=COV::xdebug'
else
echo '::set-output name=COV::none'
fi
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: ${{ steps.set_cov.outputs.COV }}
coverage: ${{ matrix.coverage && 'xdebug' || 'none' }}
ini-values: sendmail_path=/usr/sbin/sendmail -t -i, error_reporting=E_ALL, display_errors=On
extensions: imap, mbstring, intl, ctype, filter, hash

# Install dependencies and handle caching in one go.
# @link https://github.com/marketplace/actions/install-composer-dependencies
- name: Install PHP packages - normal
- name: Install dependencies
if: ${{ matrix.php != '8.1' }}
uses: "ramsey/composer-install@v1"
uses: "ramsey/composer-install@v2"

- name: Install PHP packages - ignore-platform-reqs
- name: Install dependencies - ignore-platform-reqs
if: ${{ matrix.php == '8.1' }}
uses: "ramsey/composer-install@v1"
uses: "ramsey/composer-install@v2"
with:
composer-options: --ignore-platform-reqs

- name: Run tests, no code coverage
if: ${{ matrix.coverage == false }}
if: ${{ matrix.coverage }}
run: ./vendor/bin/phpunit --no-coverage

- name: Run tests with code coverage
if: ${{ matrix.coverage == true }}
run: vendor/bin/phpunit
if: ${{ matrix.coverage }}
run: ./vendor/bin/phpunit

- name: Send coverage report to Codecov
if: ${{ success() && matrix.coverage == true }}
uses: codecov/codecov-action@v1
if: ${{ success() && matrix.coverage }}
uses: codecov/codecov-action@v3
with:
files: ./build/logs/clover.xml
fail_ci_if_error: true
Expand Down

0 comments on commit 269ebe6

Please sign in to comment.