Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various fixes to make the CDK example pass verification #67

Merged
merged 5 commits into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ on:
description: 'sdk-java version (without prepending v). Leave empty if you do not want to update it.'
required: false
type: string
cdkVersion:
description: 'cdk version (without prepending v). Leave empty if you do not want to update it.'
required: false
type: string

jobs:
updates:
Expand Down Expand Up @@ -53,6 +57,9 @@ jobs:
- name: Find and replace restateVersion in build.gradle.kts for kotlin templates
if: github.event.inputs.sdkJavaVersion != ''
run: for jvmDir in hello-world-http hello-world-lambda; do sed -i 's/val restateVersion = "[0-9A-Z.-]*"/val restateVersion = "${{ inputs.sdkJavaVersion }}"/' kotlin/$jvmDir/build.gradle.kts; done
- name: Find and replace restateVersion in build.gradle.kts for kotlin/hello-world-lambda-cdk
if: github.event.inputs.sdkJavaVersion != ''
run: sed -i 's/val restateVersion = "[0-9A-Z.-]*"/val restateVersion = "${{ inputs.sdkJavaVersion }}"/' kotlin/hello-world-lambda-cdk/lambda/build.gradle.kts

# When adding a new example add the check task here
- name: Test java/hello-world-http
Expand Down Expand Up @@ -80,12 +87,18 @@ jobs:
arguments: check
build-root-directory: kotlin/hello-world-lambda

- name: Update cdk version
if: github.event.inputs.cdkVersion != ''
run: npm --prefix kotlin/hello-world-lambda-cdk install @restatedev/restate-cdk@^${{ inputs.cdkVersion }}

# CDK projects are a hybrid of TypeScript CDK stack + platform-specific handler code; the top-level npm CDK build
# is responsible for verifying the language-specific handler cod. They are also not a part of the TypeScript
# is responsible for verifying the language-specific handler code. They are also not a part of the TypeScript
# examples workspace, so we test them separately here.
- name: Test kotlin/hello-world-lambda-cdk
if: github.event.inputs.sdkTypescriptVersion != '' && github.event.inputs.sdkJavaVersion != ''
run: npm --prefix kotlin/hello-world-lambda-cdk run verify
if: github.event.inputs.cdkVersion != '' || github.event.inputs.sdkJavaVersion != ''
run: |
npm --prefix kotlin/hello-world-lambda-cdk install
npm --prefix kotlin/hello-world-lambda-cdk run verify

- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,12 @@ jobs:
build-root-directory: kotlin/hello-world-lambda

# CDK projects are a hybrid of TypeScript CDK stack + platform-specific handler code; the top-level npm CDK build
# is responsible for verifying the language-specific handler cod. They are also not a part of the TypeScript
# is responsible for verifying the language-specific handler code. They are also not a part of the TypeScript
# examples workspace, so we test them separately here.
- name: Test kotlin/hello-world-lambda-cdk
if: github.event.inputs.sdkTypescriptVersion != '' && github.event.inputs.sdkJavaVersion != ''
run: npm --prefix kotlin/hello-world-lambda-cdk run verify
run: |
npm --prefix kotlin/hello-world-lambda-cdk install
npm --prefix kotlin/hello-world-lambda-cdk run verify

build-ts:
# prevent from running on forks
Expand Down
2 changes: 2 additions & 0 deletions kotlin/hello-world-lambda-cdk/lambda/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// automatically download missing toolchains
plugins { id("org.gradle.toolchains.foojay-resolver-convention") version "0.7.0" }
Loading
Loading