Skip to content

Experimental cloud operations client #1540

Experimental cloud operations client

Experimental cloud operations client #1540

Workflow file for this run

name: Continuous Integration
on:
pull_request:
push:
branches:
- master
jobs:
build-and-test:
strategy:
matrix:
os: [ubuntu-latest, macos-intel, macos-arm, windows-latest]
go-version: ["1.21", "1.22"]
include:
- os: ubuntu-latest
go-version: "1.22"
# We only want to upload coverage on a single target
uploadCoverage: true
# We only want to check docker compose on a single target
testDockerCompose: true
- os: macos-intel
runsOn: macos-12
- os: macos-arm
runsOn: macos-14
runs-on: ${{ matrix.runsOn || matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Check
run: go run . check
working-directory: ./internal/cmd/build
- name: Unit test
run: go run . unit-test -coverage=${{ matrix.uploadCoverage && 'true' || 'false' }}
working-directory: ./internal/cmd/build
- name: Integration tests (without cache)
run: go run . integration-test -dev-server
working-directory: ./internal/cmd/build
env:
WORKFLOW_CACHE_SIZE: "0"
TEMPORAL_COVERAGE_FILE: ${{ matrix.uploadCoverage && 'integ_test_zero_cache_cover.out' || '' }}
- name: Integration tests (with cache)
run: go run . integration-test -dev-server
working-directory: ./internal/cmd/build
env:
TEMPORAL_COVERAGE_FILE: ${{ matrix.uploadCoverage && 'integ_test_normal_cache_cover.out' || '' }}
- name: Merge coverage files
if: ${{ matrix.uploadCoverage }}
run: go run . merge-coverage-files ../../../coverage.out
working-directory: ./internal/cmd/build
- name: Upload coverage
if: ${{ matrix.uploadCoverage }}
continue-on-error: true
uses: coverallsapp/github-action@v2
with:
file: coverage.out
format: golang
- name: Docker compose - checkout
if: ${{ matrix.testDockerCompose }}
uses: actions/checkout@v3
with:
repository: temporalio/docker-compose
path: ./docker-compose
- name: Docker compose - start
if: ${{ matrix.testDockerCompose }}
run: |
cp ./.github/workflows/docker/docker-compose.override.yaml ./docker-compose/docker-compose.override.yaml
cp ./.github/workflows/docker/dynamic-config-custom.yaml ./docker-compose/dynamicconfig/dynamic-config-custom.yaml
docker-compose --project-directory ./docker-compose up &
go run ./.github/workflows/wait_for_server.go
- name: Docker compose - integration tests
if: ${{ matrix.testDockerCompose }}
run: go run . integration-test
working-directory: ./internal/cmd/build
cloud-test:
strategy:
matrix:
go-version: ["1.21", "1.22"]
# Try to avoid running tests in parallel to avoid workflow ID conflict
max-parallel: 1
# Only supported in non-fork runs, since secrets are not available in forks.
if: ${{ github.event.pull_request.head.repo.full_name == '' || github.event.pull_request.head.repo.full_name == 'temporalio/sdk-go' }}
runs-on: ubuntu-latest
env:
SERVICE_ADDR: sdk-ci.a2dd6.tmprl.cloud:7233
TEMPORAL_NAMESPACE: sdk-ci.a2dd6
TEMPORAL_CLIENT_CERT: ${{ secrets.TEMPORAL_CLIENT_CERT }}
TEMPORAL_CLIENT_KEY: ${{ secrets.TEMPORAL_CLIENT_KEY }}
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Single integration test against cloud
run: 'go test -v --count 1 -p 1 . -run "TestIntegrationSuite/TestBasic$"'
working-directory: test
- name: Cloud integration tests
run: 'go test -v --count 1 -p 1 . -run "TestCloudSuite/.*" -cloud-tests'
working-directory: test
features-test:
uses: temporalio/features/.github/workflows/go.yaml@main
with:
go-repo-path: ${{github.event.pull_request.head.repo.full_name}}
version: ${{github.event.pull_request.head.ref}}
version-is-repo-ref: true