Skip to content

Commit

Permalink
Test new yml
Browse files Browse the repository at this point in the history
  • Loading branch information
kyoungportable committed Mar 7, 2024
1 parent 99c8244 commit 5bf61e0
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 7 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,5 @@ jobs:
- uses: actions/checkout@v3
- name: Install dependencies
run: composer install --prefer-dist --no-progress
- name: Laravel Pint
- name: Laravel Pint
run: php vendor/bin/pint --test
- name: Unit Test
run: php vendor/bin/testbench package:test

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

on:
push:
branches: [ "*" ]
pull_request:
branches: [ "*" ]

jobs:
tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
php: ['8.1']
pest: ['3.0.0']
dependency-version: [prefer-lowest, prefer-stable]

name: PHP ${{ matrix.php }} - ${{ matrix.os }} - Pest ${{ matrix.pest }} - ${{ matrix.dependency-version }}

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

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pdo, sqlite, pdo_sqlite, gd, pdo_mysql, fileinfo, ftp, redis, memcached, gmp
tools: composer:v2
coverage: xdebug

- name: Setup Problem Matchers
run: |
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Set Pest
run: composer require pestphp/pest:^${{ matrix.pest }} --dev --no-interaction --no-update

- name: Install PHP dependencies
run: composer update --${{ matrix.dependency-version }} --no-interaction --prefer-dist --no-progress --ansi

- name: Run Unit With PHPUnit
run: composer test:unit:phpunit

- name: Run Unit With Pest
run: composer test:unit:pest
6 changes: 3 additions & 3 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
namespace Portable\FilaCms\Tests;

use Illuminate\Contracts\Config\Repository;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\File;
use Orchestra\Testbench\Attributes\WithMigration;
use Orchestra\Testbench\Concerns\WithWorkbench;
Expand Down Expand Up @@ -37,8 +37,8 @@ protected function setUp(): void
->expectsQuestion('Would you like to publish the FilaCMS config?(Y/n)', 'Y')
->expectsQuestion('Would you like to run migrations(Y/n)?', 'Y')
->expectsQuestion('Would you like to add the required trait to your App\\Models\\User model?(Y/n)', 'Y')
// ->expectsQuestion('theme.css already exists, do you want to overwrite it?', 'no')
// ->expectsQuestion('tailwind.config.js already exists, do you want to overwrite it?', 'no')
->expectsQuestion('theme.css already exists, do you want to overwrite it?', 'no')
->expectsQuestion('tailwind.config.js already exists, do you want to overwrite it?', 'no')

->expectsOutputToContain('Finished')
->assertExitCode(0);
Expand Down

0 comments on commit 5bf61e0

Please sign in to comment.