Skip to content

Commit 87dbfa3

Browse files
committed
Initial client work
1 parent d9fecd0 commit 87dbfa3

File tree

94 files changed

+9330
-30
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+9330
-30
lines changed

.github/workflows/ci.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Continuous Integration
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- main
7+
- "releases/*"
8+
9+
jobs:
10+
build-lint-test:
11+
strategy:
12+
fail-fast: true
13+
matrix:
14+
# TODO(cretz): Enable Windows (it's slow)
15+
# os: [ubuntu-latest, ubuntu-arm, macos-intel, macos-arm, windows-latest]
16+
os: [ubuntu-latest, ubuntu-arm, macos-intel, macos-arm]
17+
# Earliest and latest supported
18+
rubyVersion: ["3.1", "3.3"]
19+
20+
include:
21+
- os: ubuntu-latest
22+
rubyVersion: "3.3"
23+
checkTarget: true
24+
- os: ubuntu-arm
25+
runsOn: ubuntu-24.04-arm64-2-core
26+
- os: macos-intel
27+
runsOn: macos-12
28+
- os: macos-arm
29+
runsOn: macos-14
30+
runs-on: ${{ matrix.os }}
31+
steps:
32+
- name: Checkout repository
33+
uses: actions/checkout@v2
34+
with:
35+
submodules: recursive
36+
37+
- name: Setup Ruby and Rust
38+
uses: oxidize-rb/actions/setup-ruby-and-rust@v1
39+
with:
40+
ruby-version: ${{ matrix.rubyVersion }}
41+
bundler-cache: true
42+
cargo-cache: true
43+
44+
- name: Setup Rust cache
45+
uses: Swatinem/rust-cache@v2
46+
with:
47+
workspaces: temporalio/ext -> temporalio/target
48+
49+
# Needed for tests currently
50+
- name: Install Go
51+
uses: actions/setup-go@v5
52+
with:
53+
go-version: stable
54+
55+
- name: Install protoc
56+
uses: arduino/setup-protoc@v3
57+
with:
58+
# TODO(cretz): Can upgrade proto when https://github.com/arduino/setup-protoc/issues/99 fixed
59+
version: "23.x"
60+
repo-token: ${{ secrets.GITHUB_TOKEN }}
61+
62+
- name: Lint Rust
63+
if: ${{ matrix.checkTarget }}
64+
working-directory: ./temporalio
65+
run: cargo clippy && cargo fmt --check
66+
67+
# TODO(cretz): For checkTarget, regen protos and ensure no diff
68+
69+
- name: Lint, compile, test Ruby
70+
working-directory: ./temporalio
71+
run: bundle install && bundle exec rake TESTOPTS="--verbose"
72+
73+
# TODO(cretz): Build gem and smoke test against separate dir

.gitignore

Lines changed: 9 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,9 @@
1-
.bundle/
2-
.yardoc
3-
_yardoc/
4-
5-
/coverage/
6-
/doc/
7-
/examples/vendor/
8-
/pkg/
9-
/spec/reports/
10-
/tmp/
11-
12-
*.gem
13-
14-
# Thermite artefacts
15-
mkmf.log
16-
lib/temporal_sdk_ruby_bridge.*
17-
18-
# rspec failure tracking
19-
.rspec_status
20-
21-
.idea/*
22-
23-
# Rust builds
24-
bridge/target
25-
26-
# Go binaries
27-
spec/support/go_server/main
28-
spec/support/go_worker/main
1+
tmp/
2+
target/
3+
Gemfile.lock
4+
.gem_rbs_collection
5+
*.so
6+
temporalio/test/golangworker/golangworker
7+
temporalio/.yardoc
8+
temporalio/doc
9+
temporalio/pkg

README.md

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,58 @@
11
# Temporal Ruby SDK
22

3-
The Ruby SDK is under active development/refresh.
3+
⚠️ UNDER ACTIVE DEVELOPMENT
44

55
The last tag before this refresh is [v0.1.1](https://github.com/temporalio/sdk-ruby/tree/v0.1.1). Please reference that
6-
tag for the previous code.
6+
tag for the previous code.
7+
8+
**TODO: Usage documentation**
9+
10+
## Development
11+
12+
### Build
13+
14+
Prerequisites:
15+
16+
* [Ruby](https://www.ruby-lang.org/) >= 3.1 (i.e. `ruby` and `bundle` on the `PATH`)
17+
* [Rust](https://www.rust-lang.org/) latest stable (i.e. `cargo` on the `PATH`)
18+
* [Protobuf Compiler](https://protobuf.dev/) (i.e. `protoc` on the `PATH`)
19+
* This repository, cloned recursively
20+
* Change to the `temporalio/` directory
21+
22+
To build shared library for development use:
23+
24+
bundle exec rake compile:dev
25+
26+
To build and test release:
27+
28+
bundle exec rake
29+
30+
### Testing
31+
32+
This project uses `minitest`. To test:
33+
34+
bundle exec rake test
35+
36+
Can add options via `TESTOPTS`. E.g. single test:
37+
38+
bundle exec rake test TESTOPTS="--name=test_start_workflows_async"
39+
40+
### Code Formatting and Type Checking
41+
42+
This project uses `rubocop`:
43+
44+
bundle exec rake rubocop:autocorrect
45+
46+
This project uses `steep`. First may need the RBS collection:
47+
48+
bundle exec rake rbs:install_collection
49+
50+
Now can run `steep`:
51+
52+
bundle exec rake steep
53+
54+
### Proto Generation
55+
56+
Run:
57+
58+
bundle exec rake proto:generate

temporalio/.rubocop.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
inherit_mode:
2+
merge:
3+
- Exclude
4+
5+
AllCops:
6+
NewCops: enable
7+
TargetRubyVersion: 3.1
8+
SuggestExtensions: false
9+
Exclude:
10+
- ext/**/*
11+
- lib/temporalio/api/**/*
12+
- target/**/*
13+
- tmp/**/*
14+
- vendor/**/*
15+
16+
# Keep cop rule settings in alphabetical order. For each rule setting, provide
17+
# justification for the change from default.
18+
19+
# We want development dependencies in the gemspec
20+
Gemspec/DevelopmentDependencies:
21+
EnforcedStyle: gemspec
22+
23+
# We want our classes in a certain order
24+
Layout/ClassStructure:
25+
Enabled: true
26+
27+
# The default is too small and triggers simply setting lots of values on a proto
28+
Metrics/AbcSize:
29+
Max: 75
30+
31+
# The default is too small
32+
Metrics/BlockLength:
33+
Max: 100
34+
35+
# The default is too small
36+
Metrics/ClassLength:
37+
Max: 400
38+
39+
# The default is too small
40+
Metrics/CyclomaticComplexity:
41+
Max: 25
42+
43+
# The default is too small
44+
Metrics/MethodLength:
45+
Max: 100
46+
47+
# The default is too small
48+
Metrics/PerceivedComplexity:
49+
Max: 25
50+
51+
# We want methods to be documented
52+
Style/DocumentationMethod:
53+
Enabled: true
54+
55+
# Ok to have global vars in tests
56+
Style/GlobalVars:
57+
Exclude:
58+
- test/**/*
59+
60+
# We want our require lists to be in order
61+
Style/RequireOrder:
62+
Enabled: true
63+
64+
# We are ok with large amount of keyword args
65+
Metrics/ParameterLists:
66+
CountKeywordArgs: false

0 commit comments

Comments
 (0)