mirror of
https://github.com/slint-ui/slint.git
synced 2025-12-23 09:19:32 +00:00
112 lines
4.2 KiB
YAML
112 lines
4.2 KiB
YAML
# 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
|