Skip to content

Parameterize versions in GitHub Workflow YAML #407

Parameterize versions in GitHub Workflow YAML

Parameterize versions in GitHub Workflow YAML #407

Workflow file for this run

name: Continuous Integration
on: # rebuild any PRs and main branch changes
pull_request:
push:
branches:
- main
env:
DOTNET_SDK_VERSION: "1.4.0"
GO_SDK_VERSION: "1.32.1"
JAVA_SDK_VERSION: "1.27.0"
TYPESCRIPT_SDK_VERSION: "1.11.6"
GO_VERSION: "^1.21"
JAVA_VERSION: "11"
PROTOC_GEN_GO_VERSION: "v1.31.0"
PROTOC_VERSION: "25.1"
PYTHON_SDK_VERSION: "1.9.0"
PYTHON_VERSION: "3.10"
RUST_TOOLCHAIN: "1.74.0"
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: 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 ./...
- 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${{ 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: 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
- 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: Setup Python
uses: actions/setup-python@v1
with:
python-version: "${{ env.PYTHON_VERSION }}"
- 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: "${{ 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 python --embedded-server --iterations 5
- 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: 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
- 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: 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
- 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'
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: "${{ env.RUST_TOOLCHAIN }}"
override: true
- name: Install protoc
uses: arduino/setup-protoc@v2
with:
version: "${{ env.PROTOC_VERSION }}"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: "${{ env.GO_VERSION }}"
- name: Install protoc-gen-go
run: go install google.golang.org/protobuf/cmd/protoc-gen-go@${{ env.PROTOC_GEN_GO_VERSION }}
- 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:
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${{ env.GO_SDK_VERSION }}

Check failure on line 214 in .github/workflows/ci.yml

View workflow run for this annotation

GitHub Actions / Continuous Integration

Invalid workflow file

The workflow is not valid. .github/workflows/ci.yml (Line: 214, Col: 19): Unrecognized named-value: 'env'. Located at position 1 within expression: env.GO_SDK_VERSION .github/workflows/ci.yml (Line: 215, Col: 19): Unrecognized named-value: 'env'. Located at position 1 within expression: env.TYPESCRIPT_SDK_VERSION
ts-version: v${{ env.TYPESCRIPT_SDK_VERSION }}
java-version: v${{ env.JAVA_SDK_VERSION }}
py-version: v${{ env.PYTHON_SDK_VERSION }}
dotnet-version: v${{ env.DOTNET_SDK_VERSION }}