Skip to content

Commit 7091fc6

Browse files
committed
Add tests
1 parent e03db02 commit 7091fc6

File tree

9 files changed

+925
-277
lines changed

9 files changed

+925
-277
lines changed

.github/workflows/tests.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Tests
2+
3+
on:
4+
workflow_dispatch:
5+
# push:
6+
# branches:
7+
# - "**"
8+
# - "!main"
9+
# pull_request:
10+
# branches: [ "main" ]
11+
12+
13+
jobs:
14+
pest-tests:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v3
20+
21+
- name: Setup PHP
22+
uses: shivammathur/setup-php@v2
23+
with:
24+
php-version: 8.2
25+
tools: composer:v2
26+
coverage: xdebug
27+
28+
- name: Install Node
29+
uses: actions/setup-node@v3
30+
with:
31+
node-version: 20.x
32+
cache: 'npm'
33+
34+
- name: Copy .env
35+
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
36+
37+
- name: Install PHP Dependencies
38+
run: composer install --no-interaction --prefer-dist --optimize-autoloader
39+
40+
- name: Install NPM Dependencies
41+
run: npm ci && npm run build
42+
43+
- name: Generate key
44+
run: php artisan key:generate
45+
46+
- name: Directory Permissions
47+
run: chmod -R 777 storage bootstrap/cache
48+
49+
- name: Create Database
50+
run: |
51+
mkdir -p database
52+
touch database/database.sqlite
53+
54+
- name: Run migrations
55+
run: php artisan migrate --force
56+
57+
- name: Run Tests
58+
env:
59+
DB_CONNECTION: sqlite
60+
DB_DATABASE: database/database.sqlite
61+
run: ./vendor/bin/pest

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"laravel/sail": "^1.18",
2727
"mockery/mockery": "^1.4.4",
2828
"nunomaduro/collision": "^7.0",
29+
"pestphp/pest": "^2.33",
2930
"phpunit/phpunit": "^10.1",
3031
"spatie/laravel-ignition": "^2.0"
3132
},

0 commit comments

Comments
 (0)