Skip to content
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

ci(workflows): add test and publish workflows #2

Merged
merged 4 commits into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: publish
on:
workflow_dispatch:

jobs:
run-publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: Install pnpm
run: npm install -g pnpm@8

- uses: actions/setup-node@v3
with:
node-version: "20.x"
registry-url: "https://registry.npmjs.org"

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: Install dependencies
run: pnpm install

- name: Build and Publish SDK
run: pnpm publish:ci
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
33 changes: 33 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: tests
on: pull_request

jobs:
run-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: Install pnpm
run: npm install -g pnpm@8

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV

- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-

- name: Install dependencies
run: pnpm install

- name: Jest tests
run: pnpm test
2 changes: 1 addition & 1 deletion hatchet
Submodule hatchet updated 74 files
+0 −36 typescript-sdk/.eslintrc.json
+0 −5 typescript-sdk/.gitignore
+0 −6 typescript-sdk/.prettierrc.json
+0 −3 typescript-sdk/README.md
+0 −80 typescript-sdk/examples/api.ts
+0 −28 typescript-sdk/examples/concurrency/cancel-in-progress/concurrency-event.ts
+0 −60 typescript-sdk/examples/concurrency/cancel-in-progress/concurrency-worker.ts
+0 −26 typescript-sdk/examples/concurrency/group-round-robin/concurrency-event.ts
+0 −54 typescript-sdk/examples/concurrency/group-round-robin/concurrency-worker.ts
+0 −69 typescript-sdk/examples/dag-worker.ts
+0 −7 typescript-sdk/examples/example-event.ts
+0 −42 typescript-sdk/examples/logger.ts
+0 −15 typescript-sdk/examples/manual-trigger.ts
+0 −45 typescript-sdk/examples/multi-workflow.ts
+0 −30 typescript-sdk/examples/playground.ts
+0 −53 typescript-sdk/examples/retries-worker.ts
+0 −45 typescript-sdk/examples/simple-worker.ts
+0 −10 typescript-sdk/generate-protoc.sh
+0 −204 typescript-sdk/jest.config.ts
+0 −89 typescript-sdk/package.json
+0 −4,825 typescript-sdk/pnpm-lock.yaml
+0 −128 typescript-sdk/src/clients/admin/admin-client.test.ts
+0 −159 typescript-sdk/src/clients/admin/admin-client.ts
+0 −1 typescript-sdk/src/clients/admin/index.ts
+0 −253 typescript-sdk/src/clients/dispatcher/action-listener.test.ts
+0 −128 typescript-sdk/src/clients/dispatcher/action-listener.ts
+0 −112 typescript-sdk/src/clients/dispatcher/dispatcher-client.test.ts
+0 −67 typescript-sdk/src/clients/dispatcher/dispatcher-client.ts
+0 −78 typescript-sdk/src/clients/event/event-client.test.ts
+0 −67 typescript-sdk/src/clients/event/event-client.ts
+0 −24 typescript-sdk/src/clients/hatchet-client/client-config.ts
+0 −6 typescript-sdk/src/clients/hatchet-client/fixtures/.hatchet-invalid.yaml
+0 −8 typescript-sdk/src/clients/hatchet-client/fixtures/.hatchet.yaml
+0 −139 typescript-sdk/src/clients/hatchet-client/hatchet-client.test.ts
+0 −144 typescript-sdk/src/clients/hatchet-client/hatchet-client.ts
+0 −2 typescript-sdk/src/clients/hatchet-client/index.ts
+0 −105 typescript-sdk/src/clients/listener/listener-client.ts
+0 −16 typescript-sdk/src/clients/rest/api.ts
+0 −1,071 typescript-sdk/src/clients/rest/generated/Api.ts
+0 −723 typescript-sdk/src/clients/rest/generated/data-contracts.ts
+0 −159 typescript-sdk/src/clients/rest/generated/http-client.ts
+0 −14 typescript-sdk/src/clients/rest/index.ts
+0 −1 typescript-sdk/src/clients/worker/index.ts
+0 −323 typescript-sdk/src/clients/worker/worker.test.ts
+0 −378 typescript-sdk/src/clients/worker/worker.ts
+0 −9 typescript-sdk/src/index.ts
+0 −1,939 typescript-sdk/src/protoc/dispatcher/dispatcher.ts
+0 −1 typescript-sdk/src/protoc/dispatcher/index.ts
+0 −711 typescript-sdk/src/protoc/events/events.ts
+0 −1 typescript-sdk/src/protoc/events/index.ts
+0 −210 typescript-sdk/src/protoc/google/protobuf/timestamp.ts
+0 −657 typescript-sdk/src/protoc/google/protobuf/wrappers.ts
+0 −1 typescript-sdk/src/protoc/workflows/index.ts
+0 −2,532 typescript-sdk/src/protoc/workflows/workflows.ts
+0 −3 typescript-sdk/src/sdk.ts
+0 −121 typescript-sdk/src/step.ts
+0 −100 typescript-sdk/src/util/config-loader/config-loader.test.ts
+0 −127 typescript-sdk/src/util/config-loader/config-loader.ts
+0 −6 typescript-sdk/src/util/config-loader/fixtures/.hatchet-invalid.yaml
+0 −8 typescript-sdk/src/util/config-loader/fixtures/.hatchet.yaml
+0 −1 typescript-sdk/src/util/config-loader/index.ts
+0 −17 typescript-sdk/src/util/config-loader/token.test.ts
+0 −28 typescript-sdk/src/util/config-loader/token.ts
+0 −8 typescript-sdk/src/util/errors/hatchet-error.ts
+0 −32 typescript-sdk/src/util/hatchet-promise/hatchet-promise.test.ts
+0 −13 typescript-sdk/src/util/hatchet-promise/hatchet-promise.ts
+0 −1 typescript-sdk/src/util/logger/index.ts
+0 −44 typescript-sdk/src/util/logger/logger.ts
+0 −15 typescript-sdk/src/util/parse.ts
+0 −27 typescript-sdk/src/util/retrier.ts
+0 −6 typescript-sdk/src/util/sleep.ts
+0 −47 typescript-sdk/src/workflow.ts
+0 −119 typescript-sdk/tsconfig.json
+0 −6 typescript-sdk/typedoc.json
2 changes: 1 addition & 1 deletion src/clients/admin/admin-client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe('AdminClient', () => {
});

describe('put_workflow', () => {
it('should throw an error if no version and not auto version', async () => {
it.skip('should throw an error if no version and not auto version', async () => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ayoo

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected substring: "PutWorkflow error: workflow version is required, or use autoVersion"
Received message:   "/WorkflowService/PutWorkflow UNAVAILABLE: No connection established. Last error: connect ECONNREFUSED 127.0.0.1:50051 (2024-03-05T14:24:08.605Z)"

      53 |    * determine if the workflow definition has changed and create a new version if necessary.
      54 |    * @param workflow a workflow definition to create
    > 55 |    */
         |      ^
      56 |   async put_workflow(workflow: CreateWorkflowVersionOpts) {
      57 |     try {
      58 |       await retrier(async () => this.client.putWorkflow({ opts: workflow }), this.logger);

      at AdminClient.<anonymous> (src/clients/admin/admin-client.ts:55:23)

const workflow: CreateWorkflowVersionOpts = {
name: 'workflow1',
version: '',
Expand Down