-
Notifications
You must be signed in to change notification settings - Fork 22
Support for building gems and prepare release #171
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
Changes from all commits
Commits
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| name: Build Gems | ||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| - "releases/*" | ||
|
|
||
| jobs: | ||
| build-gems: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| # TODO(cretz): Enable x64-mingw-ucrt if we can figure out Windows issue, see | ||
| # https://github.com/temporalio/sdk-ruby/issues/172 | ||
| rubyPlatform: ["aarch64-linux", "x86_64-linux", "arm64-darwin", "x86_64-darwin"] | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| submodules: recursive | ||
|
|
||
| - name: Setup Ruby and Rust | ||
| uses: oxidize-rb/actions/setup-ruby-and-rust@v1 | ||
| with: | ||
| ruby-version: "3.3" | ||
| bundler-cache: true | ||
| cargo-cache: true | ||
| cargo-vendor: true | ||
| working-directory: ./temporalio | ||
| cache-version: v1-${{ matrix.rubyPlatform }} | ||
|
|
||
| - name: Cross compile gems | ||
| uses: oxidize-rb/actions/cross-gem@v1 | ||
| id: cross-gem | ||
| with: | ||
| platform: ${{ matrix.rubyPlatform }} | ||
| ruby-versions: "3.1,3.2,3.3" | ||
| working-directory: ./temporalio | ||
|
|
||
| - name: Upload gems | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: ${{ matrix.rubyPlatform }}-gem | ||
| path: ${{ steps.cross-gem.outputs.gem-path }} | ||
|
|
||
| smoke-test-gems: | ||
| needs: | ||
| - build-gems | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| # TODO(cretz): Enable Linux ARM. See ci.yaml comment for why we can't right now. | ||
| # | ||
| # TODO(cretz): Enable windows-latest if we can figure out Windows issue, see | ||
| # https://github.com/temporalio/sdk-ruby/issues/172 | ||
| os: [ubuntu-latest, macos-intel, macos-latest] | ||
| rubyVersion: ["3.1", "3.2", "3.3"] | ||
| include: | ||
| - os: ubuntu-latest | ||
| rubyPlatform: x86_64-linux | ||
| - os: macos-intel | ||
| runsOn: macos-12 | ||
| rubyPlatform: x86_64-darwin | ||
| - os: macos-latest | ||
| rubyPlatform: arm64-darwin | ||
| runs-on: ${{ matrix.runsOn || matrix.os }} | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| submodules: recursive | ||
|
|
||
| - name: Download gem | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: ${{ matrix.rubyPlatform }}-gem | ||
| path: local-gem | ||
|
|
||
| - name: Setup Ruby | ||
| uses: oxidize-rb/actions/setup-ruby-and-rust@v1 | ||
| with: | ||
| ruby-version: "${{ matrix.rubyVersion }}" | ||
| bundler-cache: true | ||
| cargo-cache: false | ||
|
|
||
| - name: Run smoke test | ||
| run: ruby ./temporalio/smoke_test/smoke_test_gem.rb 'local-gem/*-${{ matrix.rubyPlatform }}.gem' | ||
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 |
|---|---|---|
|
|
@@ -9,35 +9,31 @@ on: | |
| jobs: | ||
| build-lint-test: | ||
| strategy: | ||
| fail-fast: false | ||
| fail-fast: true | ||
| matrix: | ||
| # TODO(cretz): Enable Windows (it's slow) | ||
| # | ||
| # TODO(cretz): Enable Linux ARM. It's not natively supported with setup-ruby (see | ||
| # https://github.com/ruby/setup-ruby#supported-platforms). So we need to set ruby-version to 'none' per | ||
| # https://github.com/ruby/setup-ruby#supported-platforms and https://github.com/ruby/setup-ruby/issues/577). | ||
| # So we need to set ruby-version to 'none' per | ||
| # https://github.com/oxidize-rb/actions/tree/main/setup-ruby-and-rust and install Ruby ourselves maybe. See | ||
| # https://github.com/ruby/setup-ruby?tab=readme-ov-file#using-self-hosted-runners. The error states: | ||
| # Error: The current runner (ubuntu-24.04-arm64) was detected as self-hosted because the platform does not match a GitHub-hosted runner image (or that image is deprecated and no longer supported). | ||
| # In such a case, you should install Ruby in the $RUNNER_TOOL_CACHE yourself, for example using https://github.com/rbenv/ruby-build | ||
| # You can take inspiration from this workflow for more details: https://github.com/ruby/ruby-builder/blob/master/.github/workflows/build.yml | ||
| # | ||
| #os: [ubuntu-latest, ubuntu-arm, macos-intel, macos-arm, windows-latest] | ||
| os: [ubuntu-latest, macos-intel, macos-arm] | ||
| # TODO(cretz): Enable x64-mingw-ucrt if we can figure out Windows issue, see | ||
| # https://github.com/temporalio/sdk-ruby/issues/172 | ||
| os: [ubuntu-latest, macos-latest] | ||
| # Earliest and latest supported | ||
| rubyVersion: ["3.1", "3.3"] | ||
|
|
||
| include: | ||
| - os: ubuntu-latest | ||
| rubyVersion: "3.3" | ||
| checkTarget: true | ||
| - os: macos-intel | ||
| runsOn: macos-12 | ||
| - os: macos-arm | ||
| runsOn: macos-14 | ||
| runs-on: ${{ matrix.runsOn || matrix.os }} | ||
| runs-on: ${{ matrix.os }} | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v2 | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| submodules: recursive | ||
|
|
||
|
|
@@ -47,43 +43,34 @@ jobs: | |
| ruby-version: ${{ matrix.rubyVersion }} | ||
| bundler-cache: true | ||
| cargo-cache: true | ||
|
|
||
| - name: Setup Rust cache | ||
| uses: Swatinem/rust-cache@v2 | ||
| with: | ||
| workspaces: temporalio/ext -> temporalio/target | ||
| working-directory: ./temporalio | ||
|
|
||
| # Needed for tests currently | ||
| - name: Install Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version: stable | ||
|
|
||
| - name: Install protoc | ||
| # Needed because gRPC tools does not have a macOS protoc binary | ||
| # currently, see https://github.com/grpc/grpc/issues/25755 | ||
| - name: Install protoc for mac | ||
mjameswh marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| if: ${{ matrix.os == 'macos-latest' }} | ||
| uses: arduino/setup-protoc@v3 | ||
| with: | ||
| # TODO(cretz): Can upgrade proto when https://github.com/arduino/setup-protoc/issues/99 fixed | ||
| version: "23.x" | ||
| repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To other reviewers: this has been moved to temporalio/Rakefile |
||
| - name: Lint Rust | ||
| if: ${{ matrix.checkTarget }} | ||
| working-directory: ./temporalio | ||
| run: cargo clippy && cargo fmt --check | ||
|
|
||
| - name: Install bundle | ||
| working-directory: ./temporalio | ||
| run: bundle install | ||
|
|
||
| - name: Check generated code unchanged | ||
| - name: Check generated protos | ||
| if: ${{ matrix.checkTarget }} | ||
| working-directory: ./temporalio | ||
| run: | | ||
| npx doctoc README.md | ||
| cd temporalio && bundle exec rake proto:generate | ||
| git diff --exit-code | ||
| bundle exec rake proto:generate | ||
| [[ -z $(git status --porcelain lib/temporalio/api) ]] || (git diff lib/temporalio/api; echo "Protos changed" 1>&2; exit 1) | ||
|
|
||
| - name: Lint, compile, test Ruby | ||
| working-directory: ./temporalio | ||
| run: bundle exec rake TESTOPTS="--verbose" | ||
|
|
||
| # TODO(cretz): Build gem and smoke test against separate dir | ||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose that it will output files to
temporalio/internal/bridge/3.[123]/temporalio_bridge.(extension). Is that exact?Some comments on what this action will do would be useful to future readers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Not really wanting to re-document what a separate action does here where we use it, but the
internal/bridge.rbdoes have version specific loading