-
Notifications
You must be signed in to change notification settings - Fork 27
47 lines (45 loc) · 1.44 KB
/
integration-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
name: Integration Test
on:
push:
jobs:
integration:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Create Laravel project
run: |
composer create-project laravel/laravel laravel
- name: Fix Permission
run: chmod -R 777 ./laravel/storage
- name: Run docker-compose
run:
cp ./tests/compose.yaml compose.yaml &&
docker-compose -f "compose.yaml" up -d
- name: Create script.js for K6 test
run: |
touch script.js && cat > script.js <<EOF
import http from 'k6/http';
import { sleep } from 'k6';
export default function () {
//Link
http.get('http://localhost');
}
EOF
- name: Install k6
run: |
curl https://github.com/grafana/k6/releases/download/v0.47.0/k6-v0.47.0-linux-amd64.tar.gz -L | tar xvz --strip-components 1
- name: Test with K6
run: |
./k6 run script.js
- name: Test with curl
run: |
curl -i http://localhost
- name: Waiting for database connection
run: |
while ! docker exec mysql mysql --user=root --password=password -e "status" &> /dev/null ; do
echo "Waiting for database connection..."
sleep 5
done
- name: Laravel database migration test
run: |
docker exec php-fpm php artisan migrate