-
Notifications
You must be signed in to change notification settings - Fork 762
87 lines (70 loc) · 2.23 KB
/
tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Pest Tests
on:
push:
branches:
- main
- 3.x
pull_request:
branches: [ main ]
jobs:
installer-manual:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: pdo_sqlite
- name: Create project directory
run: mkdir project_folder
- name: Download tarball of current commit
run: |
TARBALL_URL=$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository }}/tarball/${{ github.sha }} \
-I | grep -i "location:" | cut -d " " -f 2 | tr -d '\r')
curl -L -o wave.tar.gz $TARBALL_URL
- name: Extract tarball to project directory
run: tar -xzf wave.tar.gz -C project_folder --strip-components=1
- name: Debug - List contents of project directory
run: |
echo "Contents of project_folder directory:"
ls -la project_folder
echo "Contents of project_folder/public directory (if it exists):"
ls -la project_folder/public || echo "Public directory not found"
- name: Copy .env.example file
run: |
cd project_folder
cp .env.example .env
- name: Create SQLite database
run: |
cd project_folder
touch database/database.sqlite
- name: Install Composer Dependencies
run: |
cd project_folder
composer install
- name: Generate application key
run: |
cd project_folder
php artisan key:generate
- name: Database Migrations and Seed
run: |
cd project_folder
php artisan migrate
php artisan db:seed
- name: Start Laravel server
run: |
cd project_folder
php artisan serve &
echo $! > laravel_server.pid
- name: Wait for server to start
run: sleep 5
- name: Execute tests (Unit and Feature tests) via PestPHP
run: |
cd project_folder
./vendor/bin/pest
- name: Stop Laravel server
if: always()
run: kill $(cat project_folder/laravel_server.pid)