|
7 | 7 |
|
8 | 8 | jobs:
|
9 | 9 | cargo-doc:
|
10 |
| - if: github.event.pull_request.draft == false |
11 | 10 | runs-on: ubuntu-22.04
|
12 |
| - strategy: |
13 |
| - fail-fast: false |
14 |
| - matrix: |
15 |
| - include: |
16 |
| - - project: mithril-core |
17 |
| - cargo_project_name: mithril |
18 |
| - - project: mithril-common |
19 |
| - - project: mithril-aggregator |
20 |
| - - project: mithril-client |
21 |
| - - project: mithril-signer |
22 |
| - env: |
23 |
| - CARGO_PROJECT_NAME: ${{ matrix.project }} |
24 |
| - |
25 | 11 | steps:
|
26 | 12 | - name: Checkout sources
|
27 | 13 | uses: actions/checkout@v3
|
28 | 14 |
|
29 |
| - - name: Overriding default $CARGO_PROJECT_NAME with matrix value |
30 |
| - if: ${{ matrix.cargo_project_name }} |
31 |
| - run: echo "CARGO_PROJECT_NAME=${{ matrix.cargo_project_name }}" >> $GITHUB_ENV |
32 |
| - |
33 | 15 | - name: Install stable toolchain
|
34 | 16 | uses: actions-rs/toolchain@v1
|
35 | 17 | with:
|
36 | 18 | profile: minimal
|
37 | 19 | toolchain: stable
|
38 | 20 | override: true
|
39 | 21 |
|
40 |
| - - uses: actions/cache@v3 |
41 |
| - name: Cache Cargo.lock |
| 22 | + - name: Rust Cache |
| 23 | + uses: Swatinem/rust-cache@v2 |
42 | 24 | with:
|
43 |
| - path: | |
44 |
| - ~/.cargo/bin/ |
45 |
| - ~/.cargo/registry/ |
46 |
| - ~/.cargo/git/ |
47 |
| - target/ |
48 |
| - key: cargo-doc-${{ runner.os }}-cache-v${{ secrets.CACHE_VERSION }}-${{ matrix.project }}-${{ hashFiles('Cargo.lock') }} |
49 |
| - restore-keys: | |
50 |
| - cargo-doc-${{ runner.os }}-cache-v${{ secrets.CACHE_VERSION }}-${{ matrix.project }}- |
51 |
| - cargo-doc-${{ runner.os }}-cache-v${{ secrets.CACHE_VERSION }}- |
52 |
| -
|
53 |
| - - name: Generate ${{ matrix.project }} doc |
| 25 | + key: ${{ runner.os }}-cache-v${{ secrets.CACHE_VERSION }} |
| 26 | + |
| 27 | + - name: Generate cargo doc |
54 | 28 | uses: actions-rs/cargo@v1
|
55 | 29 | with:
|
56 | 30 | command: doc
|
57 |
| - args: --no-deps -p ${{ env.CARGO_PROJECT_NAME }} |
| 31 | + args: --no-deps -p mithril -p mithril-common -p mithril-aggregator -p mithril-signer -p mithril-client |
58 | 32 |
|
59 |
| - - name: Publish ${{ matrix.project }}-doc |
| 33 | + - name: Publish Mithril-rust-doc |
60 | 34 | uses: actions/upload-artifact@v3
|
61 | 35 | with:
|
62 |
| - name: ${{ matrix.project }}-doc |
| 36 | + name: mithril-rust-doc |
63 | 37 | if-no-files-found: error
|
64 | 38 | path: |
|
65 | 39 | target/doc/
|
66 | 40 |
|
67 | 41 | build-docusaurus:
|
68 |
| - if: github.event.pull_request.draft == false |
69 | 42 | runs-on: ubuntu-22.04
|
70 | 43 | steps:
|
71 | 44 | - name: Checkout sources
|
@@ -148,35 +121,11 @@ jobs:
|
148 | 121 | - build-explorer
|
149 | 122 | - build-open-api-ui
|
150 | 123 | steps:
|
151 |
| - - name: Download mithril-core-doc artifact |
152 |
| - uses: actions/download-artifact@v3 |
153 |
| - with: |
154 |
| - name: mithril-core-doc |
155 |
| - path: ./github-pages/mithril-core/doc |
156 |
| - |
157 |
| - - name: Download mithril-common-doc artifact |
158 |
| - uses: actions/download-artifact@v3 |
159 |
| - with: |
160 |
| - name: mithril-common-doc |
161 |
| - path: ./github-pages/mithril-common/doc |
162 |
| - |
163 |
| - - name: Download aggregator-doc artifact |
164 |
| - uses: actions/download-artifact@v3 |
165 |
| - with: |
166 |
| - name: mithril-aggregator-doc |
167 |
| - path: ./github-pages/mithril-aggregator/doc |
168 |
| - |
169 |
| - - name: Download client-doc artifact |
170 |
| - uses: actions/download-artifact@v3 |
171 |
| - with: |
172 |
| - name: mithril-client-doc |
173 |
| - path: ./github-pages/mithril-client/doc |
174 |
| - |
175 |
| - - name: Download signer-doc artifact |
| 124 | + - name: Download mithril-rust-doc artifact |
176 | 125 | uses: actions/download-artifact@v3
|
177 | 126 | with:
|
178 |
| - name: mithril-signer-doc |
179 |
| - path: ./github-pages/mithril-signer/doc |
| 127 | + name: mithril-rust-doc |
| 128 | + path: ./github-pages/rust-doc |
180 | 129 |
|
181 | 130 | - name: Download Docusaurus build
|
182 | 131 | uses: actions/download-artifact@v3
|
|
0 commit comments