Unit Tests #2050
This file contains hidden or 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: Unit Tests | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - tonycthsu/* | |
| pull_request: | |
| branches: | |
| - main | |
| schedule: | |
| - cron: 0 */4 * * 1-5 | |
| concurrency: | |
| group: '${{ github.workflow }}-${{ github.ref }}' | |
| cancel-in-progress: "${{ github.ref != 'refs/heads/main' }}" | |
| jobs: | |
| # ADD NEW RUBIES HERE | |
| ruby-35: | |
| name: 'Ruby 3.5' | |
| uses: ./.github/workflows/_unit_test.yml | |
| with: | |
| engine: ruby | |
| version: '3.5' | |
| alias: ruby-35 | |
| ruby-34: | |
| name: 'Ruby 3.4' | |
| uses: ./.github/workflows/_unit_test.yml | |
| with: | |
| engine: ruby | |
| version: '3.4' | |
| alias: ruby-34 | |
| ruby-33: | |
| name: 'Ruby 3.3' | |
| uses: ./.github/workflows/_unit_test.yml | |
| with: | |
| engine: ruby | |
| version: '3.3' | |
| alias: ruby-33 | |
| ruby-32: | |
| name: 'Ruby 3.2' | |
| uses: ./.github/workflows/_unit_test.yml | |
| with: | |
| engine: ruby | |
| version: '3.2' | |
| alias: ruby-32 | |
| ruby-31: | |
| name: 'Ruby 3.1' | |
| uses: ./.github/workflows/_unit_test.yml | |
| with: | |
| engine: ruby | |
| version: '3.1' | |
| alias: ruby-31 | |
| ruby-30: | |
| name: 'Ruby 3.0' | |
| uses: ./.github/workflows/_unit_test.yml | |
| with: | |
| engine: ruby | |
| version: '3.0' | |
| alias: ruby-30 | |
| ruby-27: | |
| name: 'Ruby 2.7' | |
| uses: ./.github/workflows/_unit_test.yml | |
| with: | |
| engine: ruby | |
| version: '2.7' | |
| alias: ruby-27 | |
| jruby-94: | |
| name: 'JRuby 9.4' | |
| uses: ./.github/workflows/_unit_test.yml | |
| with: | |
| engine: jruby | |
| version: '9.4' | |
| alias: jruby-94 | |
| datadog-test-optimization: | |
| name: dd/test-optimization | |
| if: ${{ !cancelled() }} | |
| runs-on: ubuntu-24.04 | |
| container: | |
| image: datadog/ci | |
| env: | |
| DD_API_KEY: '${{ secrets.DD_API_KEY }}' | |
| DD_ENV: ci | |
| DATADOG_SITE: datadoghq.com | |
| DD_SERVICE: datadog-ci-rb | |
| DD_GIT_REPOSITORY_URL: '${{ github.repositoryUrl }}' | |
| needs: | |
| # ADD NEW RUBIES HERE | |
| - ruby-35 | |
| - ruby-34 | |
| - ruby-33 | |
| - ruby-32 | |
| - ruby-31 | |
| - ruby-30 | |
| - ruby-27 | |
| - jruby-94 | |
| steps: | |
| - run: mkdir -p tmp/rspec && mkdir -p tmp/coverage && datadog-ci version | |
| - name: Download all junit reports | |
| uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0 | |
| with: | |
| path: tmp/rspec | |
| pattern: junit-* | |
| merge-multiple: true | |
| - name: Format file paths | |
| run: sed -i 's;file="./;file=";g' tmp/rspec/*.xml | |
| - name: Download all simplecov reports | |
| uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0 | |
| with: | |
| path: tmp/coverage | |
| pattern: coverage-* | |
| merge-multiple: true | |
| # Note that GITHUB_SHA for this event is the last merge commit of the pull request merge branch, | |
| # which `datadog-ci` failed to sync the correct git metadata in Github Actions. | |
| # | |
| # This causes the CODEOWNERS data being lost. | |
| # | |
| # This is a workaround to manually set the correct git commit sha for the pull request event. | |
| - if: github.event_name == 'pull_request' | |
| env: | |
| DD_GIT_COMMIT_SHA: ${{ github.event.pull_request.head.sha }} | |
| run: echo "DD_GIT_COMMIT_SHA=$DD_GIT_COMMIT_SHA" >> "$GITHUB_ENV" | |
| - if: github.event_name != 'pull_request' | |
| env: | |
| DD_GIT_COMMIT_SHA: ${{ github.sha }} | |
| run: echo "DD_GIT_COMMIT_SHA=$DD_GIT_COMMIT_SHA" >> "$GITHUB_ENV" | |
| - run: echo "$DD_GIT_COMMIT_SHA" | |
| - name: Upload junit reports to Datadog | |
| run: datadog-ci junit upload --verbose tmp/rspec/ | |
| - name: Upload simplecov reports to Datadog | |
| run: datadog-ci coverage upload --verbose tmp/coverage/ | |
| complete: | |
| name: complete | |
| runs-on: ubuntu-24.04 | |
| needs: | |
| # ADD NEW RUBIES HERE | |
| - ruby-35 | |
| - ruby-34 | |
| - ruby-33 | |
| - ruby-32 | |
| - ruby-31 | |
| - ruby-30 | |
| - ruby-27 | |
| - jruby-94 | |
| steps: | |
| - run: echo "DONE!" |