Skip to content

Commit 0c49890

Browse files
authored
Merge pull request #4 from dployr-io/unit-tests
Unit tests
2 parents e6bdf78 + 5c1471e commit 0c49890

130 files changed

Lines changed: 3664 additions & 727 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/release.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,22 +38,18 @@ jobs:
3838
restore-keys: ${{ runner.os }}-composer-
3939

4040
- name: Install PHP dependencies
41-
working-directory: app
4241
run: composer install --no-dev --optimize-autoloader --no-interaction
4342

4443
- name: Install pnpm
4544
run: npm install -g pnpm
4645

4746
- name: Install Node dependencies
48-
working-directory: app
4947
run: pnpm i
5048

5149
- name: Build frontend assets
52-
working-directory: app
5350
run: pnpm run build
5451

5552
- name: Prepare release
56-
working-directory: app
5753
run: |
5854
echo "removing development files..."
5955
rm -rf tests .github .cache builds .config .local node_modules phpunit.xml eslint.config.js .editorconfig .gitattributes .gitignore .prettierrc .prettierignore resources/css resources/js
@@ -74,12 +70,13 @@ jobs:
7470
find storage/framework/views -name "*" -not -name ".gitignore" -delete 2>/dev/null || true
7571
7672
- name: Read version from file
77-
working-directory: app
7873
id: version
79-
run: echo "version=$(cat VERSION)" >> $GITHUB_OUTPUT
74+
run: |
75+
VERSION=$(php -r "echo trim(file_get_contents('VERSION'));")
76+
echo "version=$VERSION" >> $GITHUB_OUTPUT
77+
echo "Using version: $VERSION"
8078
8179
- name: Create archive
82-
working-directory: app
8380
run: zip -r "../dployr-v${{ steps.version.outputs.version }}.zip" .
8481

8582
- name: Create Release

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
resources/js/components/ui/*
2+
resources/js/**/__tests__/
23
resources/views/mail/*

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.2.12
1+
0.2.24

app/DTOs/ApiResponse.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ public function __construct(
99
public array $data = [],
1010
public ?string $error = null
1111
) {}
12-
}
12+
}

app/DTOs/CmdResult.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ public function __construct(
1515

1616
public function failed(): bool
1717
{
18-
return !$this->successful;
18+
return ! $this->successful;
1919
}
2020

2121
public function hasOutput(): bool
2222
{
23-
return !empty($this->output);
23+
return ! empty($this->output);
2424
}
2525

2626
public function hasError(): bool
2727
{
28-
return !empty($this->errorOutput);
28+
return ! empty($this->errorOutput);
2929
}
30-
}
30+
}

app/Enums/RemoteType.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
namespace App\Enums;
44

5-
enum RemoteType {
5+
enum RemoteType
6+
{
67
case GitHub;
78
case GitLab;
89
case BitBucket;
9-
}
10+
}

app/Exceptions/RepositorySearchException.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,11 @@ class RepositorySearchException extends Exception
1111
* Render the exception into an HTTP response.
1212
*
1313
* @param \Illuminate\Http\Request $request
14-
* @return \Illuminate\Http\JsonResponse
1514
*/
1615
public function render($request): JsonResponse
1716
{
1817
return response()->json([
19-
'error' => 'Failed to search for remote repository'
18+
'error' => 'Failed to search for remote repository',
2019
], 502);
2120
}
2221
}

app/Facades/AppConfig.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ protected static function getFacadeAccessor()
1010
{
1111
return 'app.config';
1212
}
13-
}
13+
}

app/Facades/Command.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
namespace App\Facades;
44

5-
use Illuminate\Support\Facades\Facade;
65
use App\Services\CmdService;
6+
use Illuminate\Support\Facades\Facade;
77

88
class Command extends Facade
99
{

app/Http/Controllers/Logs/LogsController.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ class LogsController extends Controller
1414
public function stream(): StreamedResponse
1515
{
1616
return new StreamedResponse(
17-
fn() => LogStreamService::stream('logs/laravel.log'),
18-
200,
19-
[
20-
'Content-Type' => 'text/event-stream',
21-
'Cache-Control' => 'no-cache',
22-
'X-Accel-Buffering' => 'no',
23-
]);
17+
fn () => LogStreamService::stream('logs/laravel.log'),
18+
200,
19+
[
20+
'Content-Type' => 'text/event-stream',
21+
'Cache-Control' => 'no-cache',
22+
'X-Accel-Buffering' => 'no',
23+
]);
2424
}
2525
}

0 commit comments

Comments
 (0)