Memory leak optimizations #628
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: PR Continuous Integration | |
on: | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
unit_tests: | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
ruby-version: [2.4.10, 2.5.9, 2.6.10, 2.7.8, 3.0.7, 3.1.5, 3.2.4, 3.3.1, jruby-9.4.5.0] | |
instrumentation-method: ['prepend', 'chain'] | |
steps: | |
- name: Configure git | |
run: 'git config --global init.defaultBranch main' | |
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # tag v4.1.2 | |
# - curl is needed for Curb | |
# - xslt is needed for older Nokogiris, RUBY_VERSION < 2.5 | |
- name: Install OS packages | |
run: sudo apt-get update; sudo apt-get install -y --no-install-recommends libcurl4-nss-dev libxslt1-dev libc6-dev openjdk-11-jdk | |
- name: Install Ruby ${{ matrix.ruby-version }} | |
uses: ruby/setup-ruby@cacc9f1c0b3f4eb8a16a6bb0ed10897b43b9de49 # tag v1.176.0 | |
with: | |
ruby-version: ${{ matrix.ruby-version }} | |
- name: Bundle test environment | |
run: BUNDLE_GEMFILE=Gemfile_test rake test_bundle | |
- name: Run Unit Tests | |
run: bundle exec rake test | |
env: | |
VERBOSE_TEST_OUTPUT: true | |
BUNDLE_GEMFILE: 'Gemfile_test' | |
NR_CSEC_INSTRUMENTATION_METHOD: '${{ matrix.instrumentation-method }}' | |
- name: Save coverage results | |
uses: actions/upload-artifact@1746f4ab65b179e0ea60a494b83293b640dd5bba # tag v4.3.2 | |
with: | |
name: coverage-report-unit-tests-${{ matrix.ruby-version }}-${{ matrix.instrumentation-method }} | |
path: lib/coverage_*/.resultset.json | |
simplecov: | |
needs: unit_tests | |
runs-on: ubuntu-22.04 | |
if: github.event.pull_request.head.repo.full_name == github.repository | |
permissions: | |
pull-requests: write | |
contents: read | |
steps: | |
- name: Configure git | |
run: 'git config --global init.defaultBranch main' | |
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # tag v4.1.2 | |
- uses: ruby/setup-ruby@cacc9f1c0b3f4eb8a16a6bb0ed10897b43b9de49 # tag v1.176.0 | |
with: | |
ruby-version: '3.1' | |
- run: bundle | |
- name: Download all workflow run artifacts | |
uses: actions/download-artifact@9c19ed7fe5d278cd354c7dfd5d3b88589c7e2395 # tag v4.1.6 | |
- name: Collate Coverage Results | |
run: bundle exec rake coverage:report | |
- name: Upload coverage results | |
uses: actions/upload-artifact@1746f4ab65b179e0ea60a494b83293b640dd5bba # tag v4.3.2 | |
with: | |
name: coverage-report-combined | |
path: lib/coverage_results | |
retention-days: 2 | |
- name: Simplecov Report | |
uses: ./.github/actions/simplecov-report | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
resultPath: lib/coverage_results/.last_run.json | |
failedThreshold: 67 | |
failedThresholdBranch: 25 | |