[contrib] add orchestrion integration configuration #1449
This file contains 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: Orchestrion | |
on: | |
workflow_dispatch: # manually | |
inputs: | |
orchestrion-version: | |
description: Orchestrion version to use for integration testing | |
type: string | |
required: false | |
pull_request: | |
merge_group: | |
push: | |
branches: | |
- release-v* | |
tags-ignore: | |
- 'contrib/**' | |
- 'instrumentation/**' | |
permissions: read-all | |
concurrency: | |
# Automatically cancel previous runs if a new one is triggered to conserve resources. | |
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
generate: | |
name: Verify root orchestrion.tool.go file is up-to-date | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
- name: Setup Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: stable | |
cache: true | |
cache-dependency-path: '**/go.mod' | |
- name: Run generator | |
run: go generate ./internal/orchestrion | |
- name: Check for changes | |
run: git diff --exit-code | |
integration-test: | |
strategy: | |
fail-fast: false | |
matrix: | |
runs-on: | |
- ubuntu | |
- macos | |
- windows | |
go-version: [oldstable, stable] | |
mode: [DRIVER] | |
include: | |
# Alternate build modes (only on ubuntu with oldstable, so we save up CI time) | |
- runs-on: ubuntu | |
go-version: oldstable | |
mode: TOOLEXEC | |
- runs-on: ubuntu | |
go-version: oldstable | |
mode: GOFLAGS | |
name: Integration Test (${{ matrix.runs-on }} / ${{ matrix.go-version }} / ${{ matrix.mode }}) | |
runs-on: ${{ matrix.runs-on == 'ubuntu' && fromJson('{"labels":"ubuntu-16-core-latest","group":"Large Runner Shared Public"}') || (matrix.runs-on == 'windows' && fromJson('{"labels":"windows-shared-8core","group":"LARGE WINDOWS SHARED"}')) || format('{0}-latest', matrix.runs-on) }} | |
env: | |
# Ryuk is problematic with concurrent executions, and unnecessary in ephemeral environments like GHA. | |
TESTCONTAINERS_RYUK_DISABLED: true | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
- name: Setup Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: ${{ matrix.go-version }} | |
cache: true | |
cache-dependency-path: 'internal/orchestrion/_integration/go.mod' | |
- name: Set up orchestrion | |
if: github.event_name == 'workflow_dispatch' && github.event.inputs.orchestrion-version != '' | |
run: |- | |
go get "github.com/DataDog/orchestrion@${VERSION}" | |
go mod tidy | |
working-directory: internal/orchestrion/_integration | |
env: | |
VERSION: ${{ github.event.inputs.orchestrion-version }} | |
- name: Install orchestrion binary | |
run: |- | |
go install "github.com/DataDog/orchestrion" | |
echo "DD_ORCHESTRION_IS_GOMOD_VERSION=1" >> "${GITHUB_ENV}" | |
working-directory: internal/orchestrion/_integration | |
- name: Run Tests | |
shell: bash | |
run: |- | |
case "${MODE}" in | |
"DRIVER") | |
orchestrion go test -shuffle=on ./... | |
;; | |
"TOOLEXEC") | |
go test -shuffle=on -toolexec='orchestrion toolexec' ./... | |
;; | |
"GOFLAGS") | |
export GOFLAGS="${GOFLAGS} '-toolexec=orchestrion toolexec'" | |
go test -shuffle=on ./... | |
;; | |
*) | |
echo "Unknown mode: ${MODE}" | |
;; | |
esac | |
working-directory: internal/orchestrion/_integration | |
env: | |
GOFLAGS: -tags=githubci,buildtag | |
MODE: ${{ matrix.mode }} |