Skip to content

Commit ca28462

Browse files
authored
Merge pull request #3 from tacxticx88/feature/implements-gh-actions
Feature/implements github actions
2 parents 7a40df3 + 5dfafdd commit ca28462

File tree

5 files changed

+84
-14
lines changed

5 files changed

+84
-14
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Static Code Analysis
2+
on: [push, pull_request]
3+
4+
jobs:
5+
phpcs:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v2-beta
9+
with:
10+
fetch-depth: 1
11+
- name: Run PHP_CodeSniffer
12+
run: docker run --rm -v $(pwd):/data cytopia/phpcs --standard=./phpcs.xml.dist
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Testing Suite
2+
on: [push, pull_request]
3+
4+
jobs:
5+
build-and-test-linux:
6+
services:
7+
mongodb:
8+
image: mongo:4.2
9+
ports:
10+
- 27017:27017
11+
runs-on: ${{ matrix.operating-system }}
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
operating-system: [ubuntu-latest]
16+
php-versions: ['7.4']
17+
18+
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}
19+
steps:
20+
21+
- name: Git checkout
22+
uses: actions/checkout@v2-beta
23+
with:
24+
fetch-depth: 1
25+
26+
- name: Get Composer Cache Directory
27+
id: composer-cache
28+
run: |
29+
echo "::set-output name=dir::$(composer config cache-files-dir)"
30+
- name: Setup Cache
31+
uses: actions/cache@v1
32+
with:
33+
path: ${{ steps.composer-cache.outputs.dir }}
34+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
35+
restore-keys: |
36+
${{ runner.os }}-composer-
37+
- name: Setup Composer Token
38+
run: |
39+
# To increase the Composer rate limit we're use GitHub authentication
40+
if [ -n "${{ secrets.COMPOSER_TOKEN }}" ]; then
41+
composer config github-oauth.github.com "${{ secrets.COMPOSER_TOKEN }}"
42+
fi
43+
- name: Setup PHP
44+
uses: shivammathur/setup-php@v1
45+
with:
46+
php-version: ${{ matrix.php-versions }}
47+
ini-values: apc.enable_cli=on, session.save_path=/tmp
48+
tools: pecl
49+
extensions: mbstring, intl, json, imagick, phalcon
50+
51+
- name: Install packages
52+
run: composer install --prefer-dist
53+
54+
- name: Setup tests
55+
run: |
56+
cp tests/_ci/.env.default .env
57+
vendor/bin/codecept build
58+
- name: Run integration tests
59+
run: vendor/bin/codecept run --ext DotReporter integration --coverage --coverage-xml

codeception.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ settings:
1717
memory_limit: 1024M
1818
lint: true
1919

20-
coverage:
21-
# Disable Code Coverage by default to speed up Travis tests
22-
enabled: false
20+
#coverage:
21+
# # Disable Code Coverage by default to speed up Travis tests
22+
# enabled: false
2323

2424
extensions:
2525
enabled:

tests/_ci/.env.default

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ PATH_OUTPUT="${PROJECT_PATH}tests/_output/"
55
PATH_FIXTURES="${PROJECT_PATH}tests/_data/fixtures/"
66

77
# Mongo
8-
DATA_MONGODB_HOST="127.0.0.1"
9-
DATA_MONGODB_PORT=27017
10-
DATA_MONGODB_USER="admin"
11-
DATA_MONGODB_PASS=""
12-
DATA_MONGODB_NAME="phalcon_test"
8+
DATA_MONGO_HOST="127.0.0.1"
9+
DATA_MONGO_PORT=27017
10+
DATA_MONGO_USER=""
11+
DATA_MONGO_PASS=""
12+
DATA_MONGO_NAME="phalcon_test"

tests/shim.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,11 @@ function loadEnvironment(string $root)
3838
/**
3939
* Necessary evil. We need to set some constants for INI files to work
4040
*/
41-
defineFromEnv('DATA_MYSQL_CHARSET');
42-
defineFromEnv('DATA_MYSQL_HOST');
43-
defineFromEnv('DATA_MYSQL_NAME');
44-
defineFromEnv('DATA_MYSQL_PASS');
45-
defineFromEnv('DATA_MYSQL_PORT');
46-
defineFromEnv('DATA_MYSQL_USER');
41+
defineFromEnv('DATA_MONGODB_HOST');
42+
defineFromEnv('DATA_MONGODB_PORT');
43+
defineFromEnv('DATA_MONGODB_USER');
44+
defineFromEnv('DATA_MONGODB_PASS');
45+
defineFromEnv('DATA_MONGODB_NAME');
4746
defineFromEnv('PATH_CACHE');
4847
defineFromEnv('PATH_DATA');
4948
defineFromEnv('PATH_OUTPUT');

0 commit comments

Comments
 (0)