-
Notifications
You must be signed in to change notification settings - Fork 108
39 lines (37 loc) · 1.23 KB
/
synth-bench.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
name: synth-bench
on:
push:
branches: [ master ]
paths: [ '**/*.rs', '.github/workflows/synth-bench.yml' ]
env:
BENCHPATH: /home/runner/work/synth/synth/synth
RUSTFLAGS: "-D warnings"
jobs:
synth_bench:
runs-on: ubuntu-latest
steps:
- name: install valgrind
run: |
sudo apt-get update
sudo apt-get install --yes --no-install-recommends valgrind
- uses: actions/checkout@v2
- uses: dtolnay/rust-toolchain@nightly
- uses: actions/setup-python@v2
- name: run benchmark
id: bench
run: |
body=$(cargo +nightly bench --manifest-path /home/runner/work/synth/synth/synth/Cargo.toml)
body="${body//'%'/'%25'}"
body="${body//$'\n'/'%0A'}"
body="${body//$'\r'/'%0D'}"
echo ::set-output name=body::$body
- name: comment with benchmark results
env:
BODY: ${{ steps.bench.outputs.body }}
uses: actions/github-script@v4
if: github.event_name == 'pull_request'
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { issue: { number: issue_number }, repo: { owner, repo } } = context;
github.issues.createComment({ issue_number, owner, repo, body: process.env.BODY });