forked from boa-dev/boa
-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (54 loc) · 1.78 KB
/
main.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
name: Main workflows
on:
push:
branches:
- main
jobs:
benchmark:
if: ${{ github.actor != 'dependabot[bot]' }}
name: Upload docs and run benchmarks
runs-on: ubuntu-latest
timeout-minutes: 120
steps:
- uses: actions/checkout@v4
- uses: actions-rs/[email protected]
with:
toolchain: stable
override: true
profile: minimal
- name: Cache cargo
uses: actions/cache@v3
with:
path: |
target
!target/doc_upload
~/.cargo/git
~/.cargo/registry
key: ${{ runner.os }}-cargo-doc-bench-${{ hashFiles('**/Cargo.lock') }}
- name: Generate documentation
uses: actions-rs/cargo@v1
with:
command: doc
args: -v --document-private-items --all-features --workspace --no-deps --exclude boa_examples
- run: echo "<meta http-equiv=refresh content=0;url=boa_engine/index.html>" > target/doc/index.html
- run: |
if [ -d target/doc_upload ]; then rm -rf target/doc_upload; fi
mkdir target/doc_upload && mv target/doc target/doc_upload/doc
- name: Upload documentation
uses: crazy-max/[email protected]
with:
target_branch: gh-pages
keep_history: true
build_dir: target/doc_upload
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run benchmark
run: cargo bench -p boa_engine -- --output-format bencher | tee output.txt
- name: Store benchmark result
uses: benchmark-action/[email protected]
with:
name: Boa Benchmarks
tool: "cargo"
output-file-path: output.txt
auto-push: true
github-token: ${{ secrets.GITHUB_TOKEN }}