Skip to content

Commit

Permalink
Merge pull request #19 from utopia-php/feat-github-action-test
Browse files Browse the repository at this point in the history
GitHub Action
  • Loading branch information
lohanidamodar authored May 20, 2024
2 parents beeea0f + ceb169d commit 2c6e9eb
Show file tree
Hide file tree
Showing 14 changed files with 125 additions and 815 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: "Tests"

on: [ pull_request ]
jobs:
test:
name: Tests ${{ matrix.php-versions }}
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['8.0', '8.1', '8.2', '8.3', 'nightly']

steps:
- name: Checkout repository
uses: actions/checkout@v3

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

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

- name: Compose install
run: composer install --ignore-platform-reqs

- name: Run tests
run: composer test
35 changes: 0 additions & 35 deletions .travis.yml

This file was deleted.

53 changes: 0 additions & 53 deletions Dockerfile

This file was deleted.

2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@
"scripts": {
"format": "vendor/bin/pint",
"lint": "vendor/bin/pint --test",
"test": "docker-compose up -d && sleep 10 && docker-compose exec web vendor/bin/phpunit --configuration phpunit.xml"
"test": "vendor/bin/phpunit --configuration phpunit.xml"
}
}
10 changes: 0 additions & 10 deletions docker-compose.yml

This file was deleted.

1 change: 0 additions & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
<directory>./tests/unit</directory>
</testsuite>
<testsuite name="Application Test Suite">
<file>./tests/e2e/Client.php</file>
<directory>./tests/</directory>
</testsuite>
</testsuites>
Expand Down
32 changes: 32 additions & 0 deletions tests/Platform/MockResponse.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

namespace Utopia\Tests;

use Utopia\Response;

class MockResponse extends Response
{
public function end(string $content = null): void
{
if (! is_null($content)) {
echo $content;
}
}

public function send(string $body = ''): void
{
$this->sent = true;
$this->end($body);
}

public function chunk(string $body = '', bool $end = false): void
{
if ($end) {
$this->sent = true;
}
$this->write($body);
if ($end) {
$this->end();
}
}
}
87 changes: 0 additions & 87 deletions tests/docker/nginx.conf

This file was deleted.

25 changes: 0 additions & 25 deletions tests/docker/start

This file was deleted.

45 changes: 0 additions & 45 deletions tests/docker/supervisord.conf

This file was deleted.

Loading

0 comments on commit 2c6e9eb

Please sign in to comment.