-
-
Notifications
You must be signed in to change notification settings - Fork 29
66 lines (56 loc) · 1.83 KB
/
docs.yml
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
name: docs
on:
push:
branches:
- main
pull_request:
# security: restrict permissions for CI jobs.
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# Build the documentation and upload the static HTML files as an artifact.
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install maturin[zig] from PyPI
uses: install-pinned/maturin-with-zig@59341946682d2f69df7150f6941f53e026e344fd
- name: Install mypy from PyPI
uses: install-pinned/mypy@0ac9691d218a55b59b345debcd9d4b3ca17b391b
- name: Install pdoc from PyPI
uses: install-pinned/pdoc@7ed463fdd937004663bcdd7b43c303e9df472c92
- run: maturin build
working-directory: ./ffi
- run: pip install --no-index --find-links target/wheels/ mitmproxy_rs
- run: stubtest --allowlist ffi/stubtest-allowlist.txt --mypy-config-file ffi/pyproject.toml mitmproxy_rs
- run: pdoc -o docs/ mitmproxy_rs
- uses: actions/upload-pages-artifact@v1
with:
path: docs/
# Deploy the artifact to GitHub pages.
# This is a separate job so that only actions/deploy-pages has the necessary permissions.
deploy:
if: github.ref == 'refs/heads/main'
needs: build
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v2