mirror of
https://github.com/jkaninda/nginx-php-fpm.git
synced 2025-12-06 13:39:42 +01:00
37
.github/workflows/integration-tests.yml
vendored
Normal file
37
.github/workflows/integration-tests.yml
vendored
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
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
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
[](https://github.com/jkaninda/nginx-php-fpm/actions/workflows/build.yml)
|
[](https://github.com/jkaninda/nginx-php-fpm/actions/workflows/build.yml)
|
||||||
|
[](https://github.com/jkaninda/nginx-php-fpm/actions/workflows/integration-tests.yml)
|
||||||

|

|
||||||

|

|
||||||
|
|
||||||
|
|||||||
30
tests/compose.yaml
Normal file
30
tests/compose.yaml
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
version: '3'
|
||||||
|
services:
|
||||||
|
mysql:
|
||||||
|
image: mysql:8.0
|
||||||
|
container_name: mysql
|
||||||
|
restart: unless-stopped
|
||||||
|
environment:
|
||||||
|
MYSQL_DATABASE: php
|
||||||
|
MYSQL_ROOT_PASSWORD: password
|
||||||
|
MYSQL_PASSWORD: password
|
||||||
|
MYSQL_USER: php
|
||||||
|
ports:
|
||||||
|
- 3306:3306
|
||||||
|
nginx-php-fpm:
|
||||||
|
image: jkaninda/nginx-php-fpm:latest
|
||||||
|
container_name: nginx-php-fpm
|
||||||
|
restart: unless-stopped
|
||||||
|
depends_on:
|
||||||
|
- mysql
|
||||||
|
environment:
|
||||||
|
DB_HOST: mysql
|
||||||
|
DB_PORT: 3306
|
||||||
|
DB_DATABASE: php
|
||||||
|
DB_USERNAME: php
|
||||||
|
DB_PASSWORD: password
|
||||||
|
volumes:
|
||||||
|
#Project root
|
||||||
|
- ./laravel:/var/www/html
|
||||||
|
ports:
|
||||||
|
- 80:80
|
||||||
Reference in New Issue
Block a user