-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (69 loc) · 2.82 KB
/
pr_ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
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