-
Notifications
You must be signed in to change notification settings - Fork 20
Ruby support #751
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
Merged
Merged
Ruby support #751
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,124 @@ | ||
| name: Ruby Features Testing | ||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| version: | ||
| required: true | ||
| type: string | ||
| # When true, the default version will be used (actually it's the latest tag) | ||
| version-is-repo-ref: | ||
| required: true | ||
| type: boolean | ||
| features-repo-path: | ||
| type: string | ||
| default: 'temporalio/features' | ||
| features-repo-ref: | ||
| type: string | ||
| default: 'main' | ||
| # If set, download the docker image for server from the provided artifact name | ||
| docker-image-artifact-name: | ||
| type: string | ||
| required: false | ||
|
|
||
| permissions: | ||
| contents: read | ||
| actions: read | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| defaults: | ||
| run: | ||
| working-directory: ./features | ||
| steps: | ||
| - name: Print git info | ||
| run: 'echo head_ref: "$GITHUB_HEAD_REF", ref: "$GITHUB_REF", Ruby sdk version: "$INPUT_VERSION"' | ||
| working-directory: '.' | ||
| env: | ||
| INPUT_VERSION: ${{ inputs.version }} | ||
|
|
||
| - name: Download docker artifacts | ||
| if: ${{ inputs.docker-image-artifact-name }} | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: ${{ inputs.docker-image-artifact-name }} | ||
| path: /tmp/server-docker | ||
|
|
||
| - name: Load server Docker Images | ||
| if: ${{ inputs.docker-image-artifact-name }} | ||
| run: | | ||
| docker load --input /tmp/server-docker/temporal-server.tar | ||
| docker load --input /tmp/server-docker/temporal-admin-tools.tar | ||
| working-directory: '.' | ||
|
|
||
| - name: Override IMAGE_TAG environment variable | ||
| if: ${{ inputs.docker-image-artifact-name }} | ||
| run: | | ||
| image_tag=latest | ||
| # image_tag won't exist on older builds (like 1.22.0), so default to latest | ||
| if [ -f /tmp/server-docker/image_tag ]; then | ||
| image_tag=$(cat /tmp/server-docker/image_tag) | ||
| fi | ||
| echo "IMAGE_TAG=${image_tag}" >> $GITHUB_ENV | ||
| working-directory: '.' | ||
|
|
||
| - name: Checkout SDK features repo | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| path: features | ||
| repository: ${{ inputs.features-repo-path }} | ||
| ref: ${{ inputs.features-repo-ref }} | ||
|
|
||
| - uses: actions/setup-go@v2 | ||
| with: | ||
| go-version: '^1.22' | ||
| - name: Setup Ruby | ||
| uses: ruby/setup-ruby@v1 | ||
| with: | ||
| ruby-version: '4.0' | ||
|
|
||
| - name: Start containerized server and dependencies | ||
| id: start-server | ||
| if: inputs.docker-image-artifact-name | ||
| run: | | ||
| docker compose \ | ||
| -f ./dockerfiles/docker-compose.yml \ | ||
| up -d cassandra elasticsearch temporal-admin-tools temporal-server temporal-create-namespace | ||
|
|
||
| - name: Show all container logs | ||
| if: always() | ||
| run: | | ||
| echo "=== All container logs ===" | ||
| docker compose \ | ||
| -f ./dockerfiles/docker-compose.yml \ | ||
| logs | ||
| working-directory: ./features | ||
|
|
||
| - name: Run SDK-features tests directly | ||
| if: inputs.docker-image-artifact-name == '' | ||
| env: | ||
| INPUT_VERSION: ${{ inputs.version-is-repo-ref && '' || inputs.version }} | ||
| run: go run . run --lang rb --version "$INPUT_VERSION" | ||
|
|
||
| # Running the tests in their own step keeps the logs readable | ||
| - name: Run containerized SDK-features tests | ||
| if: inputs.docker-image-artifact-name | ||
| run: | | ||
| docker compose \ | ||
| -f ./dockerfiles/docker-compose.yml \ | ||
| up --no-log-prefix --exit-code-from features-tests-rb features-tests-rb | ||
|
|
||
| - name: Show all container logs before teardown | ||
| if: always() && inputs.docker-image-artifact-name | ||
| run: | | ||
| echo "=== All container logs before teardown ===" | ||
| docker compose \ | ||
| -f ./dockerfiles/docker-compose.yml \ | ||
| logs | ||
| working-directory: ./features | ||
|
|
||
| - name: Tear down docker compose | ||
| if: inputs.docker-image-artifact-name && (success() || failure()) | ||
| run: docker compose -f ./dockerfiles/docker-compose.yml down -v |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| inherit_mode: | ||
| merge: | ||
| - Exclude | ||
|
|
||
| AllCops: | ||
| NewCops: enable | ||
| TargetRubyVersion: 4.0 | ||
| SuggestExtensions: false | ||
| Include: | ||
| - harness/ruby/**/*.rb | ||
| - harness/ruby/**/*.gemspec | ||
| - features/**/feature.rb | ||
| Exclude: | ||
| - vendor/**/* | ||
| - tmp/**/* | ||
|
|
||
| # Don't need super for activities/workflows | ||
| Lint/MissingSuper: | ||
| AllowedParentClasses: | ||
| - Temporalio::Activity::Definition | ||
| - Temporalio::Workflow::Definition | ||
|
|
||
| # Harness methods can be longer | ||
| Metrics/AbcSize: | ||
| Max: 100 | ||
|
|
||
| # Harness blocks can be longer | ||
| Metrics/BlockLength: | ||
| Max: 50 | ||
|
|
||
| # Harness classes can be longer | ||
| Metrics/ClassLength: | ||
| Max: 300 | ||
|
|
||
| # Harness methods can be longer | ||
| Metrics/MethodLength: | ||
| Max: 100 | ||
|
|
||
| Metrics/CyclomaticComplexity: | ||
| Max: 30 | ||
|
|
||
| Metrics/PerceivedComplexity: | ||
| Max: 30 | ||
|
|
||
| # Feature files are small and self-contained, no docs needed | ||
| Style/Documentation: | ||
| Enabled: false | ||
|
|
||
| Style/DocumentationMethod: | ||
| Enabled: false | ||
|
|
||
| # We are ok with large amount of keyword args | ||
| Metrics/ParameterLists: | ||
| CountKeywordArgs: false | ||
|
|
||
| # We want our require lists to be in order | ||
| Style/RequireOrder: | ||
| Enabled: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.