2022-11-28 16:56:03 +00:00
|
|
|
name: Laravel
|
2022-10-14 16:59:20 +00:00
|
|
|
|
2020-06-28 22:17:36 +00:00
|
|
|
on:
|
|
|
|
push:
|
2021-09-11 19:20:04 +00:00
|
|
|
branches:
|
2022-10-26 16:43:05 +00:00
|
|
|
- "develop"
|
|
|
|
- "1.0-develop"
|
2020-06-28 22:17:36 +00:00
|
|
|
pull_request:
|
2022-10-26 16:43:05 +00:00
|
|
|
branches:
|
|
|
|
- "develop"
|
|
|
|
- "1.0-develop"
|
2022-10-14 16:59:20 +00:00
|
|
|
|
2020-06-28 22:17:36 +00:00
|
|
|
jobs:
|
2022-11-28 16:56:03 +00:00
|
|
|
analysis:
|
|
|
|
name: Static Analysis
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
env:
|
|
|
|
APP_ENV: testing
|
|
|
|
APP_DEBUG: "true"
|
|
|
|
APP_KEY: SomeRandomString3232RandomString
|
|
|
|
CACHE_DRIVER: array
|
|
|
|
MAIL_MAILER: array
|
|
|
|
SESSION_DRIVER: array
|
|
|
|
QUEUE_CONNECTION: sync
|
|
|
|
steps:
|
|
|
|
- name: Code checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Setup PHP
|
|
|
|
uses: shivammathur/setup-php@v2
|
|
|
|
with:
|
|
|
|
php-version: 8.1
|
|
|
|
extensions: bcmath, cli, curl, gd, mbstring, mysql, openssl, pdo, tokenizer, xml, zip
|
|
|
|
tools: composer:v2
|
|
|
|
coverage: none
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: composer install --no-interaction --no-progress --no-suggest --prefer-dist
|
|
|
|
|
|
|
|
- name: Analyze
|
|
|
|
run: vendor/bin/phpstan analyse
|
|
|
|
|
|
|
|
lint:
|
|
|
|
name: Lint
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
|
|
|
- name: Code checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Setup PHP
|
|
|
|
uses: shivammathur/setup-php@v2
|
|
|
|
with:
|
|
|
|
php-version: 8.1
|
|
|
|
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-progress --no-suggest --prefer-dist
|
|
|
|
|
|
|
|
- name: PHP CS Fixer
|
|
|
|
run: vendor/bin/php-cs-fixer fix --dry-run --diff
|
|
|
|
|
2022-11-25 20:29:04 +00:00
|
|
|
mysql:
|
2022-11-29 17:53:59 +00:00
|
|
|
name: Tests
|
2021-09-11 19:20:04 +00:00
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2022-11-25 20:29:04 +00:00
|
|
|
php: [8.1]
|
|
|
|
database: ["mariadb:10.2", "mariadb:10.9", "mysql:8"]
|
2020-06-28 22:17:36 +00:00
|
|
|
services:
|
2021-09-11 19:20:04 +00:00
|
|
|
database:
|
2022-11-25 20:29:04 +00:00
|
|
|
image: docker.io/library/${{ matrix.database }}
|
2021-04-17 19:10:40 +00:00
|
|
|
env:
|
|
|
|
MYSQL_ALLOW_EMPTY_PASSWORD: yes
|
2022-10-31 17:38:56 +00:00
|
|
|
MYSQL_DATABASE: testing
|
2021-04-17 19:10:40 +00:00
|
|
|
ports:
|
2022-11-25 20:29:04 +00:00
|
|
|
- 3306/tcp
|
2021-04-17 19:10:40 +00:00
|
|
|
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
|
2022-11-25 20:29:04 +00:00
|
|
|
env:
|
|
|
|
APP_ENV: testing
|
|
|
|
APP_DEBUG: "true"
|
|
|
|
APP_KEY: SomeRandomString3232RandomString
|
|
|
|
APP_THEME: pterodactyl
|
|
|
|
APP_TIMEZONE: UTC
|
|
|
|
APP_URL: http://localhost/
|
|
|
|
APP_ENVIRONMENT_ONLY: "true"
|
|
|
|
CACHE_DRIVER: array
|
|
|
|
MAIL_MAILER: array
|
|
|
|
SESSION_DRIVER: array
|
|
|
|
QUEUE_CONNECTION: sync
|
|
|
|
HASHIDS_SALT: test123
|
2022-11-28 16:56:03 +00:00
|
|
|
DB_CONNECTION: mysql
|
|
|
|
DB_HOST: 127.0.0.1
|
|
|
|
DB_DATABASE: testing
|
|
|
|
DB_USERNAME: root
|
2020-06-28 22:17:36 +00:00
|
|
|
steps:
|
2022-11-28 16:56:03 +00:00
|
|
|
- name: Code checkout
|
2022-10-14 16:59:20 +00:00
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Get cache directory
|
2020-06-28 22:22:39 +00:00
|
|
|
id: composer-cache
|
|
|
|
run: |
|
2022-10-26 16:43:05 +00:00
|
|
|
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
2022-10-14 16:59:20 +00:00
|
|
|
|
|
|
|
- name: Cache
|
|
|
|
uses: actions/cache@v3
|
2020-06-28 22:22:39 +00:00
|
|
|
with:
|
2022-10-26 16:43:05 +00:00
|
|
|
path: ${{ steps.composer-cache.outputs.dir }}
|
|
|
|
key: ${{ runner.os }}-composer-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-composer-${{ matrix.php }}-
|
2022-10-14 16:59:20 +00:00
|
|
|
|
|
|
|
- name: Setup PHP
|
|
|
|
uses: shivammathur/setup-php@v2
|
2020-06-28 22:17:36 +00:00
|
|
|
with:
|
|
|
|
php-version: ${{ matrix.php }}
|
2021-09-11 19:20:04 +00:00
|
|
|
extensions: bcmath, cli, curl, gd, mbstring, mysql, openssl, pdo, tokenizer, xml, zip
|
2021-01-23 20:09:16 +00:00
|
|
|
tools: composer:v2
|
2020-06-28 22:17:36 +00:00
|
|
|
coverage: none
|
2022-10-14 16:59:20 +00:00
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: composer install --no-interaction --no-progress --no-suggest --prefer-dist
|
|
|
|
|
|
|
|
- name: Unit tests
|
2021-09-11 19:13:15 +00:00
|
|
|
run: vendor/bin/phpunit --bootstrap vendor/autoload.php tests/Unit
|
2020-06-28 22:31:06 +00:00
|
|
|
env:
|
2022-05-05 00:41:04 +00:00
|
|
|
DB_HOST: UNIT_NO_DB
|
2022-10-14 16:59:20 +00:00
|
|
|
|
|
|
|
- name: Integration tests
|
2021-04-17 19:10:40 +00:00
|
|
|
run: vendor/bin/phpunit tests/Integration
|
|
|
|
env:
|
2022-05-05 00:41:04 +00:00
|
|
|
DB_PORT: ${{ job.services.database.ports[3306] }}
|
2022-11-25 20:29:04 +00:00
|
|
|
|
|
|
|
postgres:
|
2022-11-29 17:53:59 +00:00
|
|
|
name: Tests
|
2022-11-25 20:29:04 +00:00
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
if: "!contains(github.event.head_commit.message, 'skip ci') && !contains(github.event.head_commit.message, 'ci skip')"
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
php: [8.1]
|
|
|
|
database: ["postgres:13", "postgres:14", "postgres:15"]
|
|
|
|
services:
|
|
|
|
database:
|
|
|
|
image: docker.io/library/${{ matrix.database }}
|
|
|
|
env:
|
|
|
|
POSTGRES_USER: postgres
|
|
|
|
POSTGRES_PASSWORD: postgres
|
|
|
|
POSTGRES_DB: testing
|
|
|
|
ports:
|
|
|
|
- 5432/tcp
|
|
|
|
options: --health-cmd=pg_isready --health-interval=10s --health-timeout=5s --health-retries=3
|
|
|
|
env:
|
|
|
|
APP_ENV: testing
|
|
|
|
APP_DEBUG: "true"
|
|
|
|
APP_KEY: SomeRandomString3232RandomString
|
|
|
|
APP_THEME: pterodactyl
|
|
|
|
APP_TIMEZONE: UTC
|
|
|
|
APP_URL: http://localhost/
|
|
|
|
APP_ENVIRONMENT_ONLY: "true"
|
|
|
|
CACHE_DRIVER: array
|
|
|
|
MAIL_MAILER: array
|
|
|
|
SESSION_DRIVER: array
|
|
|
|
QUEUE_CONNECTION: sync
|
|
|
|
HASHIDS_SALT: test123
|
2022-11-28 16:56:03 +00:00
|
|
|
DB_CONNECTION: pgsql
|
|
|
|
DB_HOST: 127.0.0.1
|
|
|
|
DB_DATABASE: testing
|
|
|
|
DB_USERNAME: postgres
|
|
|
|
DB_PASSWORD: postgres
|
2022-11-25 20:29:04 +00:00
|
|
|
steps:
|
2022-11-28 16:56:03 +00:00
|
|
|
- name: Code checkout
|
2022-11-25 20:29:04 +00:00
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Get cache directory
|
|
|
|
id: composer-cache
|
|
|
|
run: |
|
2022-11-28 16:56:03 +00:00
|
|
|
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
|
2022-11-25 20:29:04 +00:00
|
|
|
|
|
|
|
- name: Cache
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
2022-11-28 16:56:03 +00:00
|
|
|
path: ${{ steps.composer-cache.outputs.dir }}
|
|
|
|
key: ${{ runner.os }}-composer-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-composer-${{ matrix.php }}-
|
2022-11-25 20:29:04 +00:00
|
|
|
|
|
|
|
- name: Setup PHP
|
|
|
|
uses: shivammathur/setup-php@v2
|
|
|
|
with:
|
|
|
|
php-version: ${{ matrix.php }}
|
|
|
|
extensions: bcmath, cli, curl, gd, mbstring, mysql, openssl, pdo, tokenizer, xml, zip
|
|
|
|
tools: composer:v2
|
|
|
|
coverage: none
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: composer install --no-interaction --no-progress --no-suggest --prefer-dist
|
|
|
|
|
|
|
|
- name: Unit tests
|
|
|
|
run: vendor/bin/phpunit --bootstrap vendor/autoload.php tests/Unit
|
|
|
|
env:
|
|
|
|
DB_HOST: UNIT_NO_DB
|
|
|
|
|
|
|
|
- name: Integration tests
|
|
|
|
run: vendor/bin/phpunit tests/Integration
|
|
|
|
env:
|
|
|
|
DB_PORT: ${{ job.services.database.ports[5432] }}
|