Build proto in Docker #732
Workflow file for this run
This file contains hidden or 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 | |
| jobs: | |
| build-lint-test-go: | |
| 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: Load versions | |
| run: | | |
| set -a && source versions.env && set +a | |
| printenv >> $GITHUB_ENV | |
| - name: Setup Go | |
| uses: actions/setup-go@v2 | |
| with: | |
| go-version: "${{ env.GO_VERSION }}" | |
| - name: Build exe | |
| run: go build -o temporal-omes ./cmd | |
| - name: Test | |
| run: go test -race ./... | |
| - 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 --version v${{ env.GO_SDK_VERSION }} | |
| - name: Build worker image | |
| run: ./temporal-omes build-worker-image --language go --version v${{ env.GO_SDK_VERSION }} --tag-as-latest | |
| - name: Run worker image | |
| run: docker run --rm --detach -i -p 10233:10233 omes:go-${{ env.GO_SDK_VERSION }} --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: | |
| 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: Load versions | |
| run: | | |
| set -a && source versions.env && set +a | |
| printenv >> $GITHUB_ENV | |
| - name: Setup Java | |
| uses: actions/setup-java@v2 | |
| with: | |
| distribution: 'temurin' | |
| java-version: "${{ env.JAVA_VERSION }}" | |
| - 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: "${{ env.GO_VERSION }}" | |
| - 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 --version ${{ env.JAVA_SDK_VERSION }} | |
| - name: Build worker image | |
| run: ./temporal-omes build-worker-image --language java --version ${{ env.JAVA_SDK_VERSION }} --tag-as-latest | |
| - name: Run worker image | |
| run: docker run --rm --detach -i -p 10233:10233 omes:java-${{ env.JAVA_SDK_VERSION }} --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: | |
| 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: Load versions | |
| run: | | |
| set -a && source versions.env && set +a | |
| printenv >> $GITHUB_ENV | |
| - name: Setup Python | |
| uses: actions/setup-python@v1 | |
| with: | |
| python-version: "${{ env.PYTHON_VERSION }}" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| - name: Install poe | |
| run: uv tool install poethepoet | |
| - name: Prepare Python worker environment | |
| run: cd workers/python && uv sync | |
| - name: Lint Python worker | |
| run: cd workers/python && poe lint | |
| - name: Setup Go | |
| uses: actions/setup-go@v2 | |
| with: | |
| go-version: "${{ needs.load-versions.outputs.go_version }}" | |
| - 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 --version ${{ env.PYTHON_SDK_VERSION }} | |
| - name: Build worker image | |
| run: ./temporal-omes build-worker-image --language python --version ${{ env.PYTHON_SDK_VERSION }} --tag-as-latest | |
| - name: Run worker image | |
| run: docker run --rm --detach -i -p 10233:10233 omes:python-${{ env.PYTHON_SDK_VERSION }} --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: Load versions | |
| run: | | |
| set -a && source versions.env && set +a | |
| printenv >> $GITHUB_ENV | |
| - 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: "${{ env.GO_VERSION }}" | |
| - 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 --version ${{ env.TYPESCRIPT_SDK_VERSION }} | |
| - name: Build worker image | |
| run: ./temporal-omes build-worker-image --language ts --version ${{ env.TYPESCRIPT_SDK_VERSION }} --tag-as-latest | |
| - name: Run worker image | |
| run: docker run --rm --detach -i -p 10233:10233 omes:typescript-${{ env.TYPESCRIPT_SDK_VERSION }} --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: Load versions | |
| run: | | |
| set -a && source versions.env && set +a | |
| printenv >> $GITHUB_ENV | |
| - 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: "${{ env.GO_VERSION }}" | |
| - 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 --version ${{ env.DOTNET_SDK_VERSION }} | |
| - name: Build worker image | |
| run: ./temporal-omes build-worker-image --language cs --version ${{ env.DOTNET_SDK_VERSION }} --tag-as-latest | |
| - name: Run worker image | |
| run: docker run --rm --detach -i -p 10233:10233 omes:dotnet-${{ env.DOTNET_SDK_VERSION }} --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: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v2 | |
| with: | |
| submodules: 'true' | |
| - name: Build proto | |
| run: ./scripts/build_proto.sh | |
| - 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 | |
| # env cannot be referenced in jobs.<job_id>.with.<with_id>, so we need a job to run before | |
| # to append a "v" to the version string | |
| prepare-for-docker-push: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| go-sdk-version: ${{ steps.set-output.outputs.go-sdk-version }} | |
| ts-sdk-version: ${{ steps.set-output.outputs.ts-sdk-version }} | |
| java-sdk-version: ${{ steps.set-output.outputs.java-sdk-version }} | |
| python-sdk-version: ${{ steps.set-output.outputs.python-sdk-version }} | |
| dotnet-sdk-version: ${{ steps.set-output.outputs.dotnet-sdk-version }} | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v2 | |
| - name: Load versions | |
| run: | | |
| set -a && source versions.env && set +a | |
| printenv >> $GITHUB_ENV | |
| - name: Set output variables to pass to docker YML | |
| id: set-output | |
| run: | | |
| echo "go-sdk-version=v${{ env.GO_SDK_VERSION }}" >> "$GITHUB_OUTPUT" | |
| echo "ts-sdk-version=v${{ env.TYPESCRIPT_SDK_VERSION }}" >> "$GITHUB_OUTPUT" | |
| echo "java-sdk-version=v${{ env.JAVA_SDK_VERSION }}" >> "$GITHUB_OUTPUT" | |
| echo "python-sdk-version=v${{ env.PYTHON_SDK_VERSION }}" >> "$GITHUB_OUTPUT" | |
| echo "dotnet-sdk-version=v${{ env.DOTNET_SDK_VERSION }}" >> "$GITHUB_OUTPUT" | |
| push-latest-docker-images: | |
| needs: prepare-for-docker-push | |
| uses: ./.github/workflows/all-docker-images.yml | |
| secrets: inherit | |
| with: | |
| # Only images that are built from `main` are tagged as `latest`. | |
| # This ensures that internal systems can rely on the latest tag to be stable. | |
| as-latest: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
| do-push: true | |
| go-version: ${{ needs.prepare-for-docker-push.outputs.go-sdk-version }} | |
| ts-version: ${{ needs.prepare-for-docker-push.outputs.ts-sdk-version }} | |
| java-version: ${{ needs.prepare-for-docker-push.outputs.java-sdk-version }} | |
| py-version: ${{ needs.prepare-for-docker-push.outputs.python-sdk-version }} | |
| dotnet-version: ${{ needs.prepare-for-docker-push.outputs.dotnet-sdk-version }} |