diff --git a/.github/workflows/check-spelling.yml b/.github/workflows/check-spelling.yml deleted file mode 100644 index 67eac58890..0000000000 --- a/.github/workflows/check-spelling.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Spelling - -on: - pull_request: - -permissions: - contents: read - -jobs: - spelling-check: - name: SPELLING check - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v5 - - uses: streetsidesoftware/cspell-action@v7 - with: - # Files should be consistent with check:spelling files - files: | - **/*.md - config: .cspell.yml diff --git a/.github/workflows/ci-contrib.yml b/.github/workflows/ci-contrib.yml index d24873ac3d..7285ed5899 100644 --- a/.github/workflows/ci-contrib.yml +++ b/.github/workflows/ci-contrib.yml @@ -5,9 +5,22 @@ on: push: branches: - main + paths: &path_filters + - 'helpers/**' + - 'propagator/**' + - 'resources/**' + - 'processor/**' + - 'sampler/**' + - '.github/workflows/ci-contrib.yml' + - '.github/actions/**' + - 'Gemfile' + - 'Rakefile' + - '.rubocop.yml' + - 'gemspecs/**' pull_request: branches: - main + paths: *path_filters schedule: - cron: "0 0 * * *" diff --git a/.github/workflows/ci-instrumentation-full.yml b/.github/workflows/ci-instrumentation-full.yml new file mode 100644 index 0000000000..f869c7db19 --- /dev/null +++ b/.github/workflows/ci-instrumentation-full.yml @@ -0,0 +1,156 @@ +name: CI Instrumentation Full + +on: + workflow_dispatch: + push: + branches: + - main + paths: &path_filters + - 'helpers/**' + - 'instrumentation/action_mailer/**' + - 'instrumentation/action_pack/**' + - 'instrumentation/action_view/**' + - 'instrumentation/active_job/**' + - 'instrumentation/active_model_serializers/**' + - 'instrumentation/active_record/**' + - 'instrumentation/active_storage/**' + - 'instrumentation/active_support/**' + - 'instrumentation/aws_sdk/**' + - 'instrumentation/aws_lambda/**' + - 'instrumentation/base/**' + - 'instrumentation/concurrent_ruby/**' + - 'instrumentation/delayed_job/**' + - 'instrumentation/ethon/**' + - 'instrumentation/excon/**' + - 'instrumentation/faraday/**' + - 'instrumentation/grape/**' + - 'instrumentation/graphql/**' + - 'instrumentation/grpc/**' + - 'instrumentation/gruf/**' + - 'instrumentation/http/**' + - 'instrumentation/http_client/**' + - 'instrumentation/httpx/**' + - 'instrumentation/koala/**' + - 'instrumentation/lmdb/**' + - 'instrumentation/logger/**' + - 'instrumentation/net_http/**' + - 'instrumentation/rack/**' + - 'instrumentation/rails/**' + - 'instrumentation/restclient/**' + - 'instrumentation/rspec/**' + - 'instrumentation/sinatra/**' + - '.github/workflows/ci-instrumentation-full.yml' + - '.github/actions/**' + - 'Gemfile' + - 'Rakefile' + - '.rubocop.yml' + - 'gemspecs/**' + pull_request: + branches: + - main + paths: *path_filters + schedule: + - cron: "0 0 * * *" + +permissions: + contents: read + +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: + instrumentation: + strategy: + fail-fast: false + matrix: + gem: + - action_mailer + - action_pack + - action_view + - active_job + - active_model_serializers + - active_record + - active_storage + - active_support + - aws_sdk + - aws_lambda + - base + - concurrent_ruby + - delayed_job + - ethon + - excon + - faraday + - grape + - graphql + - grpc + - gruf + - http + - http_client + - httpx + - koala + - lmdb + - logger + - net_http + - rack + - rails + - restclient + - rspec + - sinatra + os: + - ubuntu-latest + + name: ${{ matrix.gem }} / ${{ matrix.os }} + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v5 + - name: "Test Ruby 3.4" + uses: ./.github/actions/test_gem + with: + gem: "opentelemetry-instrumentation-${{ matrix.gem }}" + ruby: "3.4" + - name: "Test Ruby 3.3" + uses: ./.github/actions/test_gem + with: + gem: "opentelemetry-instrumentation-${{ matrix.gem }}" + ruby: "3.3" + - name: "Test Ruby 3.2" + uses: ./.github/actions/test_gem + with: + gem: "opentelemetry-instrumentation-${{ matrix.gem }}" + ruby: "3.2" + yard: true + rubocop: true + coverage: true + build: true + - name: "JRuby Filter" + id: jruby_skip + shell: bash + run: | + echo "skip=false" >> $GITHUB_OUTPUT + [[ "${{ matrix.gem }}" == "action_pack" ]] && echo "skip=true" >> $GITHUB_OUTPUT + [[ "${{ matrix.gem }}" == "action_view" ]] && echo "skip=true" >> $GITHUB_OUTPUT + [[ "${{ matrix.gem }}" == "active_model_serializers" ]] && echo "skip=true" >> $GITHUB_OUTPUT + [[ "${{ matrix.gem }}" == "active_record" ]] && echo "skip=true" >> $GITHUB_OUTPUT + [[ "${{ matrix.gem }}" == "active_storage" ]] && echo "skip=true" >> $GITHUB_OUTPUT + [[ "${{ matrix.gem }}" == "active_support" ]] && echo "skip=true" >> $GITHUB_OUTPUT + [[ "${{ matrix.gem }}" == "aws_sdk" ]] && echo "skip=true" >> $GITHUB_OUTPUT + [[ "${{ matrix.gem }}" == "aws_lambda" ]] && echo "skip=true" >> $GITHUB_OUTPUT + [[ "${{ matrix.gem }}" == "delayed_job" ]] && echo "skip=true" >> $GITHUB_OUTPUT + [[ "${{ matrix.gem }}" == "graphql" ]] && echo "skip=true" >> $GITHUB_OUTPUT + [[ "${{ matrix.gem }}" == "http" ]] && echo "skip=true" >> $GITHUB_OUTPUT + [[ "${{ matrix.gem }}" == "http_client" ]] && echo "skip=true" >> $GITHUB_OUTPUT + [[ "${{ matrix.gem }}" == "koala" ]] && echo "skip=true" >> $GITHUB_OUTPUT + [[ "${{ matrix.gem }}" == "lmdb" ]] && echo "skip=true" >> $GITHUB_OUTPUT + [[ "${{ matrix.gem }}" == "rack" ]] && echo "skip=true" >> $GITHUB_OUTPUT + [[ "${{ matrix.gem }}" == "rails" ]] && echo "skip=true" >> $GITHUB_OUTPUT + [[ "${{ matrix.gem }}" == "grpc" ]] && echo "skip=true" >> $GITHUB_OUTPUT + [[ "${{ matrix.gem }}" == "gruf" ]] && echo "skip=true" >> $GITHUB_OUTPUT + # This is essentially a bash script getting evaluated, so we need to return true or the whole job fails. + true + - name: "Test JRuby" + if: "${{ matrix.os == 'ubuntu-latest' && steps.jruby_skip.outputs.skip == 'false' }}" + uses: ./.github/actions/test_gem + with: + gem: "opentelemetry-instrumentation-${{ matrix.gem }}" + ruby: "jruby-10.0.2.0" diff --git a/.github/workflows/ci-instrumentation-with-services.yml b/.github/workflows/ci-instrumentation-with-services.yml index ac93634b9d..df7fae9537 100644 --- a/.github/workflows/ci-instrumentation-with-services.yml +++ b/.github/workflows/ci-instrumentation-with-services.yml @@ -5,9 +5,32 @@ on: push: branches: - main + paths: &path_filters + - 'helpers/**' + - 'instrumentation/base/**' + - 'instrumentation/bunny/**' + - 'instrumentation/dalli/**' + - 'instrumentation/mongo/**' + - 'instrumentation/mysql2/**' + - 'instrumentation/pg/**' + - 'instrumentation/que/**' + - 'instrumentation/racecar/**' + - 'instrumentation/rdkafka/**' + - 'instrumentation/redis/**' + - 'instrumentation/resque/**' + - 'instrumentation/ruby_kafka/**' + - 'instrumentation/sidekiq/**' + - 'instrumentation/trilogy/**' + - '.github/workflows/ci-instrumentation-with-services.yml' + - '.github/actions/**' + - 'Gemfile' + - 'Rakefile' + - '.rubocop.yml' + - 'gemspecs/**' pull_request: branches: - main + paths: *path_filters schedule: - cron: "0 0 * * *" diff --git a/.github/workflows/ci-instrumentation.yml b/.github/workflows/ci-instrumentation.yml index eb65ca6b4f..0a8e2c7b5e 100644 --- a/.github/workflows/ci-instrumentation.yml +++ b/.github/workflows/ci-instrumentation.yml @@ -19,44 +19,12 @@ concurrency: cancel-in-progress: true # Cancel any previous runs of this workflow jobs: - instrumentation: + instrumentation_all: strategy: fail-fast: false matrix: gem: - - action_mailer - - action_pack - - action_view - - active_job - - active_model_serializers - - active_record - - active_storage - - active_support - all - - aws_sdk - - aws_lambda - - base - - concurrent_ruby - - delayed_job - - ethon - - excon - - faraday - - grape - - graphql - - grpc - - gruf - - http - - http_client - - httpx - - koala - - lmdb - - logger - - net_http - - rack - - rails - - restclient - - rspec - - sinatra os: - ubuntu-latest @@ -88,25 +56,7 @@ jobs: shell: bash run: | echo "skip=false" >> $GITHUB_OUTPUT - [[ "${{ matrix.gem }}" == "action_pack" ]] && echo "skip=true" >> $GITHUB_OUTPUT - [[ "${{ matrix.gem }}" == "action_view" ]] && echo "skip=true" >> $GITHUB_OUTPUT - [[ "${{ matrix.gem }}" == "active_model_serializers" ]] && echo "skip=true" >> $GITHUB_OUTPUT - [[ "${{ matrix.gem }}" == "active_record" ]] && echo "skip=true" >> $GITHUB_OUTPUT - [[ "${{ matrix.gem }}" == "active_storage" ]] && echo "skip=true" >> $GITHUB_OUTPUT - [[ "${{ matrix.gem }}" == "active_support" ]] && echo "skip=true" >> $GITHUB_OUTPUT - [[ "${{ matrix.gem }}" == "aws_sdk" ]] && echo "skip=true" >> $GITHUB_OUTPUT - [[ "${{ matrix.gem }}" == "aws_lambda" ]] && echo "skip=true" >> $GITHUB_OUTPUT - [[ "${{ matrix.gem }}" == "delayed_job" ]] && echo "skip=true" >> $GITHUB_OUTPUT - [[ "${{ matrix.gem }}" == "graphql" ]] && echo "skip=true" >> $GITHUB_OUTPUT - [[ "${{ matrix.gem }}" == "http" ]] && echo "skip=true" >> $GITHUB_OUTPUT - [[ "${{ matrix.gem }}" == "http_client" ]] && echo "skip=true" >> $GITHUB_OUTPUT - [[ "${{ matrix.gem }}" == "koala" ]] && echo "skip=true" >> $GITHUB_OUTPUT - [[ "${{ matrix.gem }}" == "lmdb" ]] && echo "skip=true" >> $GITHUB_OUTPUT - [[ "${{ matrix.gem }}" == "rack" ]] && echo "skip=true" >> $GITHUB_OUTPUT - [[ "${{ matrix.gem }}" == "rails" ]] && echo "skip=true" >> $GITHUB_OUTPUT - [[ "${{ matrix.gem }}" == "grpc" ]] && echo "skip=true" >> $GITHUB_OUTPUT - [[ "${{ matrix.gem }}" == "gruf" ]] && echo "skip=true" >> $GITHUB_OUTPUT - # This is essentially a bash script getting evaluated, so we need to return true or the whole job fails. + # The 'all' instrumentation should work with JRuby true - name: "Test JRuby" if: "${{ matrix.os == 'ubuntu-latest' && steps.jruby_skip.outputs.skip == 'false' }}" diff --git a/.github/workflows/ci-markdown-checks.yml b/.github/workflows/ci-markdown-checks.yml new file mode 100644 index 0000000000..d9e07b7bca --- /dev/null +++ b/.github/workflows/ci-markdown-checks.yml @@ -0,0 +1,53 @@ +name: Markdown Checks + +on: + pull_request: + paths: + - '**/*.md' + +permissions: + contents: read + pull-requests: write # required for posting PR review comments + +jobs: + markdownlint-check: + name: Markdown Lint Check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + + # equivalent cli: markdownlint-cli2 "**/*.md" "#**/CHANGELOG.md" --config .markdownlint.json + - name: "Markdown Lint Check" + uses: DavidAnson/markdownlint-cli2-action@v20 + continue-on-error: true + with: + fix: false + globs: | + **/*.md + !**/CHANGELOG.md + + markdown-link-check: + name: Markdown Link Check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + + # equivalent cli: linkspector check + - name: Run linkspector + uses: umbrelladocs/action-linkspector@v1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + reporter: github-pr-review + fail_on_error: true + + spelling-check: + name: Spelling Check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + - uses: streetsidesoftware/cspell-action@v7 + with: + # Files should be consistent with check:spelling files + files: | + **/*.md + config: .cspell.yml diff --git a/.github/workflows/ci-markdown-link.yml b/.github/workflows/ci-markdown-link.yml deleted file mode 100644 index 0dc66fe50e..0000000000 --- a/.github/workflows/ci-markdown-link.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Markdown Link Check - -on: - pull_request: - paths: - - '**/*.md' - -permissions: - contents: read - -jobs: - markdown-link-check: - permissions: - pull-requests: write # required for posting PR review comments - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v5 - - # equivalent cli: linkspector check - - name: Run linkspector - uses: umbrelladocs/action-linkspector@v1 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - reporter: github-pr-review - fail_on_error: true diff --git a/.github/workflows/ci-markdownlint.yml b/.github/workflows/ci-markdownlint.yml deleted file mode 100644 index edd41025e9..0000000000 --- a/.github/workflows/ci-markdownlint.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Markdown Lint Check - -on: - pull_request: - -permissions: - contents: read - -jobs: - markdownlint-check: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v5 - - # equivalent cli: markdownlint-cli2 "**/*.md" "#**/CHANGELOG.md" --config .markdownlint.json - - name: "Markdown Lint Check" - uses: DavidAnson/markdownlint-cli2-action@v20 - continue-on-error: true - with: - fix: false - globs: | - **/*.md - !**/CHANGELOG.md