-
Notifications
You must be signed in to change notification settings - Fork 323
86 lines (82 loc) · 3.24 KB
/
hyperfine.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: hyperfine
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
GITHUB_TOKEN: ${{ secrets.MY_RELEASE_PLEASE_TOKEN || secrets.GITHUB_TOKEN }}
MISE_EXPERIMENTAL: 1
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER: clang
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS: -C link-arg=-fuse-ld=mold
permissions:
pull-requests: write
jobs:
benchmark:
runs-on: ubuntu-latest
timeout-minutes: 20
if: github.head_ref == 'release' || github.head_ref == 'hyperfine'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: rui314/setup-mold@v1
- uses: Swatinem/rust-cache@v2
- run: curl https://mise.run | MISE_INSTALL_PATH="$HOME/bin/mise-release" sh
- run: echo "$HOME/bin" >> "$GITHUB_PATH"
- id: versions
run: |
#echo "main=$(git rev-parse --short origin/main)" >> "$GITHUB_OUTPUT"
echo "release=$(mise-release v | awk '{print $1}')" >> "$GITHUB_OUTPUT"
#- uses: actions/cache@v4
# with:
# path: ~/bin/mise-${{ steps.versions.outputs.main }}
# key: mise-hyperfine-main-${{ steps.versions.outputs.main }}-${{ runner.os }}
#- name: build main
# run: |
# if [ ! -f "$HOME/bin/mise-${{ steps.versions.outputs.main }}" ]; then
# git checkout main
# cargo build --profile serious && mv target/serious/mise "$HOME/bin/mise-${{ steps.versions.outputs.main }}"
# git checkout -
# fi
- run: mv "$HOME/bin/mise-release" "$HOME/bin/mise-${{ steps.versions.outputs.release }}"
#- run: cp "$HOME/bin/mise-${{ steps.versions.outputs.main }}" "$HOME/bin/mise-main"
- run: cargo build --profile serious && mv target/serious/mise "$HOME/bin"
- uses: actions/cache@v4
with:
key: ${{ runner.os }}-mise-tools-${{ hashFiles('mise.lock') }}
path: |
~/.local/share/mise
~/.cache/mise
- run: mise x wait-for-gh-rate-limit -- wait-for-gh-rate-limit
- run: mise install
- run: |
CMDS=(
"x -- echo"
"env"
"hook-env"
"ls"
)
echo "# Hyperfine Performance" >> comment.md
for cmd in "${CMDS[@]}"; do
#mise x hyperfine -- hyperfine -N -w 10 -r 500 --export-markdown out.md --reference "mise-main $cmd" "mise-${{ steps.versions.outputs.release }} $cmd" "mise $cmd"
mise x hyperfine -- hyperfine -N -w 10 -r 500 --export-markdown out.md --reference "mise-${{ steps.versions.outputs.release }} $cmd" "mise $cmd"
echo "### \`mise $cmd\`" >> comment.md
cat out.md >> comment.md
done
cat comment.md >> "$GITHUB_STEP_SUMMARY"
env:
SHELL: zsh
- name: Comment on PR
uses: thollander/actions-comment-pull-request@v3
if: github.event_name == 'pull_request'
continue-on-error: true
#if: "startsWith(github.event.pull_request.title, 'perf:') || startsWith(github.event.pull_request.title, 'chore: release')"
with:
file-path: comment.md
comment-tag: hyperfine