Skip to content

Add logger as a dependency #6868

Add logger as a dependency

Add logger as a dependency #6868

Workflow file for this run

name: PR Continuous Integration
on:
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }} # Ensure that only one instance of this workflow is running per Pull Request
cancel-in-progress: true # Cancel any previous runs of this workflow
jobs:
run_rubocop:
runs-on: ubuntu-22.04
steps:
- name: Configure git
run: 'git config --global init.defaultBranch main'
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # tag v5.0.0
- uses: ruby/setup-ruby@44511735964dcb71245e7e55f72539531f7bc0eb # tag v1.257.0
with:
ruby-version: 3.5.0-preview1
- run: bundle
- run: rubocop
unit_tests:
needs: run_rubocop
runs-on: ubuntu-22.04
services:
mysql:
image: mysql:5.7
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
CI_FOR_PR: true
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
ports:
- "3306:3306"
strategy:
fail-fast: false
matrix:
ruby-version: [2.4.10, 3.4.4, 3.5.0-preview1]
steps:
- name: Configure git
run: 'git config --global init.defaultBranch main'
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # tag v5.0.0
- name: Run Unit and Env tests
uses: ./.github/actions/run_unit_tests
with:
ruby-version: ${{ matrix.ruby-version }}
multiverse:
needs: run_rubocop
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
multiverse: [agent, ai, background, background_2, frameworks, httpclients, httpclients_2, hybrid_agent, rails, rest]
ruby-version: [2.4.10, 3.4.4, 3.5.0-preview1]
steps:
- name: Configure git
run: 'git config --global init.defaultBranch main'
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # tag v5.0.0
- name: Run Multiverse (${{ matrix.multiverse }})
uses: ./.github/actions/run_multiverse
with:
ruby-version: ${{ matrix.ruby-version }}
group: ${{ matrix.multiverse }}
multiverse_services_1:
needs: run_rubocop
runs-on: ubuntu-22.04
services:
mongodb:
image: ${{ contains(fromJson('["2.4.10"]'), matrix.ruby-version) && 'mongo:5.0.11' || 'mongo:latest' }}
ports:
- 27017:27017
rabbitmq:
image: rabbitmq:latest
ports:
- 5672:5672
options: >-
--health-cmd "rabbitmq-diagnostics -q check_port_connectivity"
--health-interval 10s
--health-timeout 5s
--health-retries 5
strategy:
fail-fast: false
matrix:
ruby-version: [2.4.10, 3.4.4, 3.5.0-preview1]
steps:
- name: Configure git
run: 'git config --global init.defaultBranch main'
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # tag v5.0.0
- name: Run Multiverse (services_1)
uses: ./.github/actions/run_multiverse
with:
ruby-version: ${{ matrix.ruby-version }}
group: services_1
multiverse_services_2:
needs: run_rubocop
runs-on: ubuntu-22.04
services:
memcached:
image: memcached:latest
ports:
- 11211:11211
options: >-
--health-cmd "timeout 5 bash -c 'cat < /dev/null > /dev/udp/127.0.0.1/11211'"
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
postgres:
image: postgres:latest
env:
POSTGRES_USERNAME: postgres
POSTGRES_PASSWORD: password
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
strategy:
fail-fast: false
matrix:
ruby-version: [2.4.10, 3.4.4, 3.5.0-preview1]
steps:
- name: Configure git
run: 'git config --global init.defaultBranch main'
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # tag v5.0.0
- name: Run Multiverse (services_2)
uses: ./.github/actions/run_multiverse
with:
ruby-version: ${{ matrix.ruby-version }}
group: services_2
multiverse_services_elasticsearch:
needs: run_rubocop
runs-on: ubuntu-22.04
services:
elasticsearch7:
image: elasticsearch:7.16.2
env:
discovery.type: single-node
ports:
- 9200:9200
options: >-
--health-cmd "curl http://localhost:9200/_cluster/health"
--health-interval 10s
--health-timeout 5s
--health-retries 10
elasticsearch9:
image: elasticsearch:9.0.2
env:
discovery.type: single-node
xpack.security.enabled: false
ports:
- 9252:9200
options: >-
--health-cmd "curl http://localhost:9200/_cluster/health"
--health-interval 10s
--health-timeout 5s
--health-retries 10
strategy:
fail-fast: false
matrix:
ruby-version: [2.4.10, 3.4.4, 3.5.0-preview1]
steps:
- name: Configure git
run: 'git config --global init.defaultBranch main'
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # tag v5.0.0
- name: Run Multiverse (services_elasticsearch)
uses: ./.github/actions/run_multiverse
with:
ruby-version: ${{ matrix.ruby-version }}
group: services_elasticsearch
multiverse_services_kafka:
needs: run_rubocop
runs-on: ubuntu-22.04
services:
kafka:
image: bitnami/kafka:3.9.0
ports:
- 9092:9092
options: >-
--health-cmd "kafka-broker-api-versions.sh --version"
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
KAFKA_CFG_ZOOKEEPER_CONNECT: zookeeper:2181
ALLOW_PLAINTEXT_LISTENER: yes
KAFKA_LISTENERS: INSIDE://0.0.0.0:9093,OUTSIDE://0.0.0.0:9092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INSIDE:PLAINTEXT,OUTSIDE:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: INSIDE
KAFKA_ADVERTISED_LISTENERS: INSIDE://kafka:9093,OUTSIDE://localhost:9092
zookeeper:
image: bitnami/zookeeper
ports:
- 2181:2181
env:
ALLOW_ANONYMOUS_LOGIN: yes
options: >-
--health-cmd "echo mntr | nc -w 2 -q 2 localhost 2181"
--health-interval 10s
--health-timeout 5s
--health-retries 5
strategy:
fail-fast: false
matrix:
ruby-version: [2.4.10, 3.4.4, 3.5.0-preview1]
steps:
- name: Configure git
run: 'git config --global init.defaultBranch main'
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # tag v5.0.0
- name: Run Multiverse (services_kafka)
uses: ./.github/actions/run_multiverse
with:
ruby-version: ${{ matrix.ruby-version }}
group: services_kafka
multiverse_services_mysql_pg:
needs: run_rubocop
runs-on: ubuntu-22.04
services:
mysql:
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: root
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
ports:
- 3306
postgres:
image: postgres:latest
env:
POSTGRES_USERNAME: postgres
POSTGRES_PASSWORD: password
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
strategy:
fail-fast: false
matrix:
ruby-version: [2.4.10, 3.4.4, 3.5.0-preview1]
steps:
- name: Configure git
run: 'git config --global init.defaultBranch main'
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # tag v5.0.0
- name: Run Multiverse (services_mysql_pg)
uses: ./.github/actions/run_multiverse
with:
ruby-version: ${{ matrix.ruby-version }}
group: services_mysql_pg
infinite_tracing:
needs: run_rubocop
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
ruby-version: [2.7.8, 3.4.4, 3.5.0-preview1]
steps:
- name: Configure git
run: 'git config --global init.defaultBranch main'
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # tag v5.0.0
- name: Run Multiverse (infinite_tracing)
uses: ./.github/actions/run_multiverse
with:
ruby-version: ${{ matrix.ruby-version }}
group: infinite_tracing
simplecov:
needs: [unit_tests, multiverse, infinite_tracing, multiverse_services_1, multiverse_services_2, multiverse_services_elasticsearch, multiverse_services_kafka, multiverse_services_mysql_pg]
runs-on: ubuntu-22.04
if: github.event.pull_request.head.repo.full_name == github.repository
permissions:
pull-requests: write
steps:
- name: Configure git
run: 'git config --global init.defaultBranch main'
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # tag v5.0.0
- uses: ruby/setup-ruby@44511735964dcb71245e7e55f72539531f7bc0eb # tag v1.257.0
with:
ruby-version: 3.5.0-preview1
- run: bundle
- name: Download all workflow run artifacts
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # tag v5.0.0
- name: Collate Coverage Results
run: bundle exec rake coverage:report
- name: Upload coverage results
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # tag v4.6.2
with:
name: coverage-report-combined-${{ matrix.ruby-version }}
path: lib/coverage_results
include-hidden-files: true
retention-days: 2
- name: Simplecov Report
uses: ./.github/actions/simplecov-report
with:
token: ${{ secrets.GITHUB_TOKEN }}
resultPath: lib/coverage_results/.last_run.json
failedThreshold: 93.5
failedThresholdBranch: 0