Skip to content

Commit

Permalink
Switch PHP version in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Kolb committed Feb 1, 2025
1 parent 19dfd90 commit 81049dd
Showing 1 changed file with 32 additions and 32 deletions.
64 changes: 32 additions & 32 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: CI
on: push
jobs:

test-8-2:
name: "Tests on PHP 8.2"
test-8-3:
name: "Tests on PHP 8.3"
runs-on: ubuntu-latest
steps:

Expand All @@ -19,28 +19,36 @@ jobs:
- name: Setup env
run: cp .github/workflows/.env .env

- name: Cache PHP 8.2 dependencies
id: cache-php-8-2-dependencies
- name: Cache PHP 8.3 dependencies
id: cache-php-8-3-dependencies
uses: actions/cache@v3
env:
cache-name: cache-php-8-2-dependencies
cache-name: cache-php-8-3-dependencies
with:
path: |
~/.cache
vendor
key: ${{ runner.os }}-php-8-2-cache-${{ hashFiles('composer.lock') }}
key: ${{ runner.os }}-php-8-3-cache-${{ hashFiles('composer.lock') }}
restore-keys: |
${{ runner.os }}-php-8-2-cache-${{ hashFiles('composer.lock') }}
${{ runner.os }}-php-8-3-cache-${{ hashFiles('composer.lock') }}
- name: Install
if: steps.cache-php-8-2-dependencies.outputs.cache-hit != 'true'
run: make install-8.2
if: steps.cache-php-8-3-dependencies.outputs.cache-hit != 'true'
run: make install-8.3

- name: Run PHP tests
run: make php-8.2-tests-ci
run: make php-8.3-tests-ci

test-8-3:
name: "Tests on PHP 8.3"
- name: Upload to Codecov
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
verbose: true

test-8-4:
name: "Tests on PHP 8.4"
runs-on: ubuntu-latest
steps:

Expand All @@ -56,33 +64,25 @@ jobs:
- name: Setup env
run: cp .github/workflows/.env .env

- name: Cache PHP 8.3 dependencies
id: cache-php-8-3-dependencies
- name: Cache PHP 8.4 dependencies
id: cache-php-8-4-dependencies
uses: actions/cache@v3
env:
cache-name: cache-php-8-3-dependencies
cache-name: cache-php-8-4-dependencies
with:
path: |
~/.cache
vendor
key: ${{ runner.os }}-php-8-3-cache-${{ hashFiles('composer.lock') }}
key: ${{ runner.os }}-php-8-4-cache-${{ hashFiles('composer.lock') }}
restore-keys: |
${{ runner.os }}-php-8-3-cache-${{ hashFiles('composer.lock') }}
${{ runner.os }}-php-8-4-cache-${{ hashFiles('composer.lock') }}
- name: Install
if: steps.cache-php-8-3-dependencies.outputs.cache-hit != 'true'
run: make install-8.3
if: steps.cache-php-8-4-dependencies.outputs.cache-hit != 'true'
run: make install-8.4

- name: Run PHP tests
run: make php-8.3-tests-ci

- name: Upload to Codecov
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
verbose: true
run: make php-8.4-tests-ci

code-validation:
name: "Code validation"
Expand All @@ -101,18 +101,18 @@ jobs:
- name: Setup env
run: cp .github/workflows/.env .env

- name: Restore cache for PHP 8.3 dependencies
id: cache-php-8-3-dependencies
- name: Restore cache for PHP 8.4 dependencies
id: cache-php-8-4-dependencies
uses: actions/cache/restore@v3
with:
path: |
~/.cache
vendor
key: ${{ runner.os }}-php-8-3-cache-${{ hashFiles('composer.lock') }}
key: ${{ runner.os }}-php-8-4-cache-${{ hashFiles('composer.lock') }}

- name: Install
if: steps.cache-php-8-3-dependencies.outputs.cache-hit != 'true'
run: make install-8.3
run: make install-8.4

- name: Run code validation
run: make php-code-validation

0 comments on commit 81049dd

Please sign in to comment.