Skip to content

Commit

Permalink
Added GHA workflow for tests.
Browse files Browse the repository at this point in the history
Removed Travis configuration.
  • Loading branch information
Bilge committed Jul 19, 2024
1 parent 07ddeba commit cc00034
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 36 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/Test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Test

on:
push:
pull_request:
workflow_dispatch:
schedule:
- cron: 0 6 * * *

jobs:
Test:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
php:
- 8.1
- 8.2
- 8.3

steps:
- uses: actions/checkout@v4

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

- name: Validate composer.json
run: composer validate

- name: Cache dependencies
id: composer-cache
uses: actions/cache@v4
with:
path: vendor
key: php-${{ matrix.php }}

- name: Install dependencies
run: composer update --no-interaction --no-progress

- name: Run test suite with coverage
run: composer test -- --coverage-clover=build/logs/clover.xml

- name: Upload test coverage
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_ORG_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/.*/
!/.github/
/vendor/
/composer.lock
34 changes: 0 additions & 34 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions test/CapabilitiesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ public function testNotice(): void

public function testWarning(): void
{
// zend.assertions may be completely enabled or disabled only in php.ini.
ini_set('zend.assertions', -1);
// foreach() argument must be of type array|object.
foreach (1 as $n) {}

self::assertTrue(true);
}
Expand Down

0 comments on commit cc00034

Please sign in to comment.