Skip to content

Commit 92edeef

Browse files
committed
doc: generate cargo docs on github pages
1 parent aacbe4f commit 92edeef

File tree

2 files changed

+92
-39
lines changed

2 files changed

+92
-39
lines changed

.github/workflows/doc.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: CI
2+
3+
# Controls when the workflow will run
4+
on:
5+
pull_request:
6+
push:
7+
branches: [ "main" ]
8+
9+
name: Generate cargo docs
10+
11+
jobs:
12+
docs:
13+
name: Docs
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
- name: Setup Rust
19+
uses: dtolnay/rust-toolchain@stable
20+
- name: Configure cache
21+
uses: Swatinem/rust-cache@v2
22+
- name: Setup pages
23+
id: pages
24+
uses: actions/configure-pages@v4
25+
- name: Clean docs folder
26+
run: cargo clean --doc
27+
- name: Build docs
28+
run: cargo doc --no-deps
29+
- name: Add redirect
30+
run: echo '<meta http-equiv="refresh" content="0;url=aoc/index.html">' > target/doc/index.html
31+
- name: Remove lock file
32+
run: rm target/doc/.lock
33+
- name: Upload artifact
34+
uses: actions/upload-pages-artifact@v3
35+
with:
36+
path: target/doc
37+
38+
deploy:
39+
name: Deploy
40+
runs-on: ubuntu-latest
41+
needs: docs
42+
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
43+
permissions:
44+
pages: write # to deploy to Pages
45+
id-token: write # to verify the deployment originates from an appropriate source
46+
environment:
47+
name: github-pages
48+
url: ${{ steps.deployment.outputs.page_url }}
49+
steps:
50+
- name: Deploy to GitHub Pages
51+
id: deployment
52+
uses: actions/deploy-pages@v4

.github/workflows/rust.yml

Lines changed: 40 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -28,43 +28,44 @@ jobs:
2828
command: fmt
2929
args: --all -- --check
3030

31-
check:
32-
name: Check
33-
runs-on: ubuntu-latest
34-
steps:
35-
- run: sudo apt-get update && sudo apt-get install -yq pkg-config libssl-dev
36-
- uses: actions/checkout@v2
37-
- uses: actions/setup-go@v3
38-
with:
39-
go-version: ~1.20
40-
- uses: actions-rs/toolchain@v1
41-
with:
42-
profile: minimal
43-
toolchain: nightly-2024-05-17
44-
override: true
45-
- uses: actions-rs/cargo@v1
46-
with:
47-
command: check
31+
# check:
32+
# name: Check
33+
# runs-on: ubuntu-latest
34+
# steps:
35+
# - run: sudo apt-get update && sudo apt-get install -yq pkg-config libssl-dev
36+
# - uses: actions/checkout@v2
37+
# - uses: actions/setup-go@v3
38+
# with:
39+
# go-version: ~1.20
40+
# - uses: actions-rs/toolchain@v1
41+
# with:
42+
# profile: minimal
43+
# toolchain: nightly-2024-05-17
44+
# override: true
45+
# - uses: actions-rs/cargo@v1
46+
# with:
47+
# command: check
4848

49-
test:
50-
name: Test Suite
51-
runs-on: nix-128g
52-
steps:
53-
- name: Checkout sources
54-
uses: actions/checkout@v4
55-
- name: Generate a random port number
56-
run: echo PGSQL_PORT=$(shuf -i 5000-30000 -n1) > .env
57-
- name: Install foundry
58-
shell: devenv shell bash -- -e {0}
59-
run: cargo install --root ${HOME}/.cargo --git https://github.com/foundry-rs/foundry --rev c4a984f forge anvil
60-
- name: Put cargo in PATH
61-
shell: devenv shell bash -- -e {0}
62-
run: echo "${HOME}/.cargo/bin" >> $GITHUB_PATH
63-
- name: Run cargo test
64-
run: devenv test
65-
env:
66-
RUST_LOG: "info"
67-
RUST_MIN_STACK: 10485760
68-
CI_RPC_URL: ${{ secrets.CI_RPC_URL }}
69-
CI_SEPOLIA: ${{ secrets.CI_SEPOLIA }}
70-
CI_ETH: ${{ secrets.CI_ETH }}
49+
50+
# test:
51+
# name: Test Suite
52+
# runs-on: nix-128g
53+
# steps:
54+
# - name: Checkout sources
55+
# uses: actions/checkout@v4
56+
# - name: Generate a random port number
57+
# run: echo PGSQL_PORT=$(shuf -i 5000-30000 -n1) > .env
58+
# - name: Install foundry
59+
# shell: devenv shell bash -- -e {0}
60+
# run: cargo install --root ${HOME}/.cargo --git https://github.com/foundry-rs/foundry --rev c4a984f forge anvil
61+
# - name: Put cargo in PATH
62+
# shell: devenv shell bash -- -e {0}
63+
# run: echo "${HOME}/.cargo/bin" >> $GITHUB_PATH
64+
# - name: Run cargo test
65+
# run: devenv test
66+
# env:
67+
# RUST_LOG: "info"
68+
# RUST_MIN_STACK: 10485760
69+
# CI_RPC_URL: ${{ secrets.CI_RPC_URL }}
70+
# CI_SEPOLIA: ${{ secrets.CI_SEPOLIA }}
71+
# CI_ETH: ${{ secrets.CI_ETH }}

0 commit comments

Comments
 (0)