Skip to content

Complete deduplication of versions in CI yaml #418

Complete deduplication of versions in CI yaml

Complete deduplication of versions in CI yaml #418

Workflow file for this run

name: Continuous Integration
on: # rebuild any PRs and main branch changes
pull_request:
push:
branches:
- main
jobs:
versions:
outputs:
dotnet_sdk: ${{ steps.versions.outputs.dotnet_sdk }}
go_sdk: ${{ steps.versions.outputs.go_sdk }}
java_sdk: ${{ steps.versions.outputs.java_sdk }}
python_sdk: ${{ steps.versions.outputs.python_sdk }}
ts_sdk: ${{ steps.versions.outputs.ts_sdk }}
go: ${{ steps.versions.outputs.go }}
java: ${{ steps.versions.outputs.java }}
protoc_gen_go: ${{ steps.versions.outputs.protoc_gen_go }}
protoc: ${{ steps.versions.outputs.protoc }}
python: ${{ steps.versions.outputs.python }}
rust_toolchain: ${{ steps.versions.outputs.rust_toolchain }}
runs-on: ubuntu-latest
steps:
- name: Output versions
id: versions
run: |
echo "dotnet_sdk=1.4.0" >> $GITHUB_OUTPUT
echo "go_sdk=1.32.1" >> $GITHUB_OUTPUT
echo "java_sdk=1.27.0" >> $GITHUB_OUTPUT
echo "python_sdk=1.9.0" >> $GITHUB_OUTPUT
echo "ts_sdk=1.11.6" >> $GITHUB_OUTPUT
echo "go=^1.21" >> $GITHUB_OUTPUT
echo "java=11" >> $GITHUB_OUTPUT
echo "protoc_gen_go=1.31.0" >> $GITHUB_OUTPUT
echo "protoc=25.1" >> $GITHUB_OUTPUT
echo "python=3.10" >> $GITHUB_OUTPUT
echo "rust_toolchain=1.74.0" >> $GITHUB_OUTPUT
build-lint-test-go:
runs-on: ubuntu-latest
needs: versions
steps:
- name: Print build information
run: "echo head_ref: ${{ github.head_ref }}, ref: ${{ github.ref }}"
- name: Checkout repo
uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: "${{ needs.versions.outputs.go }}"
- name: Build exe
run: go build -o temporal-omes ./cmd
- name: Test
run: go test ./...
- name: Run local scenario with worker
run: ./temporal-omes run-scenario-with-worker --scenario workflow_with_single_noop_activity --log-level debug --language go --embedded-server --iterations 5
- name: Build worker image
run: ./temporal-omes build-worker-image --language go --version v${{ needs.versions.outputs.go_sdk }} --tag-as-latest
- name: Run worker image
run: docker run --rm --detach -i -p 10233:10233 omes:go-${{ needs.versions.outputs.go_sdk }} --scenario workflow_with_single_noop_activity --log-level debug --language go --run-id ${{ github.run_id }} --embedded-server-address 0.0.0.0:10233
- name: Run scenario against image
run: ./temporal-omes run-scenario --scenario workflow_with_single_noop_activity --log-level debug --server-address 127.0.0.1:10233 --run-id ${{ github.run_id }} --connect-timeout 1m --iterations 5
build-lint-test-java:
needs: versions
runs-on: ubuntu-latest
steps:
- name: Print build information
run: "echo head_ref: ${{ github.head_ref }}, ref: ${{ github.ref }}"
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: "${{ needs.versions.outputs.java }}"
- name: Set up Gradle
uses: gradle/gradle-build-action@v2
- name: Lint Java worker
run: cd workers/java && ./gradlew --no-daemon spotlessCheck
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: "${{ needs.versions.outputs.go }}"
- name: Build exe
run: go build -o temporal-omes ./cmd
- name: Run local scenario with worker
run: ./temporal-omes run-scenario-with-worker --scenario workflow_with_single_noop_activity --log-level debug --language java --embedded-server --iterations 5
- name: Build worker image
run: ./temporal-omes build-worker-image --language java --version ${{ needs.versions.outputs.java_sdk }} --tag-as-latest
- name: Run worker image
run: docker run --rm --detach -i -p 10233:10233 omes:java-${{ needs.versions.outputs.java_sdk }} --scenario workflow_with_single_noop_activity --log-level debug --language java --run-id ${{ github.run_id }} --embedded-server-address 0.0.0.0:10233
- name: Run scenario against image
run: ./temporal-omes run-scenario --scenario workflow_with_single_noop_activity --log-level debug --server-address 127.0.0.1:10233 --run-id ${{ github.run_id }} --connect-timeout 1m --iterations 5
build-lint-test-python:
needs: versions
runs-on: ubuntu-latest
steps:
- name: Print build information
run: "echo head_ref: ${{ github.head_ref }}, ref: ${{ github.ref }}"
- name: Checkout repo
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: "${{ needs.versions.outputs.python }}"
- name: Install Python prequisites
run: python -m pip install --upgrade wheel poetry poethepoet
- name: Initialize Python worker
run: cd workers/python && poetry install --no-root
- name: Lint Python worker
run: cd workers/python && poe lint
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: "${{ needs.versions.outputs.go }}"
- name: Build exe
run: go build -o temporal-omes ./cmd
- name: Run local scenario with worker
run: ./temporal-omes run-scenario-with-worker --scenario workflow_with_single_noop_activity --log-level debug --language python --embedded-server --iterations 5
- name: Build worker image
run: ./temporal-omes build-worker-image --language python --version ${{ needs.versions.outputs.python_sdk }} --tag-as-latest
- name: Run worker image
run: docker run --rm --detach -i -p 10233:10233 omes:python-${{ needs.versions.outputs.python_sdk }} --scenario workflow_with_single_noop_activity --log-level debug --language python --run-id ${{ github.run_id }} --embedded-server-address 0.0.0.0:10233
- name: Run scenario against image
run: ./temporal-omes run-scenario --scenario workflow_with_single_noop_activity --log-level debug --server-address 127.0.0.1:10233 --run-id ${{ github.run_id }} --connect-timeout 1m --iterations 5
build-lint-test-typescript:
runs-on: ubuntu-latest
steps:
- name: Print build information
run: "echo head_ref: ${{ github.head_ref }}, ref: ${{ github.ref }}"
- name: Checkout repo
uses: actions/checkout@v2
with:
submodules: 'true'
- name: Setup TypeScript
uses: actions/setup-node@v4
- name: Initialize TypeScript worker
run: cd workers/typescript && npm ci && npm run build
- name: Lint TypeScript worker
run: cd workers/typescript && npm run lint-ci
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: "${{ needs.versions.outputs.go }}"
- name: Build exe
run: go build -o temporal-omes ./cmd
- name: Run local scenario with worker
run: ./temporal-omes run-scenario-with-worker --scenario workflow_with_single_noop_activity --log-level debug --language ts --embedded-server --iterations 5
- name: Build worker image
run: ./temporal-omes build-worker-image --language ts --version ${{ needs.versions.outputs.ts_sdk }} --tag-as-latest
- name: Run worker image
run: docker run --rm --detach -i -p 10233:10233 omes:typescript-${{ needs.versions.outputs.ts_sdk }} --scenario workflow_with_single_noop_activity --log-level debug --language ts --run-id ${{ github.run_id }} --embedded-server-address 0.0.0.0:10233
- name: Run scenario against image
run: ./temporal-omes run-scenario --scenario workflow_with_single_noop_activity --log-level debug --server-address 127.0.0.1:10233 --run-id ${{ github.run_id }} --connect-timeout 1m --iterations 5
build-lint-test-dotnet:
runs-on: ubuntu-latest
steps:
- name: Print build information
run: "echo head_ref: ${{ github.head_ref }}, ref: ${{ github.ref }}"
- name: Checkout repo
uses: actions/checkout@v2
with:
submodules: 'true'
- name: Setup Dotnet
uses: actions/setup-dotnet@v3
- name: Check formatting
run: cd workers/dotnet && dotnet format --verify-no-changes
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: "${{ needs.versions.outputs.go }}"
- name: Build exe
run: go build -o temporal-omes ./cmd
- name: Run local scenario with worker
run: ./temporal-omes run-scenario-with-worker --scenario workflow_with_single_noop_activity --log-level debug --language cs --embedded-server --iterations 5
- name: Build worker image
run: ./temporal-omes build-worker-image --language cs --version ${{ needs.versions.outputs.dotnet_sdk }} --tag-as-latest
- name: Run worker image
run: docker run --rm --detach -i -p 10233:10233 omes:dotnet-${{ needs.versions.outputs.dotnet_sdk }} --scenario workflow_with_single_noop_activity --log-level debug --language cs --run-id ${{ github.run_id }} --embedded-server-address 0.0.0.0:10233
- name: Run scenario against image
run: ./temporal-omes run-scenario --scenario workflow_with_single_noop_activity --log-level debug --server-address 127.0.0.1:10233 --run-id ${{ github.run_id }} --connect-timeout 1m --iterations 5
build-ks-gen-and-ensure-protos-up-to-date:
needs: versions
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
submodules: 'true'
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: "${{ needs.versions.outputs.rust_toolchain }}"
override: true
- name: Install protoc
uses: arduino/setup-protoc@v2
with:
version: "${{ needs.versions.outputs.protoc }}"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: "${{ needs.versions.outputs.go }}"
- name: Install protoc-gen-go
run: go install google.golang.org/protobuf/cmd/protoc-gen-go@v${{ needs.versions.outputs.protoc_gen_go }}
- name: Build kitchen-sink-gen
working-directory: ./loadgen/kitchen-sink-gen
run: cargo build
- name: Check diff
run: |
git config --global core.safecrlf false
git diff > generator.diff
git diff --exit-code
- name: Upload generator diff
uses: actions/upload-artifact@v4
if: always()
with:
name: generator-diff
path: generator.diff
if-no-files-found: ignore
push-latest-docker-images:
needs: versions
uses: ./.github/workflows/all-docker-images.yml
secrets: inherit
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
with:
do-push: true
as-latest: true
go-version: v${{ needs.versions.outputs.go_sdk }}
ts-version: v${{ needs.versions.outputs.ts_sdk }}
java-version: v${{ needs.versions.outputs.java_sdk }}
py-version: v${{ needs.versions.outputs.python_sdk }}
dotnet-version: v${{ needs.versions.outputs.dotnet_sdk }}