Skip to content

Merge branch 'main' into craft4 #8

Merge branch 'main' into craft4

Merge branch 'main' into craft4 #8

Workflow file for this run

name: CI
on:
workflow_dispatch:
push:
branches:
- main
- develop
- craft4
pull_request:
branches:
- main
jobs:
ecs:
name: ECS Check
runs-on: ubuntu-latest
env:
DEFAULT_COMPOSER_FLAGS: "--no-interaction --no-ansi --no-progress --no-suggest"
steps:
- uses: actions/checkout@v2
- uses: shivammathur/[email protected]
with:
php-version: 8.1
- run: composer install --prefer-dist --no-progress --no-suggest
- name: Run ecs check
run: |
composer run-script ecs-check
rector:
name: Rector dry-run
runs-on: ubuntu-latest
env:
DEFAULT_COMPOSER_FLAGS: "--no-interaction --no-ansi --no-progress --no-suggest"
steps:
- uses: actions/checkout@v2
- uses: shivammathur/[email protected]
with:
php-version: 8.1
- run: composer install --prefer-dist --no-progress --no-suggest
- name: Run rector --dry-run
run: |
composer run-script rector-dry-run
phpstan:
name: PHPStan
runs-on: ubuntu-latest
env:
DEFAULT_COMPOSER_FLAGS: "--no-interaction --no-ansi --no-progress --no-suggest"
steps:
- uses: actions/checkout@v2
- uses: shivammathur/[email protected]
with:
php-version: 8.1
- run: composer install --prefer-dist --no-progress --no-suggest
- name: Run phpstan
run: |
composer run-script phpstan
test:
name: PHP ${{ matrix.php-versions }} + ${{ matrix.db }} on ${{ matrix.operating-system }}
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: [ubuntu-latest]
php-versions: ["8.0", "8.1"]
db: ["mysql", "pgsql"]
env:
DEFAULT_COMPOSER_FLAGS: "--no-interaction --no-ansi --no-progress --no-suggest"
services:
mysql:
image: mysql:5.7
env:
MYSQL_ALLOW_EMPTY_PASSWORD: false
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: test
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
redis:
image: redis
ports:
- 6379:6379
options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3
postgres:
image: postgres:12
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: test
ports:
- 5432:5432
options: --health-cmd="pg_isready" --health-interval=10s --health-timeout=5s --health-retries=3
steps:
- uses: actions/checkout@v2
- name: Setup PHP Action
uses: shivammathur/[email protected]
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, intl, gd, imagick, zip, dom, pdo_mysql, pdo_pgsql, fileinfo
ini-values: post_max_size=256M
tools: php-cs-fixer, phpunit
- name: Validate composer.json and composer.lock
run: composer validate
- name: Install Composer dependencies
run: composer install --prefer-dist --no-progress --no-suggest
- name: Prepare the application
run: cp .github/workflows/.env.${{ matrix.db }} tests/.env
- name: Test with Codeception
run: |
vendor/bin/codecept run unit
vendor/bin/codecept run functional
env:
SECURITY_KEY: abcde12345
DEFAULT_SITE_URL: http://snipcart-craft-plugin.test/index.php
FROM_EMAIL_NAME: Craft CMS
FROM_EMAIL_ADDRESS: [email protected]