Skip to content

WIP

WIP #188

Workflow file for this run

# Please do NOT manually edit this file.
# This file is generated by 'bundle exec rake github:actions:test_template'
---
name: Unit Tests
'on':
push:
branches:
- master
- poc/**
schedule:
- cron: 0 7 * * *
concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: "${{ github.ref != 'refs/heads/master' }}"
jobs:
batch-ruby-33:
runs-on: ubuntu-24.04
name: Batch ruby-3.3
outputs:
ruby-33-batches: "${{ steps.set-batches.outputs.ruby-33-batches }}"
container: ghcr.io/datadog/images-rb/engines/ruby:3.3
steps:
- uses: actions/checkout@v4
- run: bundle lock
- uses: actions/upload-artifact@v4
with:
name: lockfile-ruby-33-${{ github.run_id }}
path: "*.lock"
- run: bundle install
- id: set-batches
run: |
batches_json=$(bundle exec rake github:generate_batches)
echo "$batches_json" | ruby -rjson -e 'puts JSON.pretty_generate(JSON.parse(STDIN.read))'
echo "ruby-33-batches=$batches_json" >> $GITHUB_OUTPUT
- uses: actions/upload-artifact@v4
with:
name: bundle-ruby-33-${{ github.run_id }}
path: "/usr/local/bundle"
build-ruby-33:
needs:
- batch-ruby-33
runs-on: ubuntu-24.04
name: Build ruby-3.3
env:
BATCHED_TASKS: "${{ toJSON(matrix.tasks) }}"
strategy:
fail-fast: false
matrix:
include: "${{ fromJson(needs.batch-ruby-33.outputs.ruby-33-batches).include }}"
outputs:
ruby-33-batches: "${{ steps.set-batches.outputs.ruby-33-batches }}"
container: ghcr.io/datadog/images-rb/engines/ruby:3.3
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: lockfile-ruby-33-${{ github.run_id }}
- uses: actions/download-artifact@v4
with:
name: bundle-ruby-33-${{ github.run_id }}
path: "/usr/local/bundle"
- run: bundle check && bundle exec rake github:run_batch_build
- uses: actions/upload-artifact@v4
with:
name: bundled-dependencies-ruby-33-${{ matrix.batch }}-${{ github.run_id }}
path: "/usr/local/bundle"
test-ruby-33:
needs:
- batch-ruby-33
- build-ruby-33
runs-on: ubuntu-24.04
name: Test ruby-3.3[${{ matrix.batch }}]
env:
BATCHED_TASKS: "${{ toJSON(matrix.tasks) }}"
strategy:
fail-fast: false
matrix:
include: "${{ fromJson(needs.batch-ruby-33.outputs.ruby-33-batches).include }}"
container:
image: ghcr.io/datadog/images-rb/engines/ruby:3.3
env:
DD_INSTRUMENTATION_TELEMETRY_ENABLED: 'false'
DD_REMOTE_CONFIGURATION_ENABLED: 'false'
TEST_POSTGRES_HOST: postgres
TEST_REDIS_HOST: redis
TEST_ELASTICSEARCH_HOST: elasticsearch
TEST_MEMCACHED_HOST: memcached
TEST_MONGODB_HOST: mongodb
TEST_MYSQL_HOST: mysql
TEST_OPENSEARCH_HOST: opensearch
TEST_OPENSEARCH_PORT: '9200'
TEST_PRESTO_HOST: presto
DD_AGENT_HOST: agent
DD_TRACE_AGENT_PORT: '9126'
DATADOG_GEM_CI: 'true'
TEST_DATADOG_INTEGRATION: '1'
services:
postgres:
image: ghcr.io/datadog/images-rb/services/postgres:9.6
env:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
POSTGRES_DB: postgres
redis:
image: ghcr.io/datadog/images-rb/services/redis:6.2
elasticsearch:
image: ghcr.io/datadog/images-rb/services/elasticsearch:8.1.3
env:
discovery.type: single-node
xpack.security.enabled: 'false'
ES_JAVA_OPTS: "-Xms750m -Xmx750m"
memcached:
image: ghcr.io/datadog/images-rb/services/memcached:1.5-alpine
mongodb:
image: ghcr.io/datadog/images-rb/services/mongo:3.6
opensearch:
image: ghcr.io/datadog/images-rb/services/opensearchproject/opensearch:2.8.0
env:
discovery.type: single-node
DISABLE_SECURITY_PLUGIN: 'true'
DISABLE_PERFORMANCE_ANALYZER_AGENT_CLI: 'true'
cluster.routing.allocation.disk.watermark.low: 3gb
cluster.routing.allocation.disk.watermark.high: 2gb
cluster.routing.allocation.disk.watermark.flood_stage: 1gb
cluster.routing.allocation.disk.threshold_enabled: 'false'
presto:
image: ghcr.io/datadog/images-rb/services/starburstdata/presto:332-e.9
mysql:
image: ghcr.io/datadog/images-rb/services/mysql:8.0
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_PASSWORD: mysql
MYSQL_USER: mysql
agent:
image: ghcr.io/datadog/dd-apm-test-agent/ddapm-test-agent:v1.18.0
env:
LOG_LEVEL: DEBUG
TRACE_LANGUAGE: ruby
PORT: '9126'
DD_POOL_TRACE_CHECK_FAILURES: 'true'
DD_DISABLE_ERROR_RESPONSES: 'true'
ENABLED_CHECKS: trace_content_length,trace_stall,meta_tracer_version_header,trace_count_header,trace_peer_service,trace_dd_service
steps:
- uses: actions/checkout@v4
- name: Configure Git
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- uses: actions/download-artifact@v4
with:
name: lockfile-ruby-33-${{ github.run_id }}
- uses: actions/download-artifact@v4
with:
name: bundled-dependencies-ruby-33-${{ matrix.batch }}-${{ github.run_id }}
path: "/usr/local/bundle"
- run: bundle check
- name: Run batched tests
run: bundle exec rake github:run_batch_tests
timeout-minutes: 30
- if: "${{ failure() && env.RUNNER_DEBUG == '1' }}"
uses: mxschmitt/action-tmate@v3
with:
limit-access-to-actor: true
aggregate:
runs-on: ubuntu-24.04
needs:
- test-ruby-33
steps:
- run: echo "DONE!"