@@ -38,18 +38,38 @@ jobs:
3838 with :
3939 # We need history to get tags
4040 fetch-depth : 0
41+
42+ # Cache Rust dependencies to speed up builds
43+ - name : Cache Rust dependencies
44+ uses : actions/cache@v4
45+ with :
46+ path : |
47+ ~/.cargo/bin/
48+ ~/.cargo/registry/index/
49+ ~/.cargo/registry/cache/
50+ ~/.cargo/git/db/
51+ target/
52+ key : ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
4153
4254 - name : Setup Python
4355 uses : actions/setup-python@v5
4456 with :
4557 python-version : ' 3.x'
58+
59+ # Setup Java for PlantUML
60+ - name : Set up JDK
61+ uses : actions/setup-java@v4
62+ with :
63+ distribution : ' temurin'
64+ java-version : ' 17'
4665
4766 - name : Setup Rust and build API docs
4867 uses : actions-rs/toolchain@v1
4968 with :
5069 profile : minimal
5170 toolchain : nightly
5271 override : true
72+ components : llvm-tools-preview
5373
5474 - name : Check if just is available
5575 id : check-just
6787 run : cargo install just --locked
6888
6989 - name : Install python dependencies
70- if : env.JUST_INSTALLED != 'true'
7190 run : just setup-python-deps
91+
92+ - name : Install cargo-llvm-cov
93+ run : cargo install cargo-llvm-cov
94+
95+ # Install PlantUML for diagram generation
96+ - name : Install PlantUML
97+ run : |
98+ sudo apt-get update
99+ sudo apt-get install -y plantuml
100+
101+ # Run coverage separately to handle errors better
102+ - name : Generate code coverage
103+ run : |
104+ # Generate coverage data
105+ cargo xtask coverage || {
106+ echo "::warning::Failed to generate coverage data. Creating placeholder..."
107+ mkdir -p target/llvm-cov/html
108+ echo "<h1>Coverage Report Not Available</h1>" > target/llvm-cov/html/index.html
109+ mkdir -p docs/source
110+ cp docs/source/_generated_coverage_summary.rst.template docs/source/_generated_coverage_summary.rst || true
111+ }
72112
73113 - name : Determine version
74114 id : determine-version
@@ -102,6 +142,9 @@ jobs:
102142 export DOCS_VERSION="${{ env.VERSION }}"
103143 export DOCS_VERSION_PATH_PREFIX="/"
104144
145+ # Skip coverage generation since we already did it separately
146+ export SKIP_COVERAGE=1
147+
105148 # Build documentation (continue on error)
106149 just docs-with-diagrams || {
107150 echo "::warning::Documentation build encountered errors but will try to continue with versioning"
0 commit comments