Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CI #1482

Merged
merged 11 commits into from
Mar 10, 2021
Merged

Fix CI #1482

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions .ci/link_devtools.sh

This file was deleted.

272 changes: 136 additions & 136 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,141 +1,141 @@
name: "Tests"

on: [push, pull_request]
on: [ push, pull_request ]

jobs:
run-tests:
name: PHP ${{ matrix.php-versions }}
runs-on: ubuntu-latest
run-tests:
name: PHP ${{ matrix.php-versions }}
runs-on: ubuntu-latest
env:
extensions: mbstring, intl, json, zip, phalcon-4.0.5, mysql, pgsql, xdebug-2.9.8
key: cache-v2.0~19.03.2020
services:
mysql:
image: mysql:5.7
env:
extensions: mbstring, intl, json, zip, phalcon-4.0.5, mysql, pgsql, xdebug
key: cache-v2.0~19.03.2020
services:
mysql:
image: mysql:5.7
env:
MYSQL_DATABASE: devtools
MYSQL_ROOT_PASSWORD: root
ports:
- 3306/tcp
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
postgres:
image: postgres:10.8
ports:
- 5432/tcp
env:
POSTGRES_DB: devtools
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
strategy:
fail-fast: false
matrix:
php-versions: ['7.2', '7.3']
steps:
- uses: actions/checkout@v1

- name: Setup cache environment
id: cache-env
uses: shivammathur/cache-extensions@v1
with:
php-version: ${{ matrix.php-versions }}
extensions: ${{ env.extensions }}
key: ${{ env.key }}

- name: Cache extensions
uses: actions/cache@v1
with:
path: ${{ steps.cache-env.outputs.dir }}
key: ${{ steps.cache-env.outputs.key }}
restore-keys: ${{ steps.cache-env.outputs.key }}

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: ${{ env.extensions }}
tools: pecl

- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache composer dependencies
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install Composer dependencies
run: |
composer install --prefer-dist --no-suggest
composer require --dev phpstan/phpstan

- name: Initialise DataBase
env:
MYSQL_DB_PASSWORD: 'root'
MYSQL_DB_PORT: ${{ job.services.mysql.ports['3306'] }}
POSTGRES_DB_PORT: ${{ job.services.postgres.ports['5432'] }}
run: bash tests/_ci/setup_dbs_github.sh

- name: Symbolic link Phalcon devtools
run: bash ./.ci/link_devtools.sh

- name: Init Webtools and add ports in database setup
env:
MYSQL_DB_PASSWORD: 'root'
MYSQL_DB_PORT: ${{ job.services.mysql.ports['3306'] }}
POSTGRES_DB_PORT: ${{ job.services.postgres.ports['5432'] }}
run: bash ./.ci/serve-webtools.sh

- name: Setup tests
run: |
cp tests/.env.test .env
bash ./.ci/github_set_env.sh
mkdir .phalcon
vendor/bin/codecept build
vendor/bin/phpcs

- name: Run test suites
env:
MYSQL_DB_PASSWORD: 'root'
MYSQL_DB_PORT: ${{ job.services.mysql.ports['3306'] }}
POSTGRES_DB_PORT: ${{ job.services.postgres.ports['5432'] }}
if: success()
run: |
vendor/bin/codecept run --ext DotReporter acceptance -g mysql --env mysql
vendor/bin/codecept run --ext DotReporter acceptance -g pgsql --env pgsql
vendor/bin/codecept run --ext DotReporter acceptance -g common --coverage-xml=coverage-common-${{ matrix.php-versions }}.xml
vendor/bin/codecept run --ext DotReporter unit --coverage-xml=coverage-unit-${{ matrix.php-versions }}.xml
vendor/bin/codecept run --ext DotReporter functional --coverage-xml=coverage-functional-${{ matrix.php-versions }}.xml
vendor/bin/codecept run --ext DotReporter console --coverage-xml=coverage-console-${{ matrix.php-versions }}.xml

- name: If fail - Check Config file
env:
MYSQL_DB_PORT: ${{ job.services.mysql.ports['3306'] }}
POSTGRES_DB_PORT: ${{ job.services.postgres.ports['5432'] }}
if: failure()
run: |
cat webtools/app/config/config.php
cat webtools/app/config/services.php
echo "<?php print_r(include('webtools/app/config/config.php')) ?>" > content_config.php
php content_config.php
php tests/debug.php

- uses: actions/upload-artifact@v1
if: failure()
with:
name: Codeception Logs
path: tests/_output

- name: Check psalm
run: vendor/bin/psalm --show-info=false

- name: Check phpstan
run: vendor/bin/phpstan analyse -l 5 -c phpstan.neon src -v

- name: Upload coverage to Codecov
if: success()
uses: codecov/codecov-action@v1
with:
token: ${{secrets.CODECOV_TOKEN}}
file: ./tests/_output/coverage-*.xml
MYSQL_DATABASE: devtools
MYSQL_ROOT_PASSWORD: root
ports:
- 3306/tcp
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
postgres:
image: postgres:10.8
ports:
- 5432/tcp
env:
POSTGRES_DB: devtools
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
strategy:
fail-fast: false
matrix:
php-versions: [ '7.2', '7.3', '7.4' ]
steps:
- uses: actions/checkout@v1

- name: Setup cache environment
id: cache-env
uses: shivammathur/cache-extensions@v1
with:
php-version: ${{ matrix.php-versions }}
extensions: ${{ env.extensions }}
key: ${{ env.key }}

- name: Cache extensions
uses: actions/cache@v1
with:
path: ${{ steps.cache-env.outputs.dir }}
key: ${{ steps.cache-env.outputs.key }}
restore-keys: ${{ steps.cache-env.outputs.key }}

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: ${{ env.extensions }}
tools: pecl

- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache composer dependencies
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- name: Install Composer dependencies
run: |
composer install --prefer-dist --no-suggest
composer require --dev phpstan/phpstan

- name: Initialise DataBase
env:
MYSQL_DB_PASSWORD: 'root'
MYSQL_DB_PORT: ${{ job.services.mysql.ports['3306'] }}
POSTGRES_DB_PORT: ${{ job.services.postgres.ports['5432'] }}
run: bash tests/_ci/setup_dbs_github.sh

- name: Symbolic link Phalcon devtools
run: sudo ln -s "$(pwd)/phalcon" /usr/local/bin/phalcon

- name: Init Webtools and add ports in database setup
env:
MYSQL_DB_PASSWORD: 'root'
MYSQL_DB_PORT: ${{ job.services.mysql.ports['3306'] }}
POSTGRES_DB_PORT: ${{ job.services.postgres.ports['5432'] }}
run: bash ./.ci/serve-webtools.sh

- name: Setup tests
run: |
cp tests/.env.test .env
bash ./.ci/github_set_env.sh
mkdir .phalcon
vendor/bin/codecept build
vendor/bin/phpcs

- name: Run test suites
env:
MYSQL_DB_PASSWORD: 'root'
MYSQL_DB_PORT: ${{ job.services.mysql.ports['3306'] }}
POSTGRES_DB_PORT: ${{ job.services.postgres.ports['5432'] }}
if: success()
run: |
vendor/bin/codecept run --ext DotReporter acceptance -g mysql --env mysql
vendor/bin/codecept run --ext DotReporter acceptance -g pgsql --env pgsql
vendor/bin/codecept run --ext DotReporter acceptance -g common --coverage-xml=coverage-common-${{ matrix.php-versions }}.xml
vendor/bin/codecept run --ext DotReporter unit --coverage-xml=coverage-unit-${{ matrix.php-versions }}.xml
vendor/bin/codecept run --ext DotReporter functional --coverage-xml=coverage-functional-${{ matrix.php-versions }}.xml
vendor/bin/codecept run --ext DotReporter console --coverage-xml=coverage-console-${{ matrix.php-versions }}.xml

- name: If fail - Check Config file
env:
MYSQL_DB_PORT: ${{ job.services.mysql.ports['3306'] }}
POSTGRES_DB_PORT: ${{ job.services.postgres.ports['5432'] }}
if: failure()
run: |
cat webtools/app/config/config.php
cat webtools/app/config/services.php
echo "<?php print_r(include('webtools/app/config/config.php')) ?>" > content_config.php
php content_config.php
php tests/debug.php

- uses: actions/upload-artifact@v1
if: failure()
with:
name: Codeception Logs
path: tests/_output

#- name: Check psalm
# run: vendor/bin/psalm --show-info=false

#- name: Check phpstan
# run: vendor/bin/phpstan analyse -l 5 -c phpstan.neon src -v

- name: Upload coverage to Codecov
if: success()
uses: codecov/codecov-action@v1
with:
token: ${{secrets.CODECOV_TOKEN}}
file: ./tests/_output/coverage-*.xml
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@
#
# https://help.github.com/articles/ignoring-files/#create-a-global-gitignore

/composer.lock
/vendor
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"codeception/verify": "^1.2",
"squizlabs/php_codesniffer": "^3.5",
"phalcon/ide-stubs": "^4.0.0",
"vimeo/psalm": "^3.7",
"vimeo/psalm": "^4.6",
"codeception/module-phpbrowser": "^1.0",
"codeception/module-filesystem": "^1.0",
"codeception/module-asserts": "^1.3",
Expand Down
Loading