Skip to content

Commit d750cd6

Browse files
annahiletaAaronWDS
andauthored
Configuring the tests to run in the CI/CD workflow with keys from GitHub secrets (#95)
* added and configured unit tests for 6 high priority endpoints * added ApiTypes class * removed extra space * added configuration of CI/CD workflow * fixed issue with JWT login method * test ci/cd * test --------- Co-authored-by: AaronWDS <[email protected]>
1 parent c559cbf commit d750cd6

16 files changed

+157
-92
lines changed

.github/workflows/php.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: PHP Composer
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v3
19+
20+
- name: Cache Composer packages
21+
id: composer-cache
22+
uses: actions/cache@v3
23+
with:
24+
path: vendor
25+
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
26+
restore-keys: |
27+
${{ runner.os }}-php-
28+
29+
- name: Install dependencies
30+
run: composer install --prefer-dist --no-progress
31+
32+
- name: Run tests
33+
env:
34+
CLIENT_ID: ${{ secrets.CLIENT_ID }}
35+
IMPERSONATED_USER_ID: ${{ secrets.IMPERSONATED_USER_ID }}
36+
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
37+
SIGNER_EMAIL: ${{ secrets.SIGNER_EMAIL }}
38+
SIGNER_NAME: ${{ secrets.SIGNER_NAME }}
39+
run: composer run-script test

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ tmtags
2525
Thumbs.db
2626
Desktop.ini
2727

28+
# add exception for workflow folder
29+
!.github
30+
2831
# ignore Composer downloads
2932
/vendor/*
3033
/Quick_ACG/vendor/*

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ COPY src src/
6060
COPY --from=composer_stage /usr/bin/composer /usr/bin/composer
6161
COPY composer.json /var/www/html/
6262
# This are production settings, I'm running with 'no-dev', adjust accordingly
63-
# if you need it
63+
# if you need it
6464
RUN composer install
6565

6666
CMD ["php-fpm"]

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1818
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
21+
SOFTWARE.

composer.json

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,18 @@
1515
],
1616
"post-update-cmd": [
1717
"@code-sniffer"
18-
]
18+
],
19+
"test": "./vendor/bin/phpunit --verbose tests"
1920
},
21+
"description": "DocuSign PHP launcher",
2022
"require": {
21-
"docusign/admin-client": "1.1.0",
22-
"docusign/click-client": "1.2.2",
23-
"docusign/esign-client": "6.8.0",
24-
"docusign/rooms-client": "2.0.0",
25-
"docusign/monitor-client": "1.1.0",
26-
"twig/twig": "3.4.3",
27-
"league/oauth2-client": "2.6.1",
23+
"docusign/admin-client": "^1.1.0",
24+
"docusign/click-client": "^1.2.2",
25+
"docusign/esign-client": "^6.8.0",
26+
"docusign/rooms-client": "^2.0.0",
27+
"docusign/monitor-client": "^1.1.0",
28+
"twig/twig": "^3.4.3",
29+
"league/oauth2-client": "^2.6.1",
2830
"ext-json": "*",
2931
"guzzlehttp/guzzle": "7.4.5",
3032
"firebase/php-jwt": "5.5.1",

composer.lock

Lines changed: 42 additions & 42 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Controllers/Examples/eSignature/EG002SigningViaEmail.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,15 @@ public function createController(): void
4444
# 2. Call the worker method
4545
# More data validation would be a good idea here
4646
# Strip anything other than characters listed
47+
$pdfDoc = $GLOBALS['DS_CONFIG']['doc_pdf'];
48+
$docxDoc = $GLOBALS['DS_CONFIG']['doc_docx'];
49+
4750
$envelopeResponse = SigningViaEmailService::signingViaEmail(
4851
$this->args,
4952
$this->clientService,
50-
$this::DEMO_DOCS_PATH
53+
$this::DEMO_DOCS_PATH,
54+
$docxDoc,
55+
$pdfDoc
5156
);
5257

5358
if ($envelopeResponse) {

src/EG001EmbeddedSigning.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,12 @@ public function createController(): void
4040
# 1. Call the worker method
4141
# More data validation would be a good idea here
4242
# Strip anything other than characters listed
43+
$pdfDoc = $GLOBALS['DS_CONFIG']['doc_pdf'];
4344
$envelopeIdAndReturnUrl = EmbeddedSigningService::worker(
4445
$this->args,
4546
$this->clientService,
46-
self::DEMO_DOCS_PATH
47+
self::DEMO_DOCS_PATH,
48+
$pdfDoc
4749
);
4850

4951
if ($envelopeIdAndReturnUrl) {

0 commit comments

Comments
 (0)