Skip to content

Commit fc183f8

Browse files
committed
Initial client work
1 parent d9fecd0 commit fc183f8

File tree

94 files changed

+9317
-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

+9317
-30
lines changed

.github/workflows/ci.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
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, macos-12, macos-14, windows-latest]
16+
os: [ubuntu-latest, macos-latest]
17+
18+
rubyVersion: ["3.1", "3.2", "3.3"]
19+
20+
include:
21+
- os: ubuntu-latest
22+
rubyVersion: "3.3"
23+
checkTarget: true
24+
runs-on: ${{ matrix.os }}
25+
steps:
26+
- name: Checkout repository
27+
uses: actions/checkout@v2
28+
with:
29+
submodules: recursive
30+
31+
- name: Setup Ruby and Rust
32+
uses: oxidize-rb/actions/setup-ruby-and-rust@v1
33+
with:
34+
ruby-version: ${{ matrix.rubyVersion }}
35+
bundler-cache: true
36+
cargo-cache: true
37+
38+
- name: Setup Rust cache
39+
uses: Swatinem/rust-cache@v2
40+
with:
41+
workspaces: temporalio/ext -> temporalio/target
42+
43+
# Needed for tests currently
44+
- name: Install Go
45+
uses: actions/setup-go@v5
46+
with:
47+
go-version: stable
48+
49+
- name: Install protoc
50+
uses: arduino/setup-protoc@v3
51+
with:
52+
# TODO(cretz): Can upgrade proto when https://github.com/arduino/setup-protoc/issues/99 fixed
53+
version: "23.x"
54+
repo-token: ${{ secrets.GITHUB_TOKEN }}
55+
56+
- name: Lint Rust
57+
if: ${{ matrix.checkTarget }}
58+
working-directory: ./temporalio
59+
run: cargo clippy && cargo fmt --check
60+
61+
# TODO(cretz): For checkTarget, regen protos and ensure no diff
62+
63+
- name: Lint, compile, test Ruby
64+
working-directory: ./temporalio
65+
run: bundle install && bundle exec rake TESTOPTS="--verbose"

.gitignore

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,8 @@
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

README.md

Lines changed: 59 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,63 @@
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/) (i.e. `ruby` and `bundle` on the `PATH`)
17+
* [Rust](https://www.rust-lang.org/) (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
59+
60+
## TODO
61+
62+
* Try to use wrap instead of TypedData
63+
* Note that https://github.com/square/rbs_protobuf doesn't yet support google-protobuf, so it is unreasonable to have typed protobuf at this time

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)