-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
09a46ea
commit 49250b6
Showing
1 changed file
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: Test runner | ||
|
||
on: | ||
push: | ||
branches: [ "master" ] | ||
paths: | ||
- '**.php' | ||
pull_request: | ||
branches: [ "master" ] | ||
paths: | ||
- '**.php' | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
test: | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
# Define the matrix of different PHP and dependency versions | ||
strategy: | ||
# Fail the whole workflow if one of the jobs fails | ||
fail-fast: true | ||
matrix: | ||
os: [ ubuntu-latest ] | ||
php: [ 8.1, 8.2 ] | ||
dependency-version: [ prefer-lowest, prefer-stable ] | ||
|
||
name: ${{ matrix.os }} / PHP ${{ matrix.php }} / ${{ matrix.dependency-version }} | ||
|
||
steps: | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
|
||
# If your package requires additional system configuration, uncomment this section and set the run command. | ||
#- name: Configure operating system | ||
# if: matrix.os == 'ubuntu-latest' | ||
# run: sudo apt-get install -y locales locales-all | ||
|
||
- name: Validate composer.json and composer.lock | ||
run: composer validate --strict | ||
|
||
- name: Cache Composer packages | ||
id: composer-cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: vendor | ||
key: ${{ runner.os }}-php-${{ matrix.php }}-${{ matrix.dependency-version }}-${{ hashFiles('**/composer.lock') }} | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
# If your package requires additional extensions, uncomment this line and list them here: | ||
# extensions: mbstring, gd, intl | ||
|
||
- name: Install dependencies | ||
run: composer update --prefer-dist --no-progress --${{ matrix.dependency-version }} | ||
|
||
- name: Run test suite | ||
run: composer test |