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: Java Features Testing
on:
workflow_call:
inputs:
java-repo-path:
type: string
default: 'temporalio/sdk-java'
version:
required: true
type: string
# When true, the version refers to a repo tag/ref. When false, package version downloaded via
# gradle.
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", java 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 }}
fetch-depth: 0
- name: Checkout Java SDK repo
uses: actions/checkout@v3
if: ${{ inputs.version-is-repo-ref }}
with:
repository: ${{ inputs.java-repo-path }}
submodules: recursive
path: sdk-java
ref: ${{ inputs.version }}
fetch-depth: 0
- uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '11'
- 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 java ${{ inputs.docker-image-artifact-name && '--server localhost:7233 --namespace default' || ''}} --version "${{ inputs.version-is-repo-ref && '$(realpath ../sdk-java)' || 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
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-java features-tests-java
- 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