Skip to content

Commit

Permalink
Merge pull request #3 from tacxticx88/feature/implements-gh-actions
Browse files Browse the repository at this point in the history
Feature/implements github actions
  • Loading branch information
Jeckerson authored Aug 31, 2020
2 parents 7a40df3 + 5dfafdd commit ca28462
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 14 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/static-code-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Static Code Analysis
on: [push, pull_request]

jobs:
phpcs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2-beta
with:
fetch-depth: 1
- name: Run PHP_CodeSniffer
run: docker run --rm -v $(pwd):/data cytopia/phpcs --standard=./phpcs.xml.dist
59 changes: 59 additions & 0 deletions .github/workflows/testing-suite.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Testing Suite
on: [push, pull_request]

jobs:
build-and-test-linux:
services:
mongodb:
image: mongo:4.2
ports:
- 27017:27017
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: [ubuntu-latest]
php-versions: ['7.4']

name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}
steps:

- name: Git checkout
uses: actions/checkout@v2-beta
with:
fetch-depth: 1

- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Setup Cache
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Setup Composer Token
run: |
# To increase the Composer rate limit we're use GitHub authentication
if [ -n "${{ secrets.COMPOSER_TOKEN }}" ]; then
composer config github-oauth.github.com "${{ secrets.COMPOSER_TOKEN }}"
fi
- name: Setup PHP
uses: shivammathur/setup-php@v1
with:
php-version: ${{ matrix.php-versions }}
ini-values: apc.enable_cli=on, session.save_path=/tmp
tools: pecl
extensions: mbstring, intl, json, imagick, phalcon

- name: Install packages
run: composer install --prefer-dist

- name: Setup tests
run: |
cp tests/_ci/.env.default .env
vendor/bin/codecept build
- name: Run integration tests
run: vendor/bin/codecept run --ext DotReporter integration --coverage --coverage-xml
6 changes: 3 additions & 3 deletions codeception.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ settings:
memory_limit: 1024M
lint: true

coverage:
# Disable Code Coverage by default to speed up Travis tests
enabled: false
#coverage:
# # Disable Code Coverage by default to speed up Travis tests
# enabled: false

extensions:
enabled:
Expand Down
10 changes: 5 additions & 5 deletions tests/_ci/.env.default
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ PATH_OUTPUT="${PROJECT_PATH}tests/_output/"
PATH_FIXTURES="${PROJECT_PATH}tests/_data/fixtures/"

# Mongo
DATA_MONGODB_HOST="127.0.0.1"
DATA_MONGODB_PORT=27017
DATA_MONGODB_USER="admin"
DATA_MONGODB_PASS=""
DATA_MONGODB_NAME="phalcon_test"
DATA_MONGO_HOST="127.0.0.1"
DATA_MONGO_PORT=27017
DATA_MONGO_USER=""
DATA_MONGO_PASS=""
DATA_MONGO_NAME="phalcon_test"
11 changes: 5 additions & 6 deletions tests/shim.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,11 @@ function loadEnvironment(string $root)
/**
* Necessary evil. We need to set some constants for INI files to work
*/
defineFromEnv('DATA_MYSQL_CHARSET');
defineFromEnv('DATA_MYSQL_HOST');
defineFromEnv('DATA_MYSQL_NAME');
defineFromEnv('DATA_MYSQL_PASS');
defineFromEnv('DATA_MYSQL_PORT');
defineFromEnv('DATA_MYSQL_USER');
defineFromEnv('DATA_MONGODB_HOST');
defineFromEnv('DATA_MONGODB_PORT');
defineFromEnv('DATA_MONGODB_USER');
defineFromEnv('DATA_MONGODB_PASS');
defineFromEnv('DATA_MONGODB_NAME');
defineFromEnv('PATH_CACHE');
defineFromEnv('PATH_DATA');
defineFromEnv('PATH_OUTPUT');
Expand Down

0 comments on commit ca28462

Please sign in to comment.