From 7e8e4c01307bf512a33c899a693c8a3d30409ca9 Mon Sep 17 00:00:00 2001 From: Jack Kleeman Date: Thu, 2 Nov 2023 14:46:39 +0000 Subject: [PATCH 1/2] Support snapshot java sdk commits --- .github/workflows/e2e.yaml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 6f651233..4008fd7d 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -15,6 +15,11 @@ on: required: false default: '' type: string + sdkJavaCommit: + description: 'sdk-java commit' + required: false + default: '' + type: string restateCommit: description: 'restate commit' required: false @@ -27,6 +32,11 @@ on: required: false default: '' type: string + sdkJavaCommit: + description: 'sdk-java commit' + required: false + default: '' + type: string restateCommit: description: 'restate commit' required: false @@ -114,6 +124,17 @@ jobs: run: npm install restatedev-restate-sdk.tgz working-directory: services/node-services + # Setup sdk-java snapshot if necessary + - uses: actions/checkout@v3 + if: ${{ inputs.sdkJavaCommit != '' }} + with: + repository: restatedev/sdk-java + # if we are in a workflow_call, use the e2e branch from the workflow call (usually main) + # otherwise, defer to the checkout actions default, which depends on the triggering event + ref: ${{ inputs.sdkJavaCommit }} + token: ${{ secrets.SDK_JAVA_CONTENTS_READ_TOKEN || secrets.GITHUB_TOKEN }} + path: "../sdk-java" + # Setup restate snapshot if necessary # Due to https://github.com/actions/upload-artifact/issues/53 # We must use download-artifact to get artifacts created during *this* workflow run, ie by workflow call @@ -149,6 +170,7 @@ jobs: E2E_IMAGE_PULL_POLICY: always E2E_VERIFICATION_SEED: ${{ github.run_id }} RESTATE_RUNTIME_CONTAINER: ${{ inputs.restateCommit != '' && 'localhost:5000/restatedev/restate:latest' || '' }} + JAVA_SDK_LOCAL_BUILD: ${{ inputs.sdkJavaCommit != '' && 'true' || '' }} with: arguments: -Djib.console=plain check From 4447269df4061fd07d6a76cf4308c31d55393f50 Mon Sep 17 00:00:00 2001 From: Jack Kleeman Date: Fri, 3 Nov 2023 11:45:25 +0000 Subject: [PATCH 2/2] Checkout e2e to a subdir So that we can checkout sdk-java to .. --- .github/workflows/e2e.yaml | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 4008fd7d..354e5291 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -74,6 +74,7 @@ jobs: - uses: actions/checkout@v3 with: repository: restatedev/e2e + path: e2e # if we are in a workflow_call, use the e2e branch from the workflow call (usually main) # otherwise, defer to the checkout actions default, which depends on the triggering event ref: ${{ inputs.e2eRef || '' }} @@ -106,7 +107,7 @@ jobs: uses: actions/download-artifact@v3 with: name: restatedev-restate-sdk - path: services/node-services + path: e2e/services/node-services # In the workflow dispatch case where the artifact was created in a previous run, we can download as normal - name: Download sdk-typescript snapshot from completed workflow @@ -117,15 +118,16 @@ jobs: repo: restatedev/sdk-typescript commit: ${{ inputs.sdkTypescriptCommit }} name: restatedev-restate-sdk - path: services/node-services + path: e2e/services/node-services - name: Install sdk-typescript snapshot if: ${{ inputs.sdkTypescriptCommit != '' }} run: npm install restatedev-restate-sdk.tgz - working-directory: services/node-services + working-directory: e2e/services/node-services # Setup sdk-java snapshot if necessary - - uses: actions/checkout@v3 + - name: Checkout sdk-java repo + uses: actions/checkout@v3 if: ${{ inputs.sdkJavaCommit != '' }} with: repository: restatedev/sdk-java @@ -133,7 +135,7 @@ jobs: # otherwise, defer to the checkout actions default, which depends on the triggering event ref: ${{ inputs.sdkJavaCommit }} token: ${{ secrets.SDK_JAVA_CONTENTS_READ_TOKEN || secrets.GITHUB_TOKEN }} - path: "../sdk-java" + path: "sdk-java" # Setup restate snapshot if necessary # Due to https://github.com/actions/upload-artifact/issues/53 @@ -173,6 +175,7 @@ jobs: JAVA_SDK_LOCAL_BUILD: ${{ inputs.sdkJavaCommit != '' && 'true' || '' }} with: arguments: -Djib.console=plain check + build-root-directory: e2e # Upload container logs - uses: actions/upload-artifact@v3 @@ -180,15 +183,15 @@ jobs: with: name: container-logs path: | - tests/build/test-results/*/container-logs/** - tests/build/reports/tests/** - tests/build/test-results/*/*.xml + e2e/tests/build/test-results/*/container-logs/** + e2e/tests/build/reports/tests/** + e2e/tests/build/test-results/*/*.xml - name: Publish Test Results uses: EnricoMi/publish-unit-test-result-action@v2 if: always() with: files: | - tests/build/test-results/*/*.xml + e2e/tests/build/test-results/*/*.xml