Skip to content

Refer to this repo explicitly #1

Refer to this repo explicitly

Refer to this repo explicitly #1

Workflow file for this run

name: Go Features Testing
on:
workflow_call:
inputs:
go-repo-path:
type: string
default: 'temporalio/sdk-go'
version:
required: true
type: string
# When true, the version refers to a repo tag/ref. When false, Go package version.
version-is-repo-ref:
required: true
type: boolean
features-repo-path:
type: string
default: 'temporalio/features'
features-repo-ref:
type: string
default: 'main'
# If set, download the docker image for server from the provided artifact name
docker-image-artifact-name:
type: string
required: false
jobs:
test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./features
steps:
- name: Print git info
run: 'echo head_ref: "$GITHUB_HEAD_REF", ref: "$GITHUB_REF", go sdk version: ${{ inputs.version }}'
working-directory: '.'
- name: Download docker artifacts
if: ${{ inputs.docker-image-artifact-name }}
uses: temporalio/features/.github/actions/download-artifact
with:
artifact-name: ${{ inputs.docker-image-artifact-name }}
- name: Checkout SDK features repo
uses: actions/checkout@v3
with:
path: features
repository: ${{ inputs.features-repo-path }}
ref: ${{ inputs.features-repo-ref }}
- name: Checkout Go SDK repo
if: ${{ inputs.version-is-repo-ref }}
uses: actions/checkout@v2
with:
repository: ${{ inputs.go-repo-path }}
submodules: recursive
path: sdk-go
ref: ${{ inputs.version }}
- uses: actions/setup-go@v2
with:
go-version: '^1.20'
- name: Start containerized server and dependencies
if: inputs.docker-image-artifact-name
run: |
docker compose \
-f ./dockerfiles/docker-compose.for-server-image.yaml \
-f /tmp/server-docker/docker-compose.yml \
up -d temporal-server cassandra elasticsearch
- name: Run SDK-features tests directly
if: inputs.docker-image-artifact-name == ''
run: go run . run --lang go ${{ inputs.docker-image-artifact-name && '--server localhost:7233 --namespace default' || ''}} --version "${{ inputs.version-is-repo-ref && '$(realpath ../sdk-go)' || inputs.version }}"
# Running the tests in their own step keeps the logs readable
- name: Run containerized SDK-features tests
if: inputs.docker-image-artifact-name
env:
WAIT_EXTRA_FOR_NAMESPACE: true
run: |
docker compose \
-f ./dockerfiles/docker-compose.for-server-image.yaml \
-f /tmp/server-docker/docker-compose.yml \
up --no-log-prefix --exit-code-from features-tests-go features-tests-go
- name: Tear down docker compose
if: inputs.docker-image-artifact-name && (success() || failure())
run: docker compose -f ./dockerfiles/docker-compose.for-server-image.yaml -f /tmp/server-docker/docker-compose.yml down -v