forked from slint-ui/slint
-
Notifications
You must be signed in to change notification settings - Fork 0
112 lines (109 loc) · 4.23 KB
/
build_docs.yaml
File metadata and controls
112 lines (109 loc) · 4.23 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
# Copyright © SixtyFPS GmbH <info@slint-ui.com>
# SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-commercial
# Build various demo binaries, c++ packages and documentation and publish them on the website
name: Build docs
on:
workflow_dispatch:
workflow_call:
jobs:
docs:
runs-on: ubuntu-20.04
env:
# Allow deprecated warning because we are using nightly and some things might be deprecated in nightly
# for which the stable alternative is not yet available.
# Allow suspicious-auto-trait-impls to work around https://github.com/Diggsey/scoped-tls-hkt/issues/2
# RUSTFLAGS: -D warnings -W deprecated
RUSTDOCFLAGS: --html-in-header=/home/runner/work/slint/slint/docs/resources/slint-docs-preview.html --html-in-header=/home/runner/work/slint/slint/docs/resources/slint-docs-highlight.html -D warnings -W deprecated -W suspicious-auto-trait-impls
SLINT_NO_QT: 1
CARGO_INCREMENTAL: false
MDBOOK_VERSION: 0.4.10
MDBOOK_LINKCHECK_VERSION: 0.7.4
steps:
- uses: actions/checkout@v2
- name: Set up rgb crate rustdoc link
run: |
rgb_version=`grep 'rgb = ' internal/core/Cargo.toml | sed 's/^.*"\(.*\)"/\1/'`
echo "RUSTDOCFLAGS=$RUSTDOCFLAGS --extern-html-root-url rgb=https://docs.rs/rgb/$rgb_version/ -Z unstable-options" >> $GITHUB_ENV
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: '12'
- name: Cache mdbook and mdbook-linkcheck
uses: actions/cache@v2
with:
path: |
~/.cargo/bin/mdbook
~/.cargo/bin/mdbook-linkcheck
key: ${{ runner.os }}-${{ github.job }}-mdbook-${{ env.MDBOOK_VERSION }}-${{ env.MDBOOK_LINKCHECK_VERSION }}
- name: Install nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
- uses: Swatinem/rust-cache@v1
- name: Install mdbook
run: cargo install mdbook --version ${{ env.MDBOOK_VERSION }} || true
- name: Install mdbook-linkcheck
run: cargo install mdbook-linkcheck --version ${{ env.MDBOOK_LINKCHECK_VERSION }} || true
- name: Install doxygen
run: sudo apt-get install doxygen
- name: Upgrade pip and install pipenv
run: |
python -m pip install --upgrade pip
pip install --user pipenv
- name: Cache Pipenv virtualenv
uses: actions/cache@v2
id: pipenv-cache
with:
path: ~/.local/share/virtualenvs
key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile') }}
restore-keys: |
${{ runner.os }}-pipenv-
- name: Remove docs from cache # Avoid stale docs
run: |
rm -rf target/doc target/cppdocs api/node/docs
- name: Check formatting
uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check
- name: Check license headers
run: cargo xtask check_license_headers --show-all
- name: Check Enum docs
run: |
cargo xtask enumdocs
echo "Check that the docs were actual. If there is a diff you need to run 'cargo xtask enumdocs'"
git diff --exit-code
- name: Check reuse compliance
run: cargo xtask check_reuse_compliance
- name: Build Cpp docs
run: cargo xtask cppdocs --show-warnings
- name: "Rust docs"
uses: actions-rs/cargo@v1
with:
command: doc
toolchain: nightly
args: -p slint -p slint-build -p slint-interpreter --no-deps --all-features
- name: "Rust Tutorial Docs"
run: mdbook build
working-directory: docs/tutorial/rust
- name: "C++ Tutorial Docs"
run: mdbook build
working-directory: docs/tutorial/cpp
- name: "Node docs"
run: |
npm install --ignore-scripts
npm run docs
working-directory: api/node
- name: "Upload Docs Artifacts"
uses: actions/upload-artifact@v2
with:
name: docs
path: |
target/doc
target/cppdocs/html
api/node/docs
docs/tutorial/rust/book/html
docs/tutorial/cpp/book/html
- name: Clean cache # Don't cache docs to avoid them including removed classes being published
run: |
rm -rf target/doc target/cppdocs api/node/docs docs/tutorial/rust/book docs/tutorial/cpp/book