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

add github CI actions #347

Closed
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
40 changes: 40 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: run-tests

on: [ push, pull_request ]

jobs:
test:
runs-on: ubuntu-latest

strategy:
fail-fast: true
matrix:
php: ["7.2", "7.3", "7.4", "8.0", "8.1"]

name: php-${{ matrix.php }}

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

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

- name: Validate composer.json and composer.lock
run: composer validate --strict

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
with:
path: vendor
key: ${{ matrix.php }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ matrix.php }}-php-
- name: Install dependencies
run: composer update --no-interaction --prefer-dist --no-progress --no-plugins

- name: Execute tests
run: vendor/bin/phpunit --bootstrap vendor/autoload.php tests
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@
}
],
"require": {
"php": ">=7.0.0",
"php": "^7.2|^8.0",
"ext-openssl": "*",
"ext-json": "*",
"ext-mbstring": "*",
"ext-iconv": "*",
"ext-fileinfo": "*",
"nesbot/carbon": ">=1.0",
"symfony/http-foundation": ">=2.8.0",
"illuminate/pagination": ">=5.0.0"
"nesbot/carbon": "^1.0",
"symfony/http-foundation": "^2.8",
"illuminate/pagination": "^5.0"
},
"require-dev": {
"phpunit/phpunit": "~4.0"
"phpunit/phpunit": "^8.5 || ^9.5"
},
"suggest": {
"symfony/mime": "Recomended for better extension support"
Expand Down
6 changes: 3 additions & 3 deletions tests/InitialTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
class InitialTest extends TestCase {
protected $cm;

public function setUp() {
public function setUp(): void {
$this->cm = new ClientManager();
}

public function testConfigDefaultAccount() {
$this->assertEquals("default", ClientManager::get("default"));
self::assertSame("default", ClientManager::get("default"));
}
}
}