-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #107 from lion-packages/support
Support with PHP 8.4
- Loading branch information
Showing
54 changed files
with
457 additions
and
6,192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
################################################################################ | ||
################# SERVER INFORMATION ------------------------- ################# | ||
################################################################################ | ||
APP_NAME="lion-bundle" | ||
SERVER_DATE_TIMEZONE="America/Bogota" | ||
SERVER_URL="http://127.0.0.1:8000" | ||
SERVER_URL_AUD="http://127.0.0.1:5173" | ||
SERVER_HASH="a50a54cf0454196d493809d282984333a0bcbf0b3703785bd329250485dd8307" | ||
################################################################################ | ||
################# DATABASE CONNECTIONS ----------------------- ################# | ||
################################################################################ | ||
DB_TYPE="mysql" | ||
DB_HOST="127.0.0.1" | ||
DB_PORT=3306 | ||
DB_NAME="lion_database" | ||
DB_USER="root" | ||
DB_PASSWORD="lion" | ||
################################################################################ | ||
DB_TYPE_TEST="mysql" | ||
DB_HOST_TEST="127.0.0.1" | ||
DB_PORT_TEST=3306 | ||
DB_NAME_TEST="lion_database_test" | ||
DB_USER_TEST="root" | ||
DB_PASSWORD_TEST="lion" | ||
################################################################################ | ||
DB_TYPE_TEST_POSTGRESQL="postgresql" | ||
DB_HOST_TEST_POSTGRESQL="127.0.0.1" | ||
DB_PORT_TEST_POSTGRESQL=5432 | ||
DB_NAME_TEST_POSTGRESQL="lion_database_postgres" | ||
DB_USER_TEST_POSTGRESQL="root" | ||
DB_PASSWORD_TEST_POSTGRESQL="lion" | ||
################################################################################ | ||
################# REDIS -------------------------------------- ################# | ||
################################################################################ | ||
REDIS_SCHEME="tcp" | ||
REDIS_HOST="127.0.0.1" | ||
REDIS_DATABASES=1 | ||
REDIS_PASSWORD="lion" | ||
REDIS_PORT=6379 | ||
################################################################################ | ||
################# JWT DATA SECURITY -------------------------- ################# | ||
################################################################################ | ||
JWT_DEFAULT_MD="RS256" | ||
JWT_EXP=3600 # number of hours in seconds | ||
################################################################################ | ||
################# RSA DATA SECURITY -------------------------- ################# | ||
################################################################################ | ||
RSA_PATH="/etc/ssl/openssl.cnf" # the "/etc/ssl/openssl.cnf" value for docker | ||
RSA_URL_PATH="keys/" | ||
RSA_PRIVATE_KEY_BITS=2048 | ||
RSA_DEFAULT_MD="sha256" | ||
################################################################################ | ||
################# AES DATA SECURITY -------------------------- ################# | ||
################################################################################ | ||
AES_METHOD="aes-256-cbc" | ||
AES_KEY="" # 16 character value | ||
AES_IV="" # 16 character value | ||
################################################################################ | ||
################ CRONTAB -------------------------------------- ################ | ||
################################################################################ | ||
CRONTAB_PATH="/etc/" # the "/etc/" value for docker | ||
CRONTAB_PHP_PATH="/usr/local/bin/php" # the '/usr/local/bin/php' value for docker | ||
CRONTAB_PROJECT_PATH="/var/www/html/" # the "/var/www/html/" value for docker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,160 @@ | ||
name: Lion-Bundle (CI Workflow) | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
schedule: | ||
- cron: "15 0 * * *" | ||
|
||
jobs: | ||
composer-validation: | ||
runs-on: ubuntu-latest | ||
name: Composer Validation | ||
|
||
steps: | ||
- name: Check out the repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Cache Composer dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: vendor | ||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-composer | ||
- name: Set up PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '8.4' | ||
extensions: mbstring, gd, zip | ||
|
||
- name: Composer Install | ||
run: composer install | ||
|
||
- name: Composer Validate | ||
run: composer validate --strict | ||
|
||
- name: Composer Check for vulnerabilities | ||
run: composer audit --locked | ||
|
||
- name: Composer Dump-Autoload | ||
run: composer dump-autoload --optimize --strict-psr | ||
|
||
code-analyze: | ||
runs-on: ubuntu-latest | ||
name: PHP Code Analyze | ||
needs: | ||
- composer-validation | ||
|
||
steps: | ||
- name: Check out the repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '8.4' | ||
extensions: mbstring, gd, zip | ||
|
||
- name: Composer Install | ||
run: composer install | ||
|
||
- name: PHP CodeSnifer (Src) | ||
run: php -d memory_limit=-1 vendor/bin/phpcs --standard=PSR12 src/ | ||
|
||
# - name: PHPStan (Src) | ||
# run: php -d memory_limit=-1 vendor/bin/phpstan analyse --level max src | ||
|
||
tests: | ||
runs-on: ubuntu-latest | ||
name: PHP Tests | ||
needs: | ||
- code-analyze | ||
|
||
services: | ||
redis: | ||
image: redis | ||
ports: | ||
- 6379:6379 | ||
|
||
mysql: | ||
image: mysql | ||
options: >- | ||
--health-cmd="mysqladmin ping" | ||
--health-interval=10s | ||
--health-timeout=5s | ||
--health-retries=3 | ||
ports: | ||
- 3306:3306 | ||
env: | ||
MYSQL_DATABASE: lion_database | ||
MYSQL_ROOT_PASSWORD: lion | ||
MYSQL_PASSWORD: lion | ||
|
||
postgres: | ||
image: postgres | ||
ports: | ||
- 5432:5432 | ||
env: | ||
POSTGRES_DB: lion_database | ||
POSTGRES_USER: root | ||
POSTGRES_PASSWORD: lion | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install system dependencies | ||
run: | | ||
sudo apt-get update -y | ||
sudo apt-get install -y git curl wget unzip libpq-dev libpng-dev libzip-dev zlib1g-dev libonig-dev libevent-dev libssl-dev | ||
sudo apt-get clean | ||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 8.4 | ||
extensions: mbstring, gd, zip, pdo, pdo_mysql, pdo_pgsql, redis, xdebug | ||
coverage: xdebug | ||
ini-values: | | ||
xdebug.mode=develop,coverage,debug | ||
xdebug.start_with_request=yes | ||
xdebug.log_level=0 | ||
tools: composer | ||
|
||
- name: Setup NodeJS and NPM | ||
run: | | ||
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash | ||
export NVM_DIR="$HOME/.nvm" | ||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # Esto carga nvm | ||
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # Esto carga nvm bash_completion | ||
nvm install 20 | ||
nvm use 20 | ||
npm install -g npm@11 | ||
- name: Copy .env.actions to .env | ||
run: | | ||
if [ -f .env.actions ]; then | ||
cp .env.actions .env | ||
else | ||
echo ".env.actions not found! Please make sure the file exists." | ||
exit 1 | ||
fi | ||
- name: Install php dependencies | ||
run: composer install | ||
|
||
- name: Start PHP built-in server | ||
run: | | ||
nohup php -S 0.0.0.0:8000 -t public & | ||
- name: Generate RSA Key's | ||
run: php lion new:rsa | ||
|
||
- name: Run tests | ||
run: php lion test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,4 @@ | |
/database/ | ||
test.txt | ||
supervisord.pid | ||
composer.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.