Skip to content

Commit df1ca30

Browse files
authored
Merge pull request #5333 from IntersectMBO/nm/gh-pages-refactor
Improve benchmarks publishing workflow
2 parents 9326941 + 26e2345 commit df1ca30

File tree

2 files changed

+23
-18
lines changed

2 files changed

+23
-18
lines changed

.github/workflows/bench.yml

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ jobs:
1919
GH_PAGES_BRANCH: benchmark-pages
2020

2121
steps:
22-
- uses: actions/checkout@v2
22+
- uses: actions/checkout@v5
2323

24-
- uses: cachix/install-nix-action@v15
24+
- uses: cachix/install-nix-action@v31
2525
with:
2626
nix_path: nixpkgs=channel:nixos-unstable
2727
extra_nix_config: |
@@ -41,19 +41,6 @@ jobs:
4141
nix-env -i jq -f '<nixpkgs>'
4242
jq -f .github/tools/extract_criterion.jq < libs/cardano-ledger-test/bench.json > output.json
4343
44-
- name: Truncate benchmark git history
45-
run: |
46-
git fetch origin refs/heads/$GH_PAGES_BRANCH:refs/remotes/origin/$GH_PAGES_BRANCH
47-
git checkout -t origin/$GH_PAGES_BRANCH
48-
START=$(git rev-parse "@{2 weeks ago}")
49-
git checkout --orphan new-root $START
50-
git config user.name "$(git log -1 --format=%cn $START)"
51-
git config user.email "$(git log -1 --format=%ce $START)"
52-
git commit -C $START
53-
git rebase --onto new-root $START $GH_PAGES_BRANCH
54-
git push -f
55-
git checkout --detach
56-
5744
- name: Store benchmark results
5845
uses: benchmark-action/github-action-benchmark@v1
5946
with:
@@ -68,3 +55,15 @@ jobs:
6855
comment-on-alert: true
6956
fail-on-alert: true
7057
alert-comment-cc-users: '@lehins'
58+
59+
- name: Abbreviate git history
60+
run: |
61+
git branch -D $GH_PAGES_BRANCH || true
62+
git fetch origin refs/heads/$GH_PAGES_BRANCH*:refs/remotes/origin/$GH_PAGES_BRANCH*
63+
git checkout -t origin/$GH_PAGES_BRANCH
64+
git config user.name "$(git log -1 --format=%cn)"
65+
git config user.email "$(git log -1 --format=%ce)"
66+
git reset --keep origin/$GH_PAGES_BRANCH-base
67+
git checkout @{u} .
68+
git commit -C @{u}
69+
git push -f

scripts/mkprolog.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,17 @@ exec >"$PROLOG_FILE" # Write all stdout to $PROLOG_FILE from here on
1010
cd "$HADDOCKS_DIR"
1111

1212
cat << EOF
13-
= Cardano Ledger Repository Hackage Documentation
13+
= Cardano Ledger Repository Documentation
1414
15-
[skip to module list](#module-list)
15+
== Benchmarks
1616
17-
This site contains Haskell documentation of:
17+
* [Charts](dev/bench/) showing historical trends
18+
19+
== Package Documentation
20+
21+
[Skip to module list](#module-list)
22+
23+
This page contains Haskell documentation of:
1824
1925
EOF
2026

0 commit comments

Comments
 (0)