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 diff --git a/.github/workflows/validate.yml b/.github/workflows/test.yml similarity index 65% rename from .github/workflows/validate.yml rename to .github/workflows/test.yml index aa5de1e..9eaa5fe 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/test.yml @@ -1,19 +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 + test: + name: Test + 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 - uses: ./.github/actions/validate + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + + - name: Install Packages + run: composer install + + - name: Test env: BW_ACCOUNT_ID: ${{ secrets.BW_ACCOUNT_ID }} BW_USERNAME: ${{ secrets.BW_USERNAME }} @@ -23,6 +36,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: 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 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" > diff --git a/tests/ApiTest.php b/tests/ApiTest.php index 95d6dbb..9554a96 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";