Fix selective tracing recursion #160
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: CI | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
jobs: | |
test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.2' | |
- name: Setup just | |
uses: extractions/setup-just@v1 | |
- name: Build extension | |
run: just build-extension | |
- name: Run tests | |
run: just test | |
benchmark: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.2' | |
- name: Setup just | |
uses: extractions/setup-just@v1 | |
- name: Build extension | |
run: just build-extension | |
- name: Run benchmarks and generate report | |
run: just bench heavy_work reports/benchmark_report.svg | |
- name: Post or update PR comment | |
if: github.event_name == 'pull_request' | |
uses: actions/github-script@v6 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
const fs = require('fs'); | |
const path = 'reports/benchmark_report.svg'; | |
let content = fs.readFileSync(path, 'utf8'); | |
content = '<details>\n<summary>Benchmark Report</summary>\n\n' + | |
content + '\n</details>'; | |
const issue_number = context.payload.pull_request.number; | |
const header = '<!-- benchmark-report -->\n'; | |
const comments = await github.rest.issues.listComments({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
issue_number | |
}); | |
const existing = comments.data.find(c => c.body.startsWith(header)); | |
const body = header + content; | |
if (existing) { | |
await github.rest.issues.updateComment({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
comment_id: existing.id, | |
body | |
}); | |
} else { | |
await github.rest.issues.createComment({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
issue_number, | |
body | |
}); | |
} | |
nix: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: cachix/install-nix-action@v27 | |
with: | |
nix_path: nixpkgs=channel:nixos-24.05 | |
extra_nix_config: | | |
experimental-features = nix-command flakes | |
- name: Build extension via Nix | |
run: nix develop -c just build-extension | |
- name: Run tests via Nix | |
run: nix develop -c just test |