diff --git a/.github/workflows/bump-version.yml b/.github/workflows/bump-version.yml index 6ccda15..1b3cf43 100644 --- a/.github/workflows/bump-version.yml +++ b/.github/workflows/bump-version.yml @@ -2,7 +2,9 @@ name: Bump Version on: push: - branches: [main] + branches: + - master + workflow_dispatch: jobs: bump: diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml new file mode 100644 index 0000000..a7b832a --- /dev/null +++ b/.github/workflows/run-tests.yml @@ -0,0 +1,39 @@ +name: Run Tests + +on: + pull_request: + types: [opened, synchronize, reopened] + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.5' + extensions: zip, sqlite3, pdo_sqlite + coverage: none + + - name: Cache Composer dependencies + uses: actions/cache@v4 + with: + path: vendor + key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }} + restore-keys: | + ${{ runner.os }}-composer- + + - name: Install dependencies + run: composer install --no-interaction --prefer-dist --optimize-autoloader + + - name: Copy environment file + run: cp .env.example .env + + - name: Generate application key + run: php artisan key:generate + + - name: Run tests + run: composer test \ No newline at end of file diff --git a/composer.json b/composer.json index eec89f2..e84e93a 100644 --- a/composer.json +++ b/composer.json @@ -33,7 +33,8 @@ }, "autoload-dev": { "psr-4": { - "App\\": "app/" + "App\\": "app/", + "Tests\\": "tests/" } }, "scripts": {