Skip to content

Commit 1d28383

Browse files
test: deploy docs and benchmark results on main
benchmark results contain dummy data for tests only
1 parent 77ef32a commit 1d28383

File tree

3 files changed

+484
-2
lines changed

3 files changed

+484
-2
lines changed

.github/workflows/docs.yml

Lines changed: 64 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: GitHubPages
33

44
on:
55
push:
6-
branches: ["main"]
6+
branches: ["main", "benchmark_test"]
77

88
# Cancel previous in-progress workflow, only the latest run is relevant
99
concurrency:
@@ -14,8 +14,52 @@ permissions:
1414
contents: read
1515

1616
jobs:
17+
benchmark:
18+
name: Performance regression check
19+
permissions:
20+
# deployments permission to deploy GitHub pages website
21+
deployments: write
22+
# contents permission to update benchmark contents in gh-pages branch
23+
contents: write
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v1
27+
- name: Run benchmark
28+
run: cat .github/workflows/testjson.json > output.txt
29+
# Run `github-action-benchmark` action
30+
- name: Store benchmark result
31+
uses: benchmark-action/github-action-benchmark@v1
32+
with:
33+
name: My Project Benchmark
34+
# What benchmark tool the output.txt came from // customs have too //
35+
tool: 'customSmallerIsBetter'
36+
# Where the output from the benchmark tool is stored
37+
output-file-path: output.txt
38+
# Workflow will fail when an alert happens
39+
fail-on-alert: true
40+
# Access token to deploy GitHub Pages branch
41+
github-token: ${{ secrets.GITHUB_TOKEN }}
42+
# Push and deploy GitHub pages branch automatically
43+
auto-push: true
44+
45+
gh-pages-branch: "benchmark_test"
46+
# Upload the updated cache file for the next job by actions/cache
47+
48+
- name: Checkout benchmark_test
49+
uses: actions/checkout@v4
50+
with:
51+
ref: "benchmark_test"
52+
53+
54+
- name: Upload artifact
55+
uses: actions/upload-artifact@v4
56+
with:
57+
name: benchie
58+
path: dev/bench
59+
1760
build:
1861
name: Build docs
62+
needs: benchmark
1963
runs-on: ${{ github.repository_owner == 'oneapi-src' && 'intel-ubuntu-22.04' || 'ubuntu-latest' }}
2064

2165
steps:
@@ -40,10 +84,28 @@ jobs:
4084
- name: Setup PATH for python
4185
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
4286

87+
- name: Show before download
88+
run: ls
89+
90+
- name: Download benchmark result
91+
uses: actions/download-artifact@v4
92+
with:
93+
name: benchie
94+
95+
- name: Show downloaded
96+
run: ls
97+
4398
- name: Build the documentation
4499
working-directory: scripts
45100
run: python3 generate_docs.py
46101

102+
- name: Move benchmark files
103+
run: mv index.html docs/html/index_benchmark.html && mv data.js docs/html
104+
105+
- name: List upload
106+
working-directory: docs/html
107+
run: ls
108+
47109
- name: Upload artifact
48110
uses: actions/upload-pages-artifact@0252fc4ba7626f0298f0cf00902a25c6afc77fa8 # v3.0.0
49111
with:
@@ -52,7 +114,7 @@ jobs:
52114
deploy:
53115
name: Deploy docs to GitHub Pages
54116
needs: build
55-
117+
56118
permissions:
57119
pages: write
58120
id-token: write

.github/workflows/testjson.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[
2+
{
3+
"name": "My Custom Smaller Is Better Benchmark - CPU Load",
4+
"unit": "Percent",
5+
"value": 50
6+
},
7+
{
8+
"name": "My Custom Smaller Is Better Benchmark - Memory Used",
9+
"unit": "Megabytes",
10+
"value": 100,
11+
"range": "3",
12+
"extra": "Value for Tooltip: 25\nOptional Num #2: 100\nAnything Else!"
13+
}
14+
]

0 commit comments

Comments
 (0)