-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into categorize_as_gc
- Loading branch information
Showing
11 changed files
with
317 additions
and
46 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Push gem to RubyGems.org | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
push: | ||
runs-on: ubuntu-latest | ||
|
||
environment: | ||
name: rubygems.org | ||
url: https://rubygems.org/gems/vernier | ||
|
||
permissions: | ||
contents: write | ||
id-token: write | ||
|
||
steps: | ||
# Set up | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
bundler-cache: true | ||
ruby-version: ruby | ||
|
||
# Release | ||
- uses: rubygems/release-gem@v1 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Sentry integration | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
pull_request: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
name: Sentry integration test | ||
steps: | ||
- name: Checkout sentry | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: getsentry/sentry-ruby | ||
path: sentry-ruby | ||
- name: Checkout vernier | ||
uses: actions/checkout@v4 | ||
with: | ||
path: vernier | ||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: ruby | ||
- name: Build vernier | ||
run: | | ||
cd vernier | ||
bundle | ||
bundle exec rake compile | ||
- name: Setup sentry-ruby | ||
run: | | ||
VERNIER_PATH="$(pwd)/vernier" | ||
cd sentry-ruby/sentry-ruby | ||
sed -i "/gem *['\"]vernier/d" Gemfile | ||
echo "gem \"vernier\", path: \"$VERNIER_PATH\"" >> Gemfile | ||
bundle install | ||
- name: Run tests | ||
run: | | ||
cd sentry-ruby/sentry-ruby | ||
bundle exec rspec spec/sentry/vernier/profiler_spec.rb |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
|
||
name: Bump version | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: 'What version level of bump?' | ||
required: true | ||
default: 'patch' | ||
type: choice | ||
options: | ||
- major | ||
- minor | ||
- patch | ||
|
||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
bump: | ||
runs-on: ubuntu-latest | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: '3.3' | ||
- name: Set git config | ||
run: | | ||
git config --global user.email "${GITHUB_ACTOR_ID}+${GITHUB_ACTOR}@users.noreply.github.com" | ||
git config --global user.name "$(gh api /users/${GITHUB_ACTOR} | jq .name -r)" | ||
git remote set-url origin "https://x-access-token:${{ github.token }}@github.com/$GITHUB_REPOSITORY" | ||
shell: bash | ||
- name: Bump version | ||
run: gem exec bump ${{ github.event.inputs.version }} | ||
- name: push | ||
run: git push |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,3 +17,4 @@ Gemfile.lock | |
/examples/my_sleep.c | ||
/examples/my_sleep.dylib | ||
.DS_Store | ||
.gdbinit |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module Vernier | ||
VERSION = "1.1.1" | ||
VERSION = "1.2.1" | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# frozen_string_literal: true | ||
|
||
require "test_helper" | ||
|
||
class IntegrationTest < Minitest::Test | ||
include FirefoxTestHelpers | ||
|
||
LIB_DIR = File.expand_path("../lib", __dir__) | ||
|
||
def test_allocations | ||
result = run_vernier({allocation_sample_rate: 1}, "-e", "") | ||
assert_valid_firefox_profile(result) | ||
end | ||
|
||
def run_vernier(options, *argv) | ||
result_json = nil | ||
Tempfile.open('vernier') do |tempfile| | ||
options = { | ||
quiet: true, | ||
output: tempfile.path, | ||
}.merge(options) | ||
env = options.map do |k, v| | ||
["VERNIER_#{k.to_s.upcase}", v.to_s] | ||
end.to_h | ||
result = system(env, RbConfig.ruby, "-I", LIB_DIR, "-r", "vernier/autorun", *argv, exception: true) | ||
tempfile.rewind | ||
result_json = tempfile.read | ||
end | ||
result = JSON.parse(result_json) | ||
result | ||
end | ||
end |
Oops, something went wrong.