Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: merge tests to test multiple PHP and Laravel versions #215

Closed
wants to merge 12 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 0 additions & 48 deletions .github/workflows/latest.yml

This file was deleted.

52 changes: 0 additions & 52 deletions .github/workflows/test-php8.2.yml

This file was deleted.

68 changes: 68 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: "Tests"

# Triggers the workflow on push or pull request events
on:
push:
branches:
- stable
- develop
pull_request:
workflow_dispatch:

jobs:
test:
name: PHPUnit Tests
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
php-version: [8.1, 8.2, 8.3]
laravel-version:
[
"9.*", # Test Laravel 9
"10.*", # Test latest version
]
steps:
- uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@master
with:
php-version: ${{ matrix.php-version }}

- name: Composer self update
run: composer self-update >/dev/null 2>&1

- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-${{ matrix.laravel-version }}-${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-${{ matrix.laravel-version }}-${{ matrix.php-version }}-

- name: Install dependencies
run: composer install --prefer-dist

- name: Lock laravel/framework version
env:
LARAVEL_VERSION: ${{ matrix.laravel-version }}
run: composer require laravel/framework:${{ matrix.laravel-version }} --no-update

- name: Run simple test suites
if: matrix.laravel-version == '9.*'
run: composer run-script test-dev

- name: Run test suites
if: matrix.laravel-version != '9.*'
run: composer run-script test

- name: Coveralls
if: matrix.laravel-version != '9.*'
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: php vendor/bin/php-coveralls -v
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ demo/cache
.coveralls.yml export-ignore
phpstan.neon export-ignore
phpunit.xml export-ignore

# Packages should not include a lockfile
composer.lock
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Easy to use package to identify the visitor's browser details and device type.
Magic is **not** involved the results are generated by multiple well tested and developed packages.

Supports **every Laravel** version between **4.0 » 10.x**;
Also tested on **every PHP** version between **5.6 » 8.2**.
Also tested on **every PHP** version between **5.6 » 8.3**.

### How to install

Expand Down
Loading