From 9181167ec1befd2d16d2b03dc0f63714ceb4316e Mon Sep 17 00:00:00 2001 From: Beppe Catanese <1771700+gcatanese@users.noreply.github.com> Date: Thu, 6 Jun 2024 15:50:24 +0200 Subject: [PATCH] E2E multiple GitHub actions (#463) * Add GitHub action for Checkout * Edit comment * Add GitHub action for Authorisation Adjustment * Add GitHub action for Checkout Advanced * Add GitHub action for Giftcard * Add GitHub action for Giving * Add GitHub action for PayByLink * Add GitHub action for Subscription * Rename step * Correct path to scan --- .../e2e-authorisation-adjustment.yml | 25 +++++++++++++++++++ .github/workflows/e2e-checkout-advanced.yml | 25 +++++++++++++++++++ .github/workflows/e2e-checkout.yml | 25 +++++++++++++++++++ .github/workflows/e2e-giftcard.yml | 25 +++++++++++++++++++ .github/workflows/e2e-giving.yml | 25 +++++++++++++++++++ .github/workflows/e2e-paybylink.yml | 25 +++++++++++++++++++ .github/workflows/e2e-subscription.yml | 25 +++++++++++++++++++ checkout-example/index.js | 2 +- 8 files changed, 176 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/e2e-authorisation-adjustment.yml create mode 100644 .github/workflows/e2e-checkout-advanced.yml create mode 100644 .github/workflows/e2e-checkout.yml create mode 100644 .github/workflows/e2e-giftcard.yml create mode 100644 .github/workflows/e2e-giving.yml create mode 100644 .github/workflows/e2e-paybylink.yml create mode 100644 .github/workflows/e2e-subscription.yml diff --git a/.github/workflows/e2e-authorisation-adjustment.yml b/.github/workflows/e2e-authorisation-adjustment.yml new file mode 100644 index 0000000..f222bc4 --- /dev/null +++ b/.github/workflows/e2e-authorisation-adjustment.yml @@ -0,0 +1,25 @@ +name: E2E Authorisation Adjustment + +on: + workflow_dispatch: + push: + branches: [ main ] + paths: + - 'authorisation-adjustment-example/**' + pull_request: + branches: [ main ] + paths: + - 'authorisation-adjustment-example/**' + +jobs: + authorisation-adjustment: + runs-on: ubuntu-latest + steps: + - name: Checkout authorisation-adjustment-example + uses: actions/checkout@v3 + - name: Build authorisation-adjustment-example image + run: docker build -t authorisation-adjustment-example-image:latest authorisation-adjustment-example + - name: Start authorisation-adjustment-example container + run: docker run --rm -d --name authorisation-adjustment-example-image -p 8080:8080 -e ADYEN_API_KEY="${{ secrets.ADYEN_API_KEY }}" -e ADYEN_MERCHANT_ACCOUNT=${{ secrets.ADYEN_MERCHANT_ACCOUNT }} -e ADYEN_CLIENT_KEY=${{ secrets.ADYEN_CLIENT_KEY }} -e ADYEN_HMAC_KEY=${{ secrets.ADYEN_HMAC_KEY }} authorisation-adjustment-example-image:latest + - name: Run testing suite against authorisation-adjustment-example-image + run: docker run --rm --name adyen-testing-suite -e PLAYWRIGHT_FOLDERNAME=authorisation-adjustment -e ADYEN_HMAC_KEY=${{ secrets.ADYEN_HMAC_KEY }} --network host ghcr.io/adyen-examples/adyen-testing-suite:main diff --git a/.github/workflows/e2e-checkout-advanced.yml b/.github/workflows/e2e-checkout-advanced.yml new file mode 100644 index 0000000..fe59ca8 --- /dev/null +++ b/.github/workflows/e2e-checkout-advanced.yml @@ -0,0 +1,25 @@ +name: E2E Checkout Advanced + +on: + workflow_dispatch: + push: + branches: [ main ] + paths: + - 'checkout-example-advanced/**' + pull_request: + branches: [ main ] + paths: + - 'checkout-example-advanced/**' + +jobs: + checkout-advanced: + runs-on: ubuntu-latest + steps: + - name: Checkout checkout-example-advanced + uses: actions/checkout@v3 + - name: Build checkout-example-advanced image + run: docker build -t checkout-example-advanced-image:latest checkout-example-advanced + - name: Start checkout-example-advanced container + run: docker run --rm -d --name checkout-example-advanced-image -p 8080:8080 -e ADYEN_API_KEY="${{ secrets.ADYEN_API_KEY }}" -e ADYEN_MERCHANT_ACCOUNT=${{ secrets.ADYEN_MERCHANT_ACCOUNT }} -e ADYEN_CLIENT_KEY=${{ secrets.ADYEN_CLIENT_KEY }} -e ADYEN_HMAC_KEY=${{ secrets.ADYEN_HMAC_KEY }} checkout-example-advanced-image:latest + - name: Run testing suite against checkout-example-advanced-image + run: docker run --rm --name adyen-testing-suite -e PLAYWRIGHT_FOLDERNAME=advanced-checkout -e ADYEN_HMAC_KEY=${{ secrets.ADYEN_HMAC_KEY }} --network host ghcr.io/adyen-examples/adyen-testing-suite:main diff --git a/.github/workflows/e2e-checkout.yml b/.github/workflows/e2e-checkout.yml new file mode 100644 index 0000000..39248b8 --- /dev/null +++ b/.github/workflows/e2e-checkout.yml @@ -0,0 +1,25 @@ +name: E2E Checkout + +on: + workflow_dispatch: + push: + branches: [ main ] + paths: + - 'checkout-example/**' + pull_request: + branches: [ main ] + paths: + - 'checkout-example/**' + +jobs: + checkout: + runs-on: ubuntu-latest + steps: + - name: Checkout checkout-example + uses: actions/checkout@v3 + - name: Build checkout-example image + run: docker build -t checkout-example-image:latest checkout-example + - name: Start checkout-example container + run: docker run --rm -d --name checkout-example-image -p 8080:8080 -e ADYEN_API_KEY="${{ secrets.ADYEN_API_KEY }}" -e ADYEN_MERCHANT_ACCOUNT=${{ secrets.ADYEN_MERCHANT_ACCOUNT }} -e ADYEN_CLIENT_KEY=${{ secrets.ADYEN_CLIENT_KEY }} -e ADYEN_HMAC_KEY=${{ secrets.ADYEN_HMAC_KEY }} checkout-example-image:latest + - name: Run testing suite against checkout-example + run: docker run --rm --name adyen-testing-suite -e PLAYWRIGHT_FOLDERNAME=checkout -e ADYEN_HMAC_KEY=${{ secrets.ADYEN_HMAC_KEY }} --network host ghcr.io/adyen-examples/adyen-testing-suite:main diff --git a/.github/workflows/e2e-giftcard.yml b/.github/workflows/e2e-giftcard.yml new file mode 100644 index 0000000..6aae7f7 --- /dev/null +++ b/.github/workflows/e2e-giftcard.yml @@ -0,0 +1,25 @@ +name: E2E Giftcard + +on: + workflow_dispatch: + push: + branches: [ main ] + paths: + - 'giftcard-example/**' + pull_request: + branches: [ main ] + paths: + - 'giftcard-example/**' + +jobs: + giftcard: + runs-on: ubuntu-latest + steps: + - name: Checkout giftcard-example + uses: actions/checkout@v3 + - name: Build giftcard-example image + run: docker build -t giftcard-example-image:latest giftcard-example + - name: Start giftcard-example container + run: docker run --rm -d --name giftcard-example-image -p 8080:8080 -e ADYEN_API_KEY="${{ secrets.ADYEN_API_KEY }}" -e ADYEN_MERCHANT_ACCOUNT=${{ secrets.ADYEN_MERCHANT_ACCOUNT }} -e ADYEN_CLIENT_KEY=${{ secrets.ADYEN_CLIENT_KEY }} -e ADYEN_HMAC_KEY=${{ secrets.ADYEN_HMAC_KEY }} giftcard-example-image:latest + - name: Run testing suite against giftcard-example + run: docker run --rm --name adyen-testing-suite -e PLAYWRIGHT_FOLDERNAME=giftcard -e ADYEN_HMAC_KEY=${{ secrets.ADYEN_HMAC_KEY }} --network host ghcr.io/adyen-examples/adyen-testing-suite:main diff --git a/.github/workflows/e2e-giving.yml b/.github/workflows/e2e-giving.yml new file mode 100644 index 0000000..638f318 --- /dev/null +++ b/.github/workflows/e2e-giving.yml @@ -0,0 +1,25 @@ +name: E2E Giving + +on: + workflow_dispatch: + push: + branches: [ main ] + paths: + - 'giving-example/**' + pull_request: + branches: [ main ] + paths: + - 'giving-example/**' + +jobs: + giving: + runs-on: ubuntu-latest + steps: + - name: Checkout giving-example + uses: actions/checkout@v3 + - name: Build giving-example image + run: docker build -t giving-example-image:latest giving-example + - name: Start giving-example container + run: docker run --rm -d --name giving-example-image -p 8080:8080 -e ADYEN_API_KEY="${{ secrets.ADYEN_API_KEY }}" -e ADYEN_MERCHANT_ACCOUNT=${{ secrets.ADYEN_MERCHANT_ACCOUNT }} -e ADYEN_CLIENT_KEY=${{ secrets.ADYEN_CLIENT_KEY }} -e ADYEN_HMAC_KEY=${{ secrets.ADYEN_HMAC_KEY }} giving-example-image:latest + - name: Run testing suite against giving-example-image + run: docker run --rm --name adyen-testing-suite -e PLAYWRIGHT_FOLDERNAME=giving -e ADYEN_HMAC_KEY=${{ secrets.ADYEN_HMAC_KEY }} --network host ghcr.io/adyen-examples/adyen-testing-suite:main diff --git a/.github/workflows/e2e-paybylink.yml b/.github/workflows/e2e-paybylink.yml new file mode 100644 index 0000000..ff5f61e --- /dev/null +++ b/.github/workflows/e2e-paybylink.yml @@ -0,0 +1,25 @@ +name: E2E PayByLink + +on: + workflow_dispatch: + push: + branches: [ main ] + paths: + - 'paybylink-example/**' + pull_request: + branches: [ main ] + paths: + - 'paybylink-example/**' + +jobs: + paybylink: + runs-on: ubuntu-latest + steps: + - name: Checkout paybylink-example + uses: actions/checkout@v3 + - name: Build paybylink-example image + run: docker build -t paybylink-example-image:latest paybylink-example + - name: Start paybylink-example container + run: docker run --rm -d --name paybylink-example-image -p 8080:8080 -e ADYEN_API_KEY="${{ secrets.ADYEN_API_KEY }}" -e ADYEN_MERCHANT_ACCOUNT=${{ secrets.ADYEN_MERCHANT_ACCOUNT }} -e ADYEN_CLIENT_KEY=${{ secrets.ADYEN_CLIENT_KEY }} -e ADYEN_HMAC_KEY=${{ secrets.ADYEN_HMAC_KEY }} paybylink-example-image:latest + - name: Run testing suite against paybylink-example + run: docker run --rm --name adyen-testing-suite -e PLAYWRIGHT_FOLDERNAME=paybylink -e ADYEN_HMAC_KEY=${{ secrets.ADYEN_HMAC_KEY }} --network host ghcr.io/adyen-examples/adyen-testing-suite:main diff --git a/.github/workflows/e2e-subscription.yml b/.github/workflows/e2e-subscription.yml new file mode 100644 index 0000000..5f84fab --- /dev/null +++ b/.github/workflows/e2e-subscription.yml @@ -0,0 +1,25 @@ +name: E2E Subscription + +on: + workflow_dispatch: + push: + branches: [ main ] + paths: + - 'subscription-example/**' + pull_request: + branches: [ main ] + paths: + - 'subscription-example/**' + +jobs: + subscription: + runs-on: ubuntu-latest + steps: + - name: Checkout subscription-example + uses: actions/checkout@v3 + - name: Build subscription-example image + run: docker build -t subscription-example-image:latest subscription-example + - name: Start subscription-example container + run: docker run --rm -d --name subscription-example-image -p 8080:8080 -e ADYEN_API_KEY="${{ secrets.ADYEN_API_KEY }}" -e ADYEN_MERCHANT_ACCOUNT=${{ secrets.ADYEN_MERCHANT_ACCOUNT }} -e ADYEN_CLIENT_KEY=${{ secrets.ADYEN_CLIENT_KEY }} -e ADYEN_HMAC_KEY=${{ secrets.ADYEN_HMAC_KEY }} subscription-example-image:latest + - name: Run testing suite against subscription-example + run: docker run --rm --name adyen-testing-suite -e PLAYWRIGHT_FOLDERNAME=subscription -e ADYEN_HMAC_KEY=${{ secrets.ADYEN_HMAC_KEY }} --network host ghcr.io/adyen-examples/adyen-testing-suite:main diff --git a/checkout-example/index.js b/checkout-example/index.js index fbcb6e7..eeff63c 100644 --- a/checkout-example/index.js +++ b/checkout-example/index.js @@ -25,7 +25,7 @@ dotenv.config({ path: "./.env", }); -// Adyen Node.js API library boilerplate (configuration, etc.) +// Adyen NodeJS library configuration const config = new Config(); config.apiKey = process.env.ADYEN_API_KEY; const client = new Client({ config });