-
Notifications
You must be signed in to change notification settings - Fork 11
111 lines (94 loc) · 3.61 KB
/
Copy pathtest-docs-examples.yml
File metadata and controls
111 lines (94 loc) · 3.61 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
name: Documentation Tests & Build
permissions:
contents: read
on:
push:
branches: [ main, master, development, dev ]
paths:
- 'docs/**'
- 'Justfile'
- '.github/workflows/test-docs-examples.yml'
pull_request:
branches: [ main, master, development, dev ]
paths:
- 'docs/**'
- 'Justfile'
- '.github/workflows/test-docs-examples.yml'
workflow_dispatch:
env:
RUSTFLAGS: -C debuginfo=0
RUST_BACKTRACE: 1
PYTHONUTF8: 1
LLVM_VERSION: "21.1"
LLVM_RELEASE_VERSION: "21.1.8"
jobs:
docs-ci:
name: Test and build documentation
runs-on: ubuntu-latest
steps:
- name: Harden the runner (egress audit)
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
with:
egress-policy: audit
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
with:
android: true
dotnet: true
haskell: true
large-packages: false
docker-images: true
tool-cache: false
swap-storage: true
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
with:
python-version: '3.10'
- name: Install the latest version of uv
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
with:
version: "0.11.14"
enable-cache: true
save-cache: ${{ github.event_name == 'push' && (github.ref_name == 'main' || github.ref_name == 'master' || github.ref_name == 'development' || github.ref_name == 'dev') }}
- name: Set up Rust
run: |
bash scripts/ci/ensure-rust.sh stable minimal
export PATH="$HOME/.cargo/bin:$PATH"
rustup show
- name: Install just
uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 # v4
- name: Cache Rust
uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
with:
cache-bin: false
prefix-key: v1-rust-no-bin
save-if: ${{ github.event_name == 'push' && (github.ref_name == 'main' || github.ref_name == 'master' || github.ref_name == 'development' || github.ref_name == 'dev') }}
workspaces: |
python/pecos-rslib
python/pecos-rslib-llvm
- name: Cache LLVM ${{ env.LLVM_VERSION }}
id: cache-llvm
uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
with:
path: ~/.pecos/deps/llvm-21.1
key: llvm-${{ env.LLVM_RELEASE_VERSION }}-${{ runner.os }}-${{ runner.arch }}-v3
- name: Ensure LLVM ${{ env.LLVM_VERSION }}
run: just ci-env
- name: Save LLVM ${{ env.LLVM_VERSION }} cache
if: steps.cache-llvm.outputs.cache-hit != 'true' && github.event_name == 'push' && (github.ref_name == 'main' || github.ref_name == 'master' || github.ref_name == 'development' || github.ref_name == 'dev')
uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
with:
path: ~/.pecos/deps/llvm-21.1
key: ${{ steps.cache-llvm.outputs.cache-primary-key }}
- name: Install dependencies and build
run: |
uv lock --check --project .
just python-ci-build-docs
- name: Test documentation examples
run: just docs-test
- name: Build documentation
if: success()
run: uv run --frozen mkdocs build