mirror of
https://github.com/shadowsocks/shadowsocks-libev.git
synced 2026-11-02 07:53:43 +00:00
Publish native Doxygen documentation with GitHub Pages
This commit is contained in:
@@ -43,7 +43,7 @@ jobs:
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libpcre2-dev libmbedtls-dev libsodium-dev libuv1-dev libc-ares-dev
|
||||
sudo apt-get install -y --no-install-recommends \
|
||||
build-essential cmake debhelper dpkg-dev fakeroot asciidoc-base xmlto pkg-config
|
||||
build-essential cmake debhelper dpkg-dev fakeroot doxygen pkg-config
|
||||
|
||||
- name: Debian package build test
|
||||
run: bash tests/test_deb_build.sh
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
name: documentation
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: [master]
|
||||
push:
|
||||
branches: [master]
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: documentation-${{ github.ref }}
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
docs:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- name: Install Doxygen
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y --no-install-recommends doxygen
|
||||
- name: Build and validate documentation
|
||||
run: |
|
||||
python3 scripts/check_cli_docs.py
|
||||
python3 -m unittest discover -s tests -p test_cli_docs.py
|
||||
cmake -S . -B build-docs -DWITH_DOC_MAN=ON -DWITH_DOC_HTML=ON
|
||||
cmake --build build-docs --target doc-man doc-html --parallel 2
|
||||
python3 scripts/check_cli_docs.py --rendered build-docs
|
||||
test -s build-docs/html/index.html
|
||||
- name: Upload GitHub Pages site
|
||||
if: github.repository == 'shadowsocks/shadowsocks-c' && github.ref == 'refs/heads/master' && github.event_name != 'pull_request'
|
||||
uses: actions/upload-pages-artifact@v5
|
||||
with:
|
||||
path: build-docs/html
|
||||
|
||||
deploy:
|
||||
needs: docs
|
||||
if: github.repository == 'shadowsocks/shadowsocks-c' && github.ref == 'refs/heads/master' && github.event_name != 'pull_request'
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
permissions:
|
||||
pages: write
|
||||
id-token: write
|
||||
environment:
|
||||
name: github-pages
|
||||
url: ${{ steps.deployment.outputs.page_url }}
|
||||
steps:
|
||||
- name: Configure GitHub Pages
|
||||
uses: actions/configure-pages@v6
|
||||
- name: Deploy documentation
|
||||
id: deployment
|
||||
uses: actions/deploy-pages@v5
|
||||
@@ -26,27 +26,10 @@ jobs:
|
||||
run: actionlint -shellcheck= -pyflakes=
|
||||
- name: Lint Python scripts and tests
|
||||
run: ruff check --select E9,F63,F7,F82 tests scripts
|
||||
- name: Check generated CLI documentation
|
||||
- name: Check Doxygen CLI documentation
|
||||
run: |
|
||||
python3 scripts/gen_cli_docs.py --check
|
||||
python3 -m unittest discover -s tests -p test_gen_cli_docs.py
|
||||
|
||||
docs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- name: Install documentation tools
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y --no-install-recommends asciidoc xmlto docbook-xml docbook-xsl
|
||||
- name: Build man pages and HTML from source
|
||||
run: |
|
||||
cmake -S . -B build-docs -DWITH_DOC_MAN=ON -DWITH_DOC_HTML=ON
|
||||
cmake --build build-docs --target doc-man doc-html --parallel 2
|
||||
test -s build-docs/man/ss-local.1
|
||||
test -s build-docs/man/ss-nat.1
|
||||
test -s build-docs/man/shadowsocks-c.8
|
||||
test -s build-docs/html/ss-local.html
|
||||
python3 scripts/check_cli_docs.py
|
||||
python3 -m unittest discover -s tests -p test_cli_docs.py
|
||||
|
||||
tests:
|
||||
strategy:
|
||||
|
||||
Reference in New Issue
Block a user