-
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| name: Build Gems | ||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| - "releases/*" | ||
|
|
||
| jobs: | ||
| build-gems: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| rubyPlatform: ["aarch64-linux", "x86_64-linux", "arm64-darwin", "x86_64-darwin", "x64-mingw-ucrt"] | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v2 | ||
| 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 | ||
|
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. I suppose that it will output files to Some comments on what this action will do would be useful to future readers.
Member
Author
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. Yes. Not really wanting to re-document what a separate action does here where we use it, but the |
||
| 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. | ||
| os: [ubuntu-latest, macos-intel, macos-latest, windows-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 | ||
| - os: windows-latest | ||
| rubyPlatform: x64-mingw-ucrt | ||
| 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' | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,32 +9,25 @@ 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] | ||
| os: [ubuntu-latest, macos-latest, windows-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 | ||
|
|
@@ -47,43 +40,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 | ||
Uh oh!
There was an error while loading. Please reload this page.