feat(workflow): Add historySizeInBytes and continueAsNewSuggested to WorkflowInfo (#695) #3304
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Continuous Integration | |
on: # rebuild any PRs and main branch changes | |
pull_request: | |
push: | |
branches: | |
- main | |
- 'releases/*' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
jobs: | |
build-and-test: | |
strategy: | |
fail-fast: true | |
matrix: | |
reuse-v8-context: [false] | |
node: [14, 16] | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
include: | |
- os: ubuntu-latest | |
node: 16 | |
reuse-v8-context: true | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node }} | |
- name: Install protoc | |
uses: arduino/setup-protoc@v1 | |
with: | |
version: '3.x' | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- uses: Swatinem/rust-cache@v1 | |
with: | |
working-directory: packages/core-bridge | |
# Don't build during install phase since we're going to explicitly build | |
- run: npm ci --ignore-scripts | |
- run: npm run build | |
env: | |
BUILD_CORE_RELEASE: true | |
# docker-compose | |
- name: Checkout docker-compose repo | |
uses: actions/checkout@v2 | |
with: | |
repository: temporalio/docker-compose | |
path: docker-compose | |
if: ${{ startsWith(matrix.os, 'ubuntu') }} | |
- name: Start Temporal Server | |
run: docker-compose up -d | |
working-directory: docker-compose | |
if: ${{ startsWith(matrix.os, 'ubuntu') }} | |
- name: Wait for Temporal Server | |
run: npm run wait-namespace | |
if: ${{ startsWith(matrix.os, 'ubuntu') }} | |
# end:docker-compose | |
- run: npm test | |
env: | |
# NOTE: Newer tests start their own server and are not subject to this env var. | |
RUN_INTEGRATION_TESTS: ${{ startsWith(matrix.os, 'ubuntu') }} | |
REUSE_V8_CONTEXT: ${{ matrix.reuse-v8-context }} | |
- uses: actions/upload-artifact@v3 | |
if: ${{ failure() }} | |
with: | |
name: npm-logs | |
path: | | |
~/.npm/_logs/ | |
C:\npm\cache\_logs\ | |
build-docs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: 16 | |
- name: Install protoc | |
uses: arduino/setup-protoc@v1 | |
with: | |
version: '3.x' | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
# Don't build during install phase since we're going to explicitly build | |
- run: npm ci --ignore-scripts | |
- run: npm run build -- --ignore @temporalio/core-bridge | |
# Do docs stuff (only on one host) | |
- name: Build docs | |
run: npm run docs | |
env: | |
ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }} | |
- name: Deploy prod docs # TODO: only deploy prod docs when we publish a new version | |
if: ${{ github.ref == 'refs/heads/main' }} | |
run: npx vercel deploy packages/docs/build -t ${{ secrets.VERCEL_TOKEN }} --name typescript --scope temporal --prod --yes | |
- name: Deploy draft docs | |
# Don't run on forks, since secrets won't be available, and command will fail | |
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.ref != 'refs/heads/main' }} | |
run: npx vercel deploy packages/docs/build -t ${{ secrets.VERCEL_TOKEN }} --name typescript --scope temporal --yes | |
# Run TS linting and ts-prune to find unused code | |
lint-and-prune: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: 16 | |
- name: Install protoc | |
uses: arduino/setup-protoc@v1 | |
with: | |
version: '3.x' | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- uses: Swatinem/rust-cache@v1 | |
with: | |
working-directory: packages/core-bridge | |
- run: npm ci --ignore-scripts | |
# eslint-import-resolver-typescript requires packages to be built | |
- name: Compile all non-rust code | |
run: npm run build -- --ignore @temporalio/core-bridge | |
- run: npm run lint.check | |
- run: npm run lint.prune | |
# Compile native bridge code and isolate extension for Windows, Mac and Linux. | |
# Uploads the packages as a build artifact to be tested later. | |
compile-binaries: | |
strategy: | |
fail-fast: true | |
matrix: | |
include: | |
- runsOn: buildjet-2vcpu-ubuntu-1804 | |
target: x86_64-unknown-linux-gnu | |
- runsOn: buildjet-2vcpu-ubuntu-1804 | |
target: aarch64-unknown-linux-gnu | |
rustflags: '-C linker=aarch64-linux-gnu-gcc' | |
- runsOn: macos-latest | |
target: x86_64-apple-darwin | |
- runsOn: macos-latest | |
target: aarch64-apple-darwin | |
- runsOn: windows-latest | |
target: x86_64-pc-windows-msvc | |
runs-on: ${{ matrix.runsOn }} | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: 16 | |
- name: Install protoc | |
uses: arduino/setup-protoc@v1 | |
with: | |
version: '3.x' | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Add ${{ matrix.target }} rust target | |
run: rustup target add ${{ matrix.target }} | |
- name: Print libc version | |
run: ldd --version | |
if: ${{ contains(matrix.runsOn, 'ubuntu') }} | |
- name: Install gcc-aarch64-linux-gnu | |
run: sudo apt update && sudo apt install -y gcc-aarch64-linux-gnu | |
if: ${{ matrix.target == 'aarch64-unknown-linux-gnu' }} | |
- uses: Swatinem/rust-cache@v1 | |
with: | |
working-directory: packages/core-bridge | |
# Don't build during install phase since we're going to explicitly build | |
- run: npm ci --ignore-scripts | |
- name: Compile all non-rust code | |
run: npm run build -- --ignore @temporalio/core-bridge | |
- name: Cross compile rust code | |
env: | |
RUSTFLAGS: ${{ matrix.rustflags }} | |
run: npx lerna run --stream build-rust-release -- --target ${{ matrix.target }} | |
# Restore the CLI JS only on Windows because Windows build changes the | |
# file attributes causing publish to think the change is uncommitted | |
- run: git restore packages/create-project/cli.js | |
if: ${{ matrix.runsOn == 'windows-latest' }} | |
- run: node scripts/publish-to-verdaccio.js --registry-dir /tmp/registry | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: packages-${{ matrix.target }} | |
path: /tmp/registry/storage | |
# Tests that npm init @temporalio results in a working worker and client | |
# Note that the instances used here don't have the Rust toolchain installed which ensures use of prebuilt libs. | |
test-npm-init: | |
strategy: | |
fail-fast: true | |
matrix: | |
include: | |
- os: ubuntu-latest | |
target: x86_64-unknown-linux-gnu | |
node: 16 | |
server: local | |
sample: hello-world | |
- os: ubuntu-latest | |
target: x86_64-unknown-linux-gnu | |
node: 16 | |
server: local | |
sample: fetch-esm | |
- os: macos-latest | |
target: x86_64-apple-darwin | |
node: 16 | |
server: cloud | |
sample: hello-world-mtls | |
- os: windows-latest | |
target: x86_64-pc-windows-msvc | |
node: 16 | |
server: cloud | |
sample: hello-world-mtls | |
runs-on: ${{ matrix.os }} | |
needs: compile-binaries | |
env: | |
TEMPORAL_CLIENT_CERT: ${{ secrets.TEMPORAL_CLIENT_CERT }} | |
TEMPORAL_CLIENT_KEY: ${{ secrets.TEMPORAL_CLIENT_KEY }} | |
steps: | |
# We don't need the core submodule here since we don't build the project | |
- uses: actions/checkout@v2 | |
if: ${{ matrix.server != 'cloud' || env.TEMPORAL_CLIENT_CERT != '' }} | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node }} | |
if: ${{ matrix.server != 'cloud' || env.TEMPORAL_CLIENT_CERT != '' }} | |
# No need to compile anything, we just need the package ./scripts and their dependencies | |
- name: Install dependencies without compilation | |
run: npm ci --ignore-scripts | |
if: ${{ matrix.server != 'cloud' || env.TEMPORAL_CLIENT_CERT != '' }} | |
- uses: actions/download-artifact@v2 | |
with: | |
name: packages-${{ matrix.target }} | |
path: /tmp/registry/storage | |
if: ${{ matrix.server != 'cloud' || env.TEMPORAL_CLIENT_CERT != '' }} | |
- run: node scripts/init-from-verdaccio.js --registry-dir /tmp/registry --sample https://github.com/temporalio/samples-typescript/tree/next/${{ matrix.sample }} | |
if: ${{ matrix.server != 'cloud' || env.TEMPORAL_CLIENT_CERT != '' }} | |
# docker-compose | |
- name: Checkout docker-compose repo | |
uses: actions/checkout@v2 | |
with: | |
repository: temporalio/docker-compose | |
path: docker-compose | |
if: ${{ matrix.server == 'local' }} | |
- name: Start Temporal Server | |
run: docker-compose up -d | |
working-directory: docker-compose | |
if: ${{ matrix.server == 'local' }} | |
# Copy wait-on-temporal script to the example project where the built client package is installed | |
- run: cp scripts/wait-on-temporal.mjs /tmp/registry/example | |
if: ${{ matrix.server == 'local' }} | |
- name: Wait for Temporal Server | |
run: node wait-on-temporal.mjs | |
working-directory: /tmp/registry/example | |
if: ${{ matrix.server == 'local' }} | |
# end:docker-compose | |
- name: Create certs dir | |
# We write the certs to disk because it serves the sample | |
run: node scripts/create-certs-dir.js | |
if: ${{ matrix.server == 'cloud' && env.TEMPORAL_CLIENT_CERT != '' }} | |
- name: Test run a workflow | |
run: node scripts/test-example.js --work-dir /tmp/registry/example | |
env: | |
# TODO: get a permanent cloud namespace for CI | |
# These env vars are ignored by the local server example | |
TEMPORAL_ADDRESS: sdk-ci.a2dd6.tmprl.cloud | |
TEMPORAL_NAMESPACE: sdk-ci.a2dd6 | |
TEMPORAL_CLIENT_CERT_PATH: /tmp/temporal-certs/client.pem | |
TEMPORAL_CLIENT_KEY_PATH: /tmp/temporal-certs/client.key | |
TEMPORAL_TASK_QUEUE: ${{ format('{0}-{1}-{2}', matrix.os, matrix.node, matrix.target) }} | |
if: ${{ matrix.server != 'cloud' || env.TEMPORAL_CLIENT_CERT != '' }} | |
- run: rm /tmp/temporal-certs/client.pem | |
if: ${{ matrix.server == 'cloud' && env.TEMPORAL_CLIENT_CERT != '' }} | |
- run: rm /tmp/temporal-certs/client.key | |
if: ${{ matrix.server == 'cloud' && env.TEMPORAL_CLIENT_CERT != '' }} | |
# Runs the features repo tests with this repo's current SDK code | |
features-tests: | |
uses: temporalio/features/.github/workflows/typescript.yaml@main | |
with: | |
typescript-repo-path: ${{github.event.pull_request.head.repo.full_name}} | |
version: ${{github.event.pull_request.head.ref}} | |
version-is-repo-ref: true | |
stress-tests: | |
uses: ./.github/workflows/stress.yml | |
with: | |
test-type: ci-stress | |
test-timeout-minutes: 20 | |
reuse-v8-context: false | |
stress-tests-reuse-context: | |
uses: ./.github/workflows/stress.yml | |
with: | |
test-type: ci-stress | |
test-timeout-minutes: 20 | |
reuse-v8-context: true |