chore: upgrade runtime_tracing to the new crates codetracer_trace_wri… #282
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 | |
with: | |
lfs: true | |
- name: Install system dependencies | |
shell: bash | |
run: | | |
if [[ "$RUNNER_OS" == "Linux" ]]; then | |
sudo apt-get update | |
sudo apt-get install -y --no-install-recommends libclang-dev capnproto libcapnp-dev pkg-config | |
# Set environment variables for Rust/bindgen | |
LLVM_VERSION=$(ls /usr/lib/ | grep llvm | sort -V | tail -1) | |
echo "LIBCLANG_PATH=/usr/lib/$LLVM_VERSION/lib" >> $GITHUB_ENV | |
echo "CLANG_PATH=/usr/bin/clang" >> $GITHUB_ENV | |
elif [[ "$RUNNER_OS" == "macOS" ]]; then | |
brew install capnp pkg-config | |
fi | |
- name: Setup Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.4' | |
- name: Setup Rust | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: stable | |
targets: x86_64-pc-windows-gnu | |
- name: Install Ruby dependencies | |
run: bundle install | |
- name: Setup just | |
uses: extractions/setup-just@v1 | |
- name: Build extension | |
shell: bash | |
run: | | |
if [[ "$RUNNER_OS" == "Windows" ]]; then | |
pacman -S --noconfirm mingw-w64-ucrt-x86_64-capnproto | |
rustup target add x86_64-pc-windows-gnu | |
# ridk enable | |
fi | |
just build-extension | |
- name: Run tests | |
run: just test | |
benchmark: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- name: Install system dependencies | |
shell: bash | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y --no-install-recommends libclang-dev capnproto libcapnp-dev pkg-config | |
# Set environment variables for Rust/bindgen | |
LLVM_VERSION=$(ls /usr/lib/ | grep llvm | sort -V | tail -1) | |
echo "LIBCLANG_PATH=/usr/lib/$LLVM_VERSION/lib" >> $GITHUB_ENV | |
echo "CLANG_PATH=/usr/bin/clang" >> $GITHUB_ENV | |
- name: Setup Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.4' | |
- name: Setup Rust | |
uses: dtolnay/rust-toolchain@stable | |
- name: Install Ruby dependencies | |
run: bundle install | |
- 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 | |
with: | |
lfs: true | |
- 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 |