mirror of
				https://github.com/pelican-dev/panel.git
				synced 2025-10-31 02:56:52 +01:00 
			
		
		
		
	 8261184b57
			
		
	
	
		8261184b57
		
			
		
	
	
	
	
		
			
			* Just skip this table because it no longer exists * Add postgresql * This no longer needs to be there * These are the same output in mysql, but different in postgresql * Fix these migrations for postgresql * This table no longer exists * This is expected to be a json column for json operations, required for postgresql * Shoot for the stars * Fix pint * Why was this missing * Updates * Restore this * This needs to be explicit * Don’t like strings * Fix these classes * Use different method to compare dates * Apparently postgresql doesn’t like case insensitivity * Postgresql orders it backwards * Ordered different by postgresql * Unnecessary and breaking * Make sure the order is correct for postresql * Fix this with the order too * Remove this * Force email to be lowercased * Update app/Models/User.php
		
			
				
	
	
		
			292 lines
		
	
	
		
			8.1 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			292 lines
		
	
	
		
			8.1 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
| name: Tests
 | |
| 
 | |
| on:
 | |
|   push:
 | |
|     branches:
 | |
|       - main
 | |
|   pull_request:
 | |
| 
 | |
| jobs:
 | |
|   mysql:
 | |
|     name: MySQL
 | |
|     runs-on: ubuntu-latest
 | |
|     strategy:
 | |
|       fail-fast: false
 | |
|       matrix:
 | |
|         php: [8.2, 8.3, 8.4]
 | |
|         database: ["mysql:8"]
 | |
|     services:
 | |
|       database:
 | |
|         image: ${{ matrix.database }}
 | |
|         env:
 | |
|           MYSQL_ALLOW_EMPTY_PASSWORD: yes
 | |
|           MYSQL_DATABASE: testing
 | |
|         ports:
 | |
|           - 3306
 | |
|         options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
 | |
|     env:
 | |
|       APP_ENV: testing
 | |
|       APP_DEBUG: "false"
 | |
|       APP_KEY: ThisIsARandomStringForTests12345
 | |
|       APP_TIMEZONE: UTC
 | |
|       APP_URL: http://localhost/
 | |
|       CACHE_DRIVER: array
 | |
|       MAIL_MAILER: array
 | |
|       SESSION_DRIVER: array
 | |
|       QUEUE_CONNECTION: sync
 | |
|       DB_CONNECTION: mysql
 | |
|       DB_HOST: 127.0.0.1
 | |
|       DB_DATABASE: testing
 | |
|       DB_USERNAME: root
 | |
|       GUZZLE_TIMEOUT: 60
 | |
|       GUZZLE_CONNECT_TIMEOUT: 60
 | |
|     steps:
 | |
|       - name: Code Checkout
 | |
|         uses: actions/checkout@v4
 | |
| 
 | |
|       - name: Get cache directory
 | |
|         id: composer-cache
 | |
|         run: |
 | |
|           echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
 | |
| 
 | |
|       - name: Cache
 | |
|         uses: actions/cache@v4
 | |
|         with:
 | |
|           path: ${{ steps.composer-cache.outputs.dir }}
 | |
|           key: ${{ runner.os }}-composer-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
 | |
|           restore-keys: |
 | |
|             ${{ runner.os }}-composer-${{ matrix.php }}-
 | |
| 
 | |
|       - name: Setup PHP
 | |
|         uses: shivammathur/setup-php@v2
 | |
|         with:
 | |
|           php-version: ${{ matrix.php }}
 | |
|           extensions: bcmath, curl, gd, mbstring, mysql, openssl, pdo, tokenizer, xml, zip
 | |
|           tools: composer:v2
 | |
|           coverage: none
 | |
| 
 | |
|       - name: Install dependencies
 | |
|         run: composer install --no-interaction --no-suggest --no-progress --no-scripts
 | |
| 
 | |
|       - name: Unit tests
 | |
|         run: vendor/bin/pest tests/Unit
 | |
|         env:
 | |
|           DB_HOST: UNIT_NO_DB
 | |
|           SKIP_MIGRATIONS: true
 | |
| 
 | |
|       - name: Integration tests
 | |
|         run: vendor/bin/pest tests/Integration
 | |
|         env:
 | |
|           DB_PORT: ${{ job.services.database.ports[3306] }}
 | |
|           DB_USERNAME: root
 | |
| 
 | |
|   mariadb:
 | |
|     name: MariaDB
 | |
|     runs-on: ubuntu-latest
 | |
|     strategy:
 | |
|       fail-fast: false
 | |
|       matrix:
 | |
|         php: [8.2, 8.3, 8.4]
 | |
|         database: ["mariadb:10.6", "mariadb:10.11", "mariadb:11.4"]
 | |
|     services:
 | |
|       database:
 | |
|         image: ${{ matrix.database }}
 | |
|         env:
 | |
|           MYSQL_ALLOW_EMPTY_PASSWORD: yes
 | |
|           MYSQL_DATABASE: testing
 | |
|         ports:
 | |
|           - 3306
 | |
|         options: --health-cmd="mariadb-admin ping || mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
 | |
|     env:
 | |
|       APP_ENV: testing
 | |
|       APP_DEBUG: "false"
 | |
|       APP_KEY: ThisIsARandomStringForTests12345
 | |
|       APP_TIMEZONE: UTC
 | |
|       APP_URL: http://localhost/
 | |
|       CACHE_DRIVER: array
 | |
|       MAIL_MAILER: array
 | |
|       SESSION_DRIVER: array
 | |
|       QUEUE_CONNECTION: sync
 | |
|       DB_CONNECTION: mariadb
 | |
|       DB_HOST: 127.0.0.1
 | |
|       DB_DATABASE: testing
 | |
|       DB_USERNAME: root
 | |
|       GUZZLE_TIMEOUT: 60
 | |
|       GUZZLE_CONNECT_TIMEOUT: 60
 | |
|     steps:
 | |
|       - name: Code Checkout
 | |
|         uses: actions/checkout@v4
 | |
| 
 | |
|       - name: Get cache directory
 | |
|         id: composer-cache
 | |
|         run: |
 | |
|           echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
 | |
| 
 | |
|       - name: Cache
 | |
|         uses: actions/cache@v4
 | |
|         with:
 | |
|           path: ${{ steps.composer-cache.outputs.dir }}
 | |
|           key: ${{ runner.os }}-composer-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
 | |
|           restore-keys: |
 | |
|             ${{ runner.os }}-composer-${{ matrix.php }}-
 | |
| 
 | |
|       - name: Setup PHP
 | |
|         uses: shivammathur/setup-php@v2
 | |
|         with:
 | |
|           php-version: ${{ matrix.php }}
 | |
|           extensions: bcmath, curl, gd, mbstring, mysql, openssl, pdo, tokenizer, xml, zip
 | |
|           tools: composer:v2
 | |
|           coverage: none
 | |
| 
 | |
|       - name: Install dependencies
 | |
|         run: composer install --no-interaction --no-suggest --no-progress --no-scripts
 | |
| 
 | |
|       - name: Unit tests
 | |
|         run: vendor/bin/pest tests/Unit
 | |
|         env:
 | |
|           DB_HOST: UNIT_NO_DB
 | |
|           SKIP_MIGRATIONS: true
 | |
| 
 | |
|       - name: Integration tests
 | |
|         run: vendor/bin/pest tests/Integration
 | |
|         env:
 | |
|           DB_PORT: ${{ job.services.database.ports[3306] }}
 | |
|           DB_USERNAME: root
 | |
| 
 | |
|   sqlite:
 | |
|     name: SQLite
 | |
|     runs-on: ubuntu-latest
 | |
|     strategy:
 | |
|       fail-fast: false
 | |
|       matrix:
 | |
|         php: [8.2, 8.3, 8.4]
 | |
|     env:
 | |
|       APP_ENV: testing
 | |
|       APP_DEBUG: "false"
 | |
|       APP_KEY: ThisIsARandomStringForTests12345
 | |
|       APP_TIMEZONE: UTC
 | |
|       APP_URL: http://localhost/
 | |
|       CACHE_DRIVER: array
 | |
|       MAIL_MAILER: array
 | |
|       SESSION_DRIVER: array
 | |
|       QUEUE_CONNECTION: sync
 | |
|       DB_CONNECTION: sqlite
 | |
|       DB_DATABASE: testing.sqlite
 | |
|       GUZZLE_TIMEOUT: 60
 | |
|       GUZZLE_CONNECT_TIMEOUT: 60
 | |
|     steps:
 | |
|       - name: Code Checkout
 | |
|         uses: actions/checkout@v4
 | |
| 
 | |
|       - name: Get cache directory
 | |
|         id: composer-cache
 | |
|         run: |
 | |
|           echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
 | |
| 
 | |
|       - name: Cache
 | |
|         uses: actions/cache@v4
 | |
|         with:
 | |
|           path: ${{ steps.composer-cache.outputs.dir }}
 | |
|           key: ${{ runner.os }}-composer-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
 | |
|           restore-keys: |
 | |
|             ${{ runner.os }}-composer-${{ matrix.php }}-
 | |
| 
 | |
|       - name: Setup PHP
 | |
|         uses: shivammathur/setup-php@v2
 | |
|         with:
 | |
|           php-version: ${{ matrix.php }}
 | |
|           extensions: bcmath, curl, gd, mbstring, mysql, openssl, pdo, tokenizer, xml, zip
 | |
|           tools: composer:v2
 | |
|           coverage: none
 | |
| 
 | |
|       - name: Install dependencies
 | |
|         run: composer install --no-interaction --no-suggest --no-progress --no-scripts
 | |
| 
 | |
|       - name: Create SQLite file
 | |
|         run: touch database/testing.sqlite
 | |
| 
 | |
|       - name: Unit tests
 | |
|         run: vendor/bin/pest tests/Unit
 | |
|         env:
 | |
|           DB_HOST: UNIT_NO_DB
 | |
|           SKIP_MIGRATIONS: true
 | |
| 
 | |
|       - name: Integration tests
 | |
|         run: vendor/bin/pest tests/Integration
 | |
| 
 | |
|   postgresql:
 | |
|     name: PostgreSQL
 | |
|     runs-on: ubuntu-latest
 | |
|     strategy:
 | |
|       fail-fast: false
 | |
|       matrix:
 | |
|         php: [8.2, 8.3, 8.4]
 | |
|         database: ["postgres:14"]
 | |
|     services:
 | |
|       database:
 | |
|         image: ${{ matrix.database }}
 | |
|         env:
 | |
|           POSTGRES_DB: testing
 | |
|           POSTGRES_USER: postgres
 | |
|           POSTGRES_PASSWORD: postgres
 | |
|           POSTGRES_HOST_AUTH_METHOD: trust
 | |
|         ports:
 | |
|           - 5432:5432
 | |
|         options: >-
 | |
|           --health-cmd pg_isready
 | |
|           --health-interval 10s
 | |
|           --health-timeout 5s
 | |
|           --health-retries 5
 | |
|     env:
 | |
|       APP_ENV: testing
 | |
|       APP_DEBUG: "false"
 | |
|       APP_KEY: ThisIsARandomStringForTests12345
 | |
|       APP_TIMEZONE: UTC
 | |
|       APP_URL: http://localhost/
 | |
|       CACHE_DRIVER: array
 | |
|       MAIL_MAILER: array
 | |
|       SESSION_DRIVER: array
 | |
|       QUEUE_CONNECTION: sync
 | |
|       DB_CONNECTION: pgsql
 | |
|       DB_HOST: 127.0.0.1
 | |
|       DB_DATABASE: testing
 | |
|       DB_USERNAME: postgres
 | |
|       DB_PASSWORD: postgres
 | |
|       GUZZLE_TIMEOUT: 60
 | |
|       GUZZLE_CONNECT_TIMEOUT: 60
 | |
|     steps:
 | |
|       - name: Code Checkout
 | |
|         uses: actions/checkout@v4
 | |
| 
 | |
|       - name: Get cache directory
 | |
|         id: composer-cache
 | |
|         run: |
 | |
|           echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
 | |
| 
 | |
|       - name: Cache
 | |
|         uses: actions/cache@v4
 | |
|         with:
 | |
|           path: ${{ steps.composer-cache.outputs.dir }}
 | |
|           key: ${{ runner.os }}-composer-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
 | |
|           restore-keys: |
 | |
| 
 | |
|       - name: Setup PHP
 | |
|         uses: shivammathur/setup-php@v2
 | |
|         with:
 | |
|           php-version: ${{ matrix.php }}
 | |
|           extensions: bcmath, curl, gd, mbstring, mysql, openssl, pdo, tokenizer, xml, zip
 | |
|           tools: composer:v2
 | |
|           coverage: none
 | |
| 
 | |
|       - name: Install dependencies
 | |
|         run: composer install --no-interaction --no-suggest --no-progress --no-scripts
 | |
| 
 | |
|       - name: Unit tests
 | |
|         run: vendor/bin/pest tests/Unit
 | |
|         env:
 | |
|           DB_HOST: UNIT_NO_DB
 | |
|           SKIP_MIGRATIONS: true
 | |
| 
 | |
|       - name: Integration tests
 | |
|         run: vendor/bin/pest tests/Integration
 |