From 1ab00466ba5e3d1f7a65cab9939e32d38cfcd486 Mon Sep 17 00:00:00 2001 From: AJ Rice <53190766+ajrice6713@users.noreply.github.com> Date: Wed, 29 Sep 2021 13:23:06 -0400 Subject: [PATCH 1/9] Add Matrix Testing --- .github/workflows/validate.yml | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index aa5de1e..f3f8393 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -1,18 +1,32 @@ -name: Validate SDK +name: Test on: schedule: - cron: "0 4 * * *" pull_request: + workflow_dispatch: jobs: deploy: name: Validate SDK - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [windows-2016, windows-2019, ubuntu-18.04, ubuntu-20.04] + php-version: [7.4, 8.0] steps: - name: Checkout uses: actions/checkout@v2 - - name: Validate + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + + - name: Install Packages + run: composer install + + - name: Test uses: ./.github/actions/validate env: BW_ACCOUNT_ID: ${{ secrets.BW_ACCOUNT_ID }} @@ -23,6 +37,8 @@ jobs: BW_NUMBER: ${{ secrets.BW_NUMBER }} USER_NUMBER: ${{ secrets.USER_NUMBER }} BASE_CALLBACK_URL: ${{ secrets.BASE_CALLBACK_URL }} + run: ./vendor/bin/phpunit tests + - uses: Bandwidth/build-notify-slack-action@v1.0.0 if: failure() && !github.event.pull_request.draft with: From 0a1b9548596baa426c7a50220c5a4bf5b822029b Mon Sep 17 00:00:00 2001 From: AJ Rice <53190766+ajrice6713@users.noreply.github.com> Date: Wed, 29 Sep 2021 13:24:23 -0400 Subject: [PATCH 2/9] Fix Invalid Yaml --- .github/workflows/validate.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index f3f8393..85afc34 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -27,7 +27,6 @@ jobs: run: composer install - name: Test - uses: ./.github/actions/validate env: BW_ACCOUNT_ID: ${{ secrets.BW_ACCOUNT_ID }} BW_USERNAME: ${{ secrets.BW_USERNAME }} From d3d744df0f22ea6fdf02009d6d0f08080dcf22b6 Mon Sep 17 00:00:00 2001 From: AJ Rice <53190766+ajrice6713@users.noreply.github.com> Date: Wed, 29 Sep 2021 13:26:37 -0400 Subject: [PATCH 3/9] Update MFA test to use random number --- tests/ApiTest.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/ApiTest.php b/tests/ApiTest.php index 95d6dbb..c89a4c4 100644 --- a/tests/ApiTest.php +++ b/tests/ApiTest.php @@ -162,8 +162,7 @@ public function testMfaVoice() { public function testMfaVerify() { $body = new BandwidthLib\MultiFactorAuth\Models\TwoFactorVerifyRequestSchema(); - $body->from = getenv("BW_NUMBER"); - $body->to = getenv("USER_NUMBER"); + $body->to = rand(10000000000, 19999999999); $body->applicationId = getenv("BW_VOICE_APPLICATION_ID"); $body->scope = "scope"; $body->code = "123456"; From 8d8a197f78029eef9fda1831ad9d596c397e2314 Mon Sep 17 00:00:00 2001 From: AJ Rice <53190766+ajrice6713@users.noreply.github.com> Date: Wed, 29 Sep 2021 13:29:21 -0400 Subject: [PATCH 4/9] use str not int for the tn --- tests/ApiTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ApiTest.php b/tests/ApiTest.php index c89a4c4..9554a96 100644 --- a/tests/ApiTest.php +++ b/tests/ApiTest.php @@ -162,7 +162,7 @@ public function testMfaVoice() { public function testMfaVerify() { $body = new BandwidthLib\MultiFactorAuth\Models\TwoFactorVerifyRequestSchema(); - $body->to = rand(10000000000, 19999999999); + $body->to = "+".rand(10000000000, 19999999999); $body->applicationId = getenv("BW_VOICE_APPLICATION_ID"); $body->scope = "scope"; $body->code = "123456"; From c7763bf08dc367e5353fceb623d3ef8dc079b03f Mon Sep 17 00:00:00 2001 From: AJ Rice <53190766+ajrice6713@users.noreply.github.com> Date: Wed, 29 Sep 2021 13:36:35 -0400 Subject: [PATCH 5/9] Update README.md --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index eb06f2a..92c1f69 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,14 @@ # Bandwidth PHP SDK +[![Test](https://github.com/Bandwidth/php-sdk/actions/workflows/test.yaml/badge.svg)](https://github.com/Bandwidth/php-sdk/actions/workflows/test.yaml) + +| **OS** | **PHP** | +|:---:|:---:| +| Windows 2016 | 7.4, 8.0 | +| Windows 2019 | 7.4, 8.0 | +| Ubuntu 18.04 | 7.4, 8.0 | +| Ubuntu 20.04 | 7.4, 8.0 | + ## Getting Started ### Installation From 2572ea69cab0c5fc545da947a42c58baa8974c22 Mon Sep 17 00:00:00 2001 From: AJ Rice <53190766+ajrice6713@users.noreply.github.com> Date: Wed, 29 Sep 2021 13:40:56 -0400 Subject: [PATCH 6/9] remove unused action --- .github/actions/validate/Dockerfile | 11 ----------- .github/actions/validate/action.yml | 6 ------ .github/actions/validate/entrypoint.sh | 4 ---- 3 files changed, 21 deletions(-) delete mode 100644 .github/actions/validate/Dockerfile delete mode 100644 .github/actions/validate/action.yml delete mode 100644 .github/actions/validate/entrypoint.sh diff --git a/.github/actions/validate/Dockerfile b/.github/actions/validate/Dockerfile deleted file mode 100644 index 4e6cdc7..0000000 --- a/.github/actions/validate/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -# Container image that runs your code -FROM composer:latest - -# Copies your code file from your action repository to the filesystem path `/` of the container -COPY entrypoint.sh /entrypoint.sh - -#Make entrypoint.sh exacutable -RUN chmod +x /entrypoint.sh - -# Code file to execute when the docker container starts up (`entrypoint.sh`) -ENTRYPOINT ["/entrypoint.sh"] diff --git a/.github/actions/validate/action.yml b/.github/actions/validate/action.yml deleted file mode 100644 index 95452b0..0000000 --- a/.github/actions/validate/action.yml +++ /dev/null @@ -1,6 +0,0 @@ -# action.yml -name: 'Validate' -description: 'Validates the package' -runs: - using: 'docker' - image: 'Dockerfile' diff --git a/.github/actions/validate/entrypoint.sh b/.github/actions/validate/entrypoint.sh deleted file mode 100644 index 714d1c5..0000000 --- a/.github/actions/validate/entrypoint.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -composer require -./vendor/bin/phpunit tests From d2b484871a3f4e7c5be442eed154c1a4e242b854 Mon Sep 17 00:00:00 2001 From: AJ Rice <53190766+ajrice6713@users.noreply.github.com> Date: Wed, 29 Sep 2021 14:12:45 -0400 Subject: [PATCH 7/9] Update .github/workflows/validate.yml Co-authored-by: Cameron Koegel <53310569+ckoegel@users.noreply.github.com> --- .github/workflows/validate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 85afc34..b956e02 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -7,7 +7,7 @@ on: workflow_dispatch: jobs: - deploy: + test: name: Validate SDK runs-on: ${{ matrix.os }} strategy: From 04f2c1f27583541e88023093c27f45612ac48802 Mon Sep 17 00:00:00 2001 From: AJ Rice <53190766+ajrice6713@users.noreply.github.com> Date: Wed, 29 Sep 2021 14:16:30 -0400 Subject: [PATCH 8/9] Rename the validate workflow to Test --- .github/workflows/{validate.yml => test.yml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{validate.yml => test.yml} (98%) diff --git a/.github/workflows/validate.yml b/.github/workflows/test.yml similarity index 98% rename from .github/workflows/validate.yml rename to .github/workflows/test.yml index b956e02..9eaa5fe 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/test.yml @@ -8,7 +8,7 @@ on: jobs: test: - name: Validate SDK + name: Test runs-on: ${{ matrix.os }} strategy: matrix: From c7d32fb67dd9b69976e0b08f139868f09e7bb80a Mon Sep 17 00:00:00 2001 From: AJ Rice <53190766+ajrice6713@users.noreply.github.com> Date: Wed, 29 Sep 2021 14:17:17 -0400 Subject: [PATCH 9/9] Update phpunit.xml `Element 'phpunit', attribute 'syntaxCheck': The attribute 'syntaxCheck' is not allowed.` --- phpunit.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/phpunit.xml b/phpunit.xml index 560f77c..5bdcd15 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -8,7 +8,6 @@ processIsolation="false" stopOnError="false" stopOnFailure="false" - syntaxCheck="true" verbose="true" >