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
name: Publish Docs
on:
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-main
cancel-in-progress: true
jobs:
publish-docs:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout main
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: docs
- name: Set up Git user
run: |
git config user.name "github-actions"
git config user.email "github-actions@github.com"
- name: Reset docs branch to main
run: |
git fetch
git reset --hard origin/main
- name: Setup Rust
run: |
rustup update stable && rustup default stable
- name: Run tests
run: |
cargo test
- name: Run benchmarks
env:
SKIP_BENCH_ASSERTIONS: true
run: |
cargo bench
- name: Build docs
run: |
cp -r target/criterion docs/criterion
echo "
" >> docs/index.md
cat README.md >> docs/index.md
- name: Commit docs
run: |
git add .
git commit -m "docs: build docs" || echo "No changes to commit"
- name: Force push to docs branch
run: |
git push --force