solarwinds_apm 5.1.3 → 5.1.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -265,57 +265,66 @@ module SolarWindsAPM
265
265
  # rubocop:enable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity, Metrics/AbcSize
266
266
 
267
267
  ##
268
- # build_init_report
268
+ # build_legacy_ao_init_report
269
269
  #
270
270
  # Internal: Build a hash of KVs that reports on the status of the
271
271
  # running environment. This is used on stack boot in __Init reporting
272
272
  # and for SolarWindsAPM.support_report.
273
+ # On 2023-01-12, this is no longer used in new SWO endpoints
273
274
  #
274
275
  # rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity, Metrics/AbcSize
275
- def build_init_report
276
+ def build_legacy_ao_init_report
276
277
  platform_info = { '__Init' => 1 }
277
-
278
278
  begin
279
- platform_info['Force'] = true
280
- platform_info['Ruby.Platform.Version'] = RUBY_PLATFORM
281
- platform_info['Ruby.Version'] = RUBY_VERSION
282
- platform_info['Ruby.SolarWindsAPM.Version'] = SolarWindsAPM::Version::STRING
283
-
284
- # oboe not loaded yet, can't use oboe_api function to read oboe VERSION
285
- clib_version_file = File.join(Gem::Specification.find_by_name('solarwinds_apm').gem_dir, 'ext', 'oboe_metal', 'src', 'VERSION')
286
- platform_info['Ruby.SolarWindsAPMExtension.Version'] = File.read(clib_version_file).strip
287
- platform_info['RubyHeroku.SolarWindsAPM.Version'] = SolarWindsAPMHeroku::Version::STRING if defined?(SolarWindsAPMHeroku)
288
- platform_info['Ruby.TraceMode.Version'] = SolarWindsAPM::Config[:tracing_mode]
289
-
290
- # Collect up the loaded gems
291
- if defined?(Gem) && Gem.respond_to?(:loaded_specs)
292
- Gem.loaded_specs.each_pair { |k, v|
293
- platform_info["Ruby.#{k}.Version"] = v.version.to_s
294
- }
295
- else
296
- platform_info.merge!(legacy_build_init_report)
297
- end
279
+ platform_info['Force'] = true
280
+ platform_info['Ruby.Platform.Version'] = RUBY_PLATFORM
281
+ platform_info['Ruby.Version'] = RUBY_VERSION
282
+ platform_info['Ruby.SolarWindsAPM.Version'] = SolarWindsAPM::Version::STRING
283
+ platform_info['Ruby.SolarWindsAPMExtension.Version'] = get_extension_lib_version
284
+ platform_info['RubyHeroku.SolarWindsAPM.Version'] = SolarWindsAPMHeroku::Version::STRING if defined?(SolarWindsAPMHeroku)
285
+ platform_info['Ruby.TraceMode.Version'] = SolarWindsAPM::Config[:tracing_mode]
286
+ platform_info.merge!(report_gem_in_use)
287
+ platform_info.merge!(report_server_in_use)
298
288
 
299
- # Report the server in use (if possible)
300
- if defined?(::Unicorn::Const::UNICORN_VERSION)
301
- platform_info['Ruby.AppContainer.Version'] = "Unicorn-#{::Unicorn::Const::UNICORN_VERSION}"
302
- elsif defined?(::Puma::Const::PUMA_VERSION)
303
- platform_info['Ruby.AppContainer.Version'] = "Puma-#{::Puma::Const::PUMA_VERSION} (#{::Puma::Const::CODE_NAME})"
304
- elsif defined?(::PhusionPassenger::PACKAGE_NAME)
305
- platform_info['Ruby.AppContainer.Version'] = "#{::PhusionPassenger::PACKAGE_NAME}-#{::PhusionPassenger::VERSION_STRING}"
306
- elsif defined?(::Thin::VERSION::STRING)
307
- platform_info['Ruby.AppContainer.Version'] = "Thin-#{::Thin::VERSION::STRING} (#{::Thin::VERSION::CODENAME})"
308
- elsif defined?(::Mongrel::Const::MONGREL_VERSION)
309
- platform_info['Ruby.AppContainer.Version'] = "Mongrel-#{::Mongrel::Const::MONGREL_VERSION}"
310
- elsif defined?(::Mongrel2::VERSION)
311
- platform_info['Ruby.AppContainer.Version'] = "Mongrel2-#{::Mongrel2::VERSION}"
312
- elsif defined?(::Trinidad::VERSION)
313
- platform_info['Ruby.AppContainer.Version'] = "Trinidad-#{::Trinidad::VERSION}"
314
- elsif defined?(::WEBrick::VERSION)
315
- platform_info['Ruby.AppContainer.Version'] = "WEBrick-#{::WEBrick::VERSION}"
316
- else
317
- platform_info['Ruby.AppContainer.Version'] = File.basename($PROGRAM_NAME)
318
- end
289
+ rescue StandardError, ScriptError => e
290
+ platform_info['Error'] = "Error in build_report: #{e.message}"
291
+ SolarWindsAPM.logger.warn "[solarwinds_apm/warn] Error in build_init_report: #{e.message}"
292
+ SolarWindsAPM.logger.debug e.backtrace
293
+ end
294
+ platform_info
295
+ end
296
+
297
+ ##
298
+ # build_swo_init_report
299
+ #
300
+ # Internal: Build a hash of KVs that reports on the status of the
301
+ # running environment for swo only. This is used on stack boot in __Init reporting
302
+ # and for SolarWindsAPM.support_report.
303
+ #
304
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity, Metrics/AbcSize
305
+ def build_init_report
306
+
307
+ platform_info = { '__Init' => true }
308
+
309
+ begin
310
+ platform_info['APM.Version'] = SolarWindsAPM::Version::STRING
311
+ platform_info['APM.Extension.Version'] = get_extension_lib_version
312
+
313
+ platform_info['process.pid'] = Process.pid
314
+ platform_info['process.command'] = $PROGRAM_NAME
315
+ platform_info['process.runtime.name'] = RUBY_ENGINE
316
+ platform_info['process.runtime.version'] = RUBY_VERSION
317
+ platform_info['process.runtime.description'] = RUBY_DESCRIPTION
318
+ platform_info['telemetry.sdk.language'] = 'ruby'
319
+
320
+ # Resource Attributes (Optional)
321
+ platform_info['process.executable.path'] = File.join(RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name']).sub(/.*\s.*/m, '"\&"')
322
+ platform_info['process.executable.name'] = RbConfig::CONFIG['ruby_install_name']
323
+ platform_info['process.command_line'] = $PROGRAM_NAME
324
+ platform_info['process.telemetry.path'] = Gem::Specification.find_by_name('solarwinds_apm')&.full_gem_path
325
+ platform_info['os.type'] = RUBY_PLATFORM
326
+
327
+ platform_info.merge!(report_gem_in_use)
319
328
 
320
329
  rescue StandardError, ScriptError => e
321
330
  # Also rescue ScriptError (aka SyntaxError) in case one of the expected
@@ -329,6 +338,71 @@ module SolarWindsAPM
329
338
  platform_info
330
339
  end
331
340
  # rubocop:enable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity, Metrics/AbcSize
341
+
342
+ private
343
+
344
+ ##
345
+ # Collect up the loaded gems
346
+ ##
347
+ def report_gem_in_use
348
+ platform_info = {}
349
+ if defined?(Gem) && Gem.respond_to?(:loaded_specs)
350
+ Gem.loaded_specs.each_pair { |k, v|
351
+ platform_info["Ruby.#{k}.Version"] = v.version.to_s
352
+ }
353
+ else
354
+ platform_info.merge!(legacy_build_init_report)
355
+ end
356
+ platform_info
357
+ end
358
+
359
+ ##
360
+ # get extension library version by looking at the VERSION file
361
+ # oboe not loaded yet, can't use oboe_api function to read oboe VERSION
362
+ ##
363
+ def get_extension_lib_version
364
+ version = '0.0.0'
365
+ begin
366
+ gem_location = Gem::Specification.find_by_name('solarwinds_apm')
367
+ clib_version_file = File.join(gem_location&.gem_dir, 'ext', 'oboe_metal', 'src', 'VERSION')
368
+ version = File.read(clib_version_file).strip
369
+ rescue
370
+ SolarWindsAPM.logger.warn "[solarwinds_apm/warn] Error in build_init_report: couldn't find installed solarwinds_apm gem #{e.message}"
371
+ end
372
+ version
373
+ end
374
+
375
+ ##
376
+ # build_init_report
377
+ #
378
+ # Internal: Build a hash of KVs that reports on the server in use
379
+ ##
380
+ def report_server_in_use
381
+ platform_info = {}
382
+ # Report the server in use (if possible)
383
+ if defined?(::Unicorn::Const::UNICORN_VERSION)
384
+ platform_info['Ruby.AppContainer.Version'] = "Unicorn-#{::Unicorn::Const::UNICORN_VERSION}"
385
+ elsif defined?(::Puma::Const::PUMA_VERSION)
386
+ platform_info['Ruby.AppContainer.Version'] = "Puma-#{::Puma::Const::PUMA_VERSION} (#{::Puma::Const::CODE_NAME})"
387
+ elsif defined?(::PhusionPassenger::PACKAGE_NAME)
388
+ platform_info['Ruby.AppContainer.Version'] = "#{::PhusionPassenger::PACKAGE_NAME}-#{::PhusionPassenger::VERSION_STRING}"
389
+ elsif defined?(::Thin::VERSION::STRING)
390
+ platform_info['Ruby.AppContainer.Version'] = "Thin-#{::Thin::VERSION::STRING} (#{::Thin::VERSION::CODENAME})"
391
+ elsif defined?(::Mongrel::Const::MONGREL_VERSION)
392
+ platform_info['Ruby.AppContainer.Version'] = "Mongrel-#{::Mongrel::Const::MONGREL_VERSION}"
393
+ elsif defined?(::Mongrel2::VERSION)
394
+ platform_info['Ruby.AppContainer.Version'] = "Mongrel2-#{::Mongrel2::VERSION}"
395
+ elsif defined?(::Trinidad::VERSION)
396
+ platform_info['Ruby.AppContainer.Version'] = "Trinidad-#{::Trinidad::VERSION}"
397
+ elsif defined?(::WEBrick::VERSION)
398
+ platform_info['Ruby.AppContainer.Version'] = "WEBrick-#{::WEBrick::VERSION}"
399
+ else
400
+ platform_info['Ruby.AppContainer.Version'] = File.basename($PROGRAM_NAME)
401
+ end
402
+ platform_info
403
+ end
404
+
332
405
  end
406
+
333
407
  end
334
408
  end
@@ -8,7 +8,7 @@ module SolarWindsAPM
8
8
  module Version
9
9
  MAJOR = 5 # breaking,
10
10
  MINOR = 1 # feature,
11
- PATCH = 3 # fix => BFF
11
+ PATCH = 4 # fix => BFF
12
12
  PRE = nil # for pre-releases into packagecloud, set to nil for production releases into rubygems
13
13
 
14
14
  STRING = [MAJOR, MINOR, PATCH, PRE].compact.join('.')
@@ -24,7 +24,7 @@ Automatic tracing and metrics for Ruby applications. Get started at cloud.solarw
24
24
  }
25
25
 
26
26
  s.extra_rdoc_files = ['LICENSE']
27
- s.files = `git ls-files`.split("\n").reject { |f| f.match(%r{^(test|gemfiles)/}) }
27
+ s.files = `git ls-files`.split("\n").reject { |f| f.match(%r{^(test|gemfiles|.github)/}) }
28
28
  s.files += ['ext/oboe_metal/src/oboe.h',
29
29
  'ext/oboe_metal/src/oboe_api.cpp',
30
30
  'ext/oboe_metal/src/oboe_api.h',
@@ -34,7 +34,9 @@ Automatic tracing and metrics for Ruby applications. Get started at cloud.solarw
34
34
  'ext/oboe_metal/src/bson/platform_hacks.h',
35
35
  'ext/oboe_metal/src/VERSION',
36
36
  'ext/oboe_metal/lib/liboboe-1.0-alpine-x86_64.so.0.0.0.sha256',
37
- 'ext/oboe_metal/lib/liboboe-1.0-x86_64.so.0.0.0.sha256'
37
+ 'ext/oboe_metal/lib/liboboe-1.0-x86_64.so.0.0.0.sha256',
38
+ 'ext/oboe_metal/lib/liboboe-1.0-aarch64.so.0.0.0.sha256',
39
+ 'ext/oboe_metal/lib/liboboe-1.0-alpine-aarch64.so.0.0.0.sha256'
38
40
  ]
39
41
  s.files += ['lib/solarwinds_apm/cert/star.appoptics.com.issuer.crt']
40
42
  s.files -= ['build_gem.sh',
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solarwinds_apm
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.1.3
4
+ version: 5.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maia Engeli
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2022-11-07 00:00:00.000000000 Z
14
+ date: 2023-01-23 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: json
@@ -60,17 +60,6 @@ extra_rdoc_files:
60
60
  - LICENSE
61
61
  files:
62
62
  - ".dockerignore"
63
- - ".github/CODEOWNERS"
64
- - ".github/ISSUE_TEMPLATE/bug-or-feature-request.md"
65
- - ".github/workflows/build_and_release_gem.yml"
66
- - ".github/workflows/build_for_packagecloud.yml"
67
- - ".github/workflows/docker-images.yml"
68
- - ".github/workflows/run_cpluplus_tests.yml"
69
- - ".github/workflows/run_tests.yml"
70
- - ".github/workflows/scripts/test_install.rb"
71
- - ".github/workflows/swig/swig-v4.0.2.tar.gz"
72
- - ".github/workflows/test_on_4_linux.yml"
73
- - ".github/workflows/test_on_ubuntu.yml"
74
63
  - ".gitignore"
75
64
  - ".rubocop.yml"
76
65
  - ".whitesource"
@@ -88,6 +77,8 @@ files:
88
77
  - ext/oboe_metal/extconf.rb
89
78
  - ext/oboe_metal/extconf_local.rb
90
79
  - ext/oboe_metal/lib/.keep
80
+ - ext/oboe_metal/lib/liboboe-1.0-aarch64.so.0.0.0.sha256
81
+ - ext/oboe_metal/lib/liboboe-1.0-alpine-aarch64.so.0.0.0.sha256
91
82
  - ext/oboe_metal/lib/liboboe-1.0-alpine-x86_64.so.0.0.0.sha256
92
83
  - ext/oboe_metal/lib/liboboe-1.0-x86_64.so.0.0.0.sha256
93
84
  - ext/oboe_metal/noop/noop.c
@@ -167,6 +158,7 @@ files:
167
158
  - lib/solarwinds_apm/inst/rack.rb
168
159
  - lib/solarwinds_apm/inst/rack_cache.rb
169
160
  - lib/solarwinds_apm/inst/redis.rb
161
+ - lib/solarwinds_apm/inst/redis_v4.rb
170
162
  - lib/solarwinds_apm/inst/resque.rb
171
163
  - lib/solarwinds_apm/inst/rest-client.rb
172
164
  - lib/solarwinds_apm/inst/sequel.rb
data/.github/CODEOWNERS DELETED
@@ -1 +0,0 @@
1
- * @cheempz @xuan-cao-swi @tammy-baylis-swi @solarwindscloud/apm-instrumentation
@@ -1,16 +0,0 @@
1
- ---
2
- name: Bug or Feature request
3
- about: general purpose template
4
- title: "[Bug] or [Feature request]"
5
- labels: ''
6
- assignees: ''
7
-
8
- ---
9
-
10
- # Description
11
-
12
- # How to reproduce or use case
13
-
14
- # Code Sample (if available)
15
-
16
- # OS, Ruby version, Gemfile, Gemfile.lock, log message ... (if relevant)
@@ -1,108 +0,0 @@
1
- # Copyright (c) 2021 SolarWinds, LLC.
2
- # All rights reserved.
3
-
4
- name: BUILD, VERIFY, and RELEASE Ruby Gem to RubyGems
5
-
6
- # This workflow relies on the following secrets
7
- # - TRACE_BUILD_RUBY_ACTIONS_API_TOKEN (from the trace-build user in github)
8
- # - RUBYGEMS_TOKEN (from the solarwinds-apm user on rubygems.org)
9
- # - SW_APM_SERVICE_KEY
10
- # - SW_APM_COLLECTOR
11
- #
12
- # The correct oboe version has to be in the file ext/oboe_metal/src/VERSION
13
-
14
- on:
15
- workflow_dispatch:
16
-
17
- jobs:
18
- build:
19
- name: Build + Release Gem to RubyGems
20
- runs-on: ubuntu-latest
21
-
22
- steps:
23
- - uses: actions/checkout@v2
24
-
25
- - name: Set up Ruby 2.7 and bundle
26
- uses: ruby/setup-ruby@v1
27
- with:
28
- ruby-version: 2.7
29
-
30
- - name: Install gems
31
- run: |
32
- echo 'gem: --no-document' >> ~/.gemrc
33
- bundle install --without development --without test
34
-
35
- - name: Install swig 4.0.2
36
- run: |
37
- apt udate && apt install -y --no-install-recommends bison
38
- curl -SL https://github.com/swig/swig/archive/refs/tags/v4.0.2.tar.gz | tar xzC /tmp
39
- cd /tmp/swig-4.0.2
40
- ./autogen.sh && ./configure && make && sudo make install
41
- cd -
42
-
43
- - name: Download files from cloud.solarwinds.com and create swig wrapper
44
- env:
45
- TRACE_BUILD_TOKEN: ${{ secrets.TRACE_BUILD_RUBY_ACTIONS_API_TOKEN }}
46
- run: |
47
- bundle exec rake fetch_oboe_file_from_prod
48
- bundle exec rake oboe_verify
49
-
50
- - name: Build Gem and upload to Rubygems
51
- id: build
52
- env:
53
- GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_TOKEN }}
54
- run: |
55
- bundle exec rake build_and_publish_gem
56
- checksum=`shasum -a256 *.gem | awk '{print $1;}'`
57
- echo "checksum: $checksum"
58
- echo ::set-output name=checksum::$checksum
59
- echo ::set-output name=gem_version::`ruby -e 'require "./lib/solarwinds_apm/version"; puts SolarWindsAPM::Version::STRING'`
60
-
61
- - name: Get checksum from Rubygems
62
- id: checksum
63
- run: |
64
- gem_version=${{ steps.build.outputs.gem_version }}
65
- echo ::set-output name=geminfo::`curl https://rubygems.org/api/v2/rubygems/solarwinds_apm/versions/$gem_version.json`
66
-
67
- - name: Print checksums (in case some debugging is needed)
68
- run: |
69
- echo "local checksum: ${{ steps.build.outputs.checksum }}"
70
- echo "Rubygems checksum: ${{ fromJson(steps.checksum.outputs.geminfo).sha }}"
71
-
72
- - name: Fail if local and rubygems checksums don't match
73
- if: fromJson(steps.checksum.outputs.geminfo).sha != steps.build.outputs.checksum
74
- run: |
75
- echo "local and rubygems checksum not matching, gem needs to be yanked from rubygems.org"
76
- exit 1
77
-
78
- - name: Create release draft that includes the checksum
79
- uses: actions/github-script@v3
80
- with:
81
- github-token: ${{secrets.GITHUB_TOKEN}}
82
- script: |
83
- github.repos.createRelease({
84
- owner: "solarwindscloud",
85
- repo: "solarwinds-apm-ruby",
86
- body: "SHA256 checksum: ${{ steps.build.outputs.checksum }}",
87
- tag_name: "${{ steps.build.outputs.gem_version }}",
88
- name: "${{ steps.build.outputs.gem_version }}",
89
- draft: true
90
- })
91
-
92
- # may need a bit of time for the gem to become available (-> sleep 1)
93
- - name: Download new Rubygem from rubygems.org and test
94
- working-directory: .github/workflows/
95
- env:
96
- SW_APM_SERVICE_KEY: ${{ secrets.SW_APM_SERVICE_KEY_PROD }}
97
- SW_APM_COLLECTOR: ${{ secrets.SW_APM_COLLECTOR_PROD}}
98
- run: |
99
- sleep 1
100
- gem install solarwinds_apm --version ${{ steps.build.outputs.gem_version }}
101
- ruby ./scripts/test_install.rb
102
-
103
- - name: Now also check manually if there is a trace for service 'ruby-post-release-test' in SW production
104
- run: echo "TODO"
105
-
106
- - name: And now the release notes need to be completed for the new release
107
- run: echo "TODO"
108
-
@@ -1,59 +0,0 @@
1
- # Copyright (c) 2021 SolarWinds, LLC.
2
- # All rights reserved.
3
-
4
- name: Ruby Gem to PackageCloud
5
-
6
- on:
7
- workflow_dispatch:
8
-
9
- jobs:
10
- build:
11
- name: Build + Publish to PackageCloud
12
- runs-on: ubuntu-latest
13
-
14
- steps:
15
- - uses: actions/checkout@v2
16
-
17
- - name: Set up Ruby 2.7 and bundle
18
- uses: ruby/setup-ruby@v1
19
- with:
20
- ruby-version: 2.7
21
-
22
- - name: Install gems
23
- run: |
24
- echo 'gem: --no-document' >> ~/.gemrc
25
- bundle install
26
-
27
- - name: Install swig 4.0.2
28
- run: |
29
- apt udate && apt install -y --no-install-recommends bison
30
- curl -SL https://github.com/swig/swig/archive/refs/tags/v4.0.2.tar.gz | tar xzC /tmp
31
- cd /tmp/swig-4.0.2
32
- ./autogen.sh && ./configure && make && sudo make install
33
- cd -
34
-
35
- - name: Grab current version
36
- id: version
37
- run: |
38
- echo ::set-output name=gem_version::`ruby -e 'require "./lib/solarwinds_apm/version"; puts SolarWindsAPM::Version::STRING'`
39
-
40
- - name: Build gem and publish to packagecloud
41
- id: gemstep
42
- run: |
43
- bundle exec rake build_gem_push_to_packagecloud[${{ steps.version.outputs.gem_version }}]
44
- env:
45
- PACKAGECLOUD_TOKEN: ${{ secrets.PACKAGECLOUD_TOKEN }}
46
-
47
- # Run this test manually, github is having problems reading the index at packagecloud
48
- # TODO: AO-20355
49
- # - name: Test install (give packagecloud 60 seconds to index)
50
- # working-directory: .github/workflows/
51
- # env:
52
- # SW_APM_SERVICE_KEY: ${{ secrets.SW_APM_SERVICE_KEY }}
53
- # SW_APM_COLLECTOR: ${{ secrets.SW_APM_COLLECTOR}}
54
- # OBOE_STAGING: true
55
- # run: |
56
- # sleep 60
57
- # gem sources --add https://packagecloud.io/solarwinds/solarwinds-apm-ruby
58
- # gem install solarwinds_apm --version ${{ steps.gemstep.outputs.GEM_VERSION }} --verbose
59
- # ruby ./scripts/test_install.rb
@@ -1,53 +0,0 @@
1
- name: Build docker images
2
-
3
- on:
4
- push:
5
- paths:
6
- - 'test/run_tests/Dockerfile_*'
7
- # Allows running this workflow manually from the Actions tab
8
- workflow_dispatch:
9
-
10
- env:
11
- REGISTRY: ghcr.io
12
- IMAGE_NAME: ${{ github.repository }}/apm_ruby
13
- DOCKERFILE: test/run_tests/Dockerfile
14
-
15
- jobs:
16
-
17
- build_push:
18
- name: Build docker images
19
- runs-on: ubuntu-latest
20
-
21
- strategy:
22
- fail-fast: false
23
- matrix:
24
- os: [ubuntu, debian, centos, alpine]
25
-
26
- steps:
27
- - name: Checkout ${{ github.ref }}
28
- uses: actions/checkout@v1
29
-
30
- - name: Log in to the Container Registry
31
- uses: docker/login-action@v2
32
- with:
33
- registry: ${{ env.REGISTRY }}
34
- username: ${{ github.actor }}
35
- password: ${{ secrets.GITHUB_TOKEN }}
36
-
37
- - name: Extract metadata (tags, labels) for Docker
38
- id: meta
39
- uses: docker/metadata-action@v4
40
- with:
41
- images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}_${{ matrix.os }}
42
- flavor: |
43
- latest=true
44
-
45
- - name: Build and push Docker image
46
- uses: docker/build-push-action@v3
47
- with:
48
- context: .
49
- push: true
50
- file: test/run_tests/Dockerfile_${{ matrix.os }}
51
- tags: ${{ steps.meta.outputs.tags }}
52
- labels: ${{ steps.meta.outputs.labels }}
53
-
@@ -1,73 +0,0 @@
1
- # Copyright (c) 2021 SolarWinds, LLC.
2
- # All rights reserved.
3
-
4
- name: C++ Tests
5
-
6
- on:
7
- push:
8
- paths:
9
- - ext/oboe_metal/src/*.h
10
- - ext/oboe_metal/src/*.cc
11
- - ext/oboe_metal/test/*
12
- # Allows you to run this workflow manually from the Actions tab
13
- workflow_dispatch:
14
-
15
- jobs:
16
- tests:
17
- runs-on: ubuntu-latest
18
- strategy:
19
- fail-fast: false
20
- matrix:
21
- ruby: [3.1, 3.0, 2.7, 2.6, 2.5]
22
-
23
- container:
24
- image: ruby:${{ matrix.ruby }}
25
-
26
- name: ${{ matrix.ruby }} - c++
27
-
28
- env:
29
- SW_APM_REPORTER: file
30
- SW_APM_COLLECTOR: /tmp/sw_apm_traces.bson
31
- SW_APM_REPORTER_FILE_SINGLE: false
32
- OBOE_STAGING: true
33
-
34
- steps:
35
- - uses: actions/checkout@v2
36
-
37
- - name: Install cmake
38
- run: |
39
- ls -lrt /usr/src
40
- apt update && apt install -y --no-install-recommends build-essential libgtest-dev ruby
41
- curl -OL https://github.com/Kitware/CMake/releases/download/v3.20.5/cmake-3.20.5-SHA-256.txt
42
- curl -OL https://github.com/Kitware/CMake/releases/download/v3.20.5/cmake-3.20.5.tar.gz
43
- sha256sum -c --ignore-missing cmake-3.20.5-SHA-256.txt
44
- tar -zxvf cmake-3.20.5.tar.gz
45
- cd cmake-3.20.5
46
- ./bootstrap
47
- make
48
- make install
49
-
50
- - name: Install swig 4.0.2
51
- working-directory: .github/workflows/swig
52
- run: |
53
- apt update && apt install -y --no-install-recommends bison
54
- tar -xf swig-v4.0.2.tar.gz -C /tmp
55
- cd /tmp/swig-4.0.2
56
- ./autogen.sh && ./configure && make && make install
57
- cd -
58
-
59
- - name: Bundle & download c-files
60
- run: |
61
- gem install bundler
62
- bundle install
63
- bundle exec rake clean fetch compile
64
-
65
- - name: Compile and run tests
66
- working-directory: ext/oboe_metal/test
67
- run: |
68
- export TEST_DIR=`pwd`
69
- export RUBY_INC_DIR=$(ruby ruby_inc_dir.rb)
70
- export RUBY_PREFIX=$(ruby ruby_prefix.rb)
71
- cmake -S . -B build
72
- cmake --build build
73
- cd build && ctest