-
Notifications
You must be signed in to change notification settings - Fork 0
262 lines (261 loc) · 9.07 KB
/
docs.yml
File metadata and controls
262 lines (261 loc) · 9.07 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
name: "Doc-check & Generation"
on:
push:
branches:
- master
- main
env:
# RUSTC_WRAPPER: sccache
RUSTC_WRAPPER: sccache
CACHE_VERSION: v1
SCCACHE_VERSION: 0.10.0
SCCACHE_GHA_ENABLED: true
CARGO_INCREMENTAL: 0
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
PROJECT_NAME: bulk_runner_rs
DOCS_BODY: "${{ github.event.release.body }}"
jobs:
docs:
name: "Docs - docs"
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
gcc: gcc-x86-64-linux-gnu
rust: nightly
- os: windows-latest
target: x86_64-pc-windows-msvc
rust: nightly
runs-on: ${{ matrix.os }}
env:
RUSTC_WRAPPER: sccache
CACHE_VERSION: v1
SCCACHE_VERSION: 0.10.0
steps:
- name: "Checkout sources"
uses: actions/checkout@v4
- name: "Install gcc"
if: matrix.gcc != ''
run: sudo apt update && sudo apt install -yq ${{ matrix.gcc }}
- name: "Setup Rust toolchain"
run: rustup toolchain install nightly --profile default --target ${{ matrix.target }} --no-self-update
####################################################
- name: "Setup sccache"
uses: mozilla-actions/sccache-action@v0.0.9
- name: "Install cargo tools"
uses: taiki-e/install-action@v2
with:
tool: cargo-binstall,cargo-make,just,taplo
- name: "Cache Cargo dependencies"
uses: Swatinem/rust-cache@v2
with:
cache-all-crates: true
- uses: actions/cache@v4
with:
key: ${{ runner.os }}-${{ env.CACHE_VERSION }}-${{ hashFiles('**/Cargo.toml', '**/Cargo.lock') }}
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.cargo/sccache/
~/.rustup/
target/
restore-keys: |
${{ runner.os }}-${{ github.workflow }}-${{ env.CACHE_VERSION }}-${{ github.job }}-
${{ runner.os }}-${{ github.workflow }}-${{ env.CACHE_VERSION }}
####################################################
- name: "Run Cargo Doc checks"
# - name: "Setup sccache"
# uses: mozilla-actions/sccache-action@v0.0.9
# - name: "Setup sccache"
# uses: mozilla-actions/sccache-action@v0.0.9
run: cargo doc --no-deps --all-features --all --target ${{ matrix.target }} --document-private-items
env:
RUSTDOCFLAGS: "-D warnings"
package-docs-unix:
name: "Docs - package-docs-unix"
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
gcc: gcc-x86-64-linux-gnu
rust: nightly
runs-on: ${{ matrix.os }}
env:
RUSTC_WRAPPER: sccache
CACHE_VERSION: v1
SCCACHE_VERSION: 0.10.0
steps:
- name: "Checkout sources"
uses: actions/checkout@v4
- name: "Install gcc"
if: matrix.gcc != ''
run: sudo apt update && sudo apt install -yq ${{ matrix.gcc }}
# - name: "Cache Cargo dependencies"
# uses: Swatinem/rust-cache@v2
- name: "Setup Rust toolchain"
run: rustup toolchain install nightly --profile default --target ${{ matrix.target }} --no-self-update
- name: "Setup sccache"
uses: mozilla-actions/sccache-action@v0.0.9
- name: "Install cargo tools"
uses: taiki-e/install-action@v2
with:
tool: cargo-binstall,cargo-make,just,taplo
- name: "Cache Cargo dependencies"
uses: Swatinem/rust-cache@v2
with:
cache-all-crates: true
- uses: actions/cache@v4
with:
key: ${{ runner.os }}-${{ env.CACHE_VERSION }}-${{ hashFiles('**/Cargo.toml', '**/Cargo.lock') }}
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.cargo/sccache/
~/.rustup/
target/
restore-keys: |
${{ runner.os }}-${{ github.workflow }}-${{ env.CACHE_VERSION }}-${{ github.job }}-
${{ runner.os }}-${{ github.workflow }}-${{ env.CACHE_VERSION }}
# - name: "Setup sccache"
# uses: mozilla-actions/sccache-action@v0.0.9
- name: "Run Cargo Doc generation"
env:
RUSTDOCFLAGS: "-D warnings"
run: cargo doc --no-deps --all-features --all --target ${{ matrix.target }} --document-private-items
- name: "Ensure Zip Installed on Unix"
run: |
if ! command -v zip &> /dev/null
then
sudo apt-get install zip
fi
zip --version
- name: "Upload artifact"
uses: actions/upload-artifact@v4
with:
name: ${{ env.PROJECT_NAME }}-${{ matrix.target }}-docs.zip
path: target/${{ matrix.target }}/doc/
if-no-files-found: 'error'
compression-level: '9'
overwrite: 'true'
package-docs-windows:
name: "Docs - package-docs-windows"
strategy:
matrix:
include:
- os: windows-latest
target: x86_64-pc-windows-msvc
rust: nightly
runs-on: ${{ matrix.os }}
env:
RUSTC_WRAPPER: sccache
CACHE_VERSION: v1
SCCACHE_VERSION: 0.10.0
CARGO_TARGET_X86_64_PC_WINDOWS_MSVC_LINKER: lld-link.exe
steps:
- name: "Checkout sources"
uses: actions/checkout@master
- name: "Setup sccache"
uses: mozilla-actions/sccache-action@v0.0.9
- name: "Install cargo tools"
uses: taiki-e/install-action@v2
with:
tool: cargo-binstall,cargo-make,just,taplo
- name: "Cache Cargo dependencies"
uses: Swatinem/rust-cache@v2
with:
cache-all-crates: true
- uses: actions/cache@v4
with:
key: ${{ runner.os }}-${{ env.CACHE_VERSION }}-${{ hashFiles('**/Cargo.toml', '**/Cargo.lock') }}
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/.cargo/sccache/
~/.rustup/
target/
restore-keys: |
${{ runner.os }}-${{ github.workflow }}-${{ env.CACHE_VERSION }}-${{ github.job }}-
${{ runner.os }}-${{ github.workflow }}-${{ env.CACHE_VERSION }}
# - name: "Setup sccache"
# uses: mozilla-actions/sccache-action@v0.0.9
- name: "Install gcc"
if: matrix.gcc != ''
run: sudo apt update && sudo apt install -yq ${{ matrix.gcc }}
- name: "Setup Rust toolchain"
run: rustup toolchain install nightly --profile default --target ${{ matrix.target }} --no-self-update
- name: "Run Cargo Doc generation"
env:
RUSTDOCFLAGS: "-D warnings"
run: cargo doc --no-deps --all-features --all --target ${{ matrix.target }} --document-private-items
- name: "Upload artifact"
uses: actions/upload-artifact@v4
with:
name: ${{ env.PROJECT_NAME }}-${{ matrix.target }}-docs.zip
path: target\${{ matrix.target }}\doc\
if-no-files-found: 'error'
compression-level: '9'
overwrite: 'true'
publish-docs:
name: "Docs - publish-docs"
permissions:
contents: write
runs-on: ubuntu-latest
needs: [package-docs-unix, package-docs-windows]
steps:
- run: |
echo 'DOCS_BODY<<EOF' >> $GITHUB_ENV
echo "From commit: ${GITHUB_SHA:0:8}" >> $GITHUB_ENV
echo "Generated on: $(date -u +"%Y-%m-%d %H:%M") UTC" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: "Checkout sources"
uses: actions/checkout@v4
- uses: actions/download-artifact@v4
id: artifact-download-step
with:
merge-multiple: true
- name: "Update tag for docs"
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git tag --force docs && git push --force origin tag docs
- name: "Get directory structure"
shell: bash
run: |
sudo apt update
echo $PWD
echo "tree from single dot"
tree -afh .
echo \n\n
echo "tree from github workspace call"
tree -afh ${{ github.workspace }}
- name: Zip - Documentation
shell: bash
run: |
cd "${{ env.PROJECT_NAME }}"
zip -r "../${{ env.PROJECT_NAME }}.zip" .
cd ..
- name: "Docs - draft"
uses: softprops/action-gh-release@v2
with:
tag_name: "docs"
# repository: ${{ github.repository }}
fail_on_unmatched_files: true
draft: true
files: |
${{ env.PROJECT_NAME }}.zip
name: "[${{ github.ref_name }} Docs]"
body: ${{ env.DOCS_BODY }}
target_commitish: ${{ github.sha }}
generate_release_notes: false
# body_path: ${{ github.workspace }}-CHANGELOG.txt ## For adding changelog content