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

Add behat tests and build processes #58

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
6 changes: 3 additions & 3 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
* @seba-aln @650elx @raipubnub
.github/* @parfeon @seba-aln @650elx @raipubnub
README.md @techwritermat @kazydek
* @raipubnub @650elx @seba-aln
.travis/* @parfeon @raipubnub @650elx
README.md @techwritermat
27 changes: 0 additions & 27 deletions .github/workflows/commands-handler.yml

This file was deleted.

59 changes: 0 additions & 59 deletions .github/workflows/release.yml

This file was deleted.

31 changes: 0 additions & 31 deletions .github/workflows/release/versions.json

This file was deleted.

38 changes: 38 additions & 0 deletions .github/workflows/run_acceptance_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: run_acceptance_tests

on: [push]

jobs:
build:
name: Perform Acceptance BDD tests
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@v2
- name: Checkout mock-server action
uses: actions/checkout@v2
with:
repository: pubnub/client-engineering-deployment-tools
ref: github-actions
token: ${{ secrets.GH_TOKEN }}
path: client-engineering-deployment-tools
- name: Run mock server action
uses: ./client-engineering-deployment-tools/actions/mock-server
with:
token: ${{ secrets.GH_TOKEN }}
- name: Install Composer dev depenencies
run: |
COMPOSER=acceptance.json composer install --dev
- name: Run acceptance tests
run: |
mkdir -p tests/features/bootstrap/access/
mkdir -p tests/features/bootstrap/utilities/
mkdir -p tests/features/reports
cp sdk-specifications/features/access/grant-token.feature tests/features/bootstrap/access/grant-an-access-token.feature
cp sdk-specifications/features/utilities/time.feature tests/features/bootstrap/utilities/time.feature
vendor/bin/behat -f junit -o tests/features/reports/
- name: Expose acceptance tests reports
uses: actions/upload-artifact@v2
with:
name: acceptance-test-reports
path: ./tests/features/reports
20 changes: 15 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,22 @@
# composer vendor dir
/vendor

# IDEA files
/.idea
# IDE files
/.id
/.vscode

.DS_Store
coverage.clover

# GitHub Actions #
##################
.github/.release
.travis/README.md
.travis/scripts

deployment_keys
deployment_keys-private
deployment_keys.tar

.travis/github-labels-policy.json
.travis/github-labels.json

# BEHAT feature files
/tests/features/
39 changes: 38 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
language: php
dist: xenial
os: linux

env:
global:
- SOURCE_FOLDER_PATH="./"
- TARGET_FOLDER_PATH="./"

before_install:
- ./.travis/bootstrap.sh
- ./.travis/scripts/key_decrypt.sh deployment_keys.tar deployment_keys $encrypted_2a5fd2384630_key $encrypted_2a5fd2384630_iv
- ./.travis/scripts/git_config.sh

install:
- composer self-update && composer --version
Expand All @@ -15,6 +25,21 @@ stages:
- name: "code coverage"
if: |
type == pull_request
- name: "release candidate"
if: |
type != pull_request \
AND tag IS present \
AND tag =~ ^v\d+\.\d+\.\d+-rc\.\d+$
- name: "release"
if: |
type != pull_request \
AND tag IS present \
AND tag =~ ^v\d+\.\d+\.\d+$
- name: "synchronize"
if: |
type != pull_request \
AND tag IS present \
AND tag =~ ^v?\d+\.\d+\.\d+-nodeploy\.\d+$

jobs:
include:
Expand All @@ -39,4 +64,16 @@ jobs:
php: '7.3'
script: vendor/bin/phpunit --verbose --coverage-clover=coverage.xml
after_success:
- bash <(curl -s https://codecov.io/bash)
- bash <(curl -s https://codecov.io/bash)
- stage: "release candidate"
name: "Deploy release candidate"
php: '7.3'
script: ./.travis/scripts/deploy.sh release-candidate pubnub/php
- stage: "release"
name: "Deploy release"
php: '7.3'
script: ./.travis/scripts/deploy.sh release pubnub/php
- stage: "synchronize"
name: "Not deployable synchronization"
php: '7.3'
script: ./.travis/scripts/synchronization.sh pubnub/php
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# PubNub PHP SDK (V4)

[![Build Status](https://travis-ci.com/pubnub/php.svg?branch=master)](https://travis-ci.com/pubnub/php)
[![Build Status](https://travis-ci.com/pubnub/php-private.svg?token=V4772uMGPqyaA9eaPg8s&branch=master)](https://travis-ci.com/pubnub/php-private)
[![codecov](https://codecov.io/gh/pubnub/php/branch/master/graph/badge.svg)](https://codecov.io/gh/pubnub/php)
[![Docs](https://img.shields.io/badge/docs-online-blue.svg)](https://www.pubnub.com/docs/php/pubnub-php-sdk)
![GitHub release (latest by date)](https://img.shields.io/github/v/release/pubnub/php)
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"require": {
"php": ">=5.6.0",
"rmccue/requests": "^1.0",
"monolog/monolog": "^1.1|^2.0"
"monolog/monolog": "^1.26"
},
"require-dev": {
"phpunit/phpunit": "^5.7"
Expand Down
2 changes: 1 addition & 1 deletion examples/Time.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

require_once __DIR__ . '/../src/autoloader.php';
require_once __DIR__ . '/../vendor/autoload.php';


$pnconfig = \PubNub\PNConfiguration::demoKeys();
Expand Down