Skip to content

GitHub workflow for building gems #316

GitHub workflow for building gems

GitHub workflow for building gems #316

Workflow file for this run

name: Continuous Integration
on:
pull_request:
push:
branches:
- main
- "releases/*"
jobs:
build-lint-test:
strategy:
fail-fast: true
matrix:
# 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/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, macos-latest, windows-latest]
# Earliest and latest supported
rubyVersion: ["3.1", "3.3"]
include:
- os: ubuntu-latest
rubyVersion: "3.3"
checkTarget: true
runs-on: ${{ matrix.os }}
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: ${{ matrix.rubyVersion }}
bundler-cache: true
cargo-cache: true
working-directory: ./temporalio
# Needed for tests currently
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: stable
- name: Install bundle
working-directory: ./temporalio
run: bundle install
- name: Check generated protos
if: ${{ matrix.checkTarget }}
working-directory: ./temporalio
run: |
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"