Skip to content

add CI/CD for documentation#45

Open
gkuznik wants to merge 4 commits intomainfrom
docs-ci
Open

add CI/CD for documentation#45
gkuznik wants to merge 4 commits intomainfrom
docs-ci

Conversation

@gkuznik
Copy link
Copy Markdown
Member

@gkuznik gkuznik commented Apr 2, 2026

No description provided.

automatically builds the docs and deploys the default branch
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a static website landing page and a GitHub Actions job intended to generate Rust docs and deploy them to GitHub Pages.

Changes:

  • Added website/index.html as a documentation landing page.
  • Added a docs job to .github/workflows/ci.yml to build Rust docs and deploy the website/ directory to GitHub Pages.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 3 comments.

File Description
website/index.html New static homepage with links to source and documentation.
.github/workflows/ci.yml Adds a docs build + GitHub Pages deployment job.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 2, 2026

LCOV of commit 5fc8ef1 during Osiris CI #409

This pull request changes total coverage 0.00% (13.56% -> 13.56%) for this diff

lcov: WARNING: lcov: WARNING: RC option 'lcov_branch_coverage' is deprecated.  Consider using 'branch_coverage. instead.  (Backward-compatible support will be removed in the future
Summary coverage rate:
  lines......: 13.6% (232 of 1711 lines)
  functions..: 16.7% (39 of 233 functions)
  branches...: no data found

Files changed coverage rate: n/a

Comment on lines +138 to +161
name: Build the documentation
runs-on: ubuntu-latest
needs: [container]
container:
image: ${{ needs.container.outputs.container_name }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive

- name: Set stm32l4r5zi config
run: just config load stm32l4r5zi_def --no-confirm

- name: Generate docs
run: cargo doc --no-deps --workspace

- name: Upload docs artifact
uses: actions/upload-artifact@v4
with:
name: docs
path: target/doc

deploy-docs:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI 3 days ago

In general, to fix this class of issue, you add an explicit permissions block either at the workflow root (applies to all jobs without their own permissions) or at the individual job level, and scope it down to exactly what that job needs. For read-only workflows that just check out code and run tests/builds, contents: read is typically sufficient.

For this specific workflow snippet, the flagged build-docs job only checks out code, runs cargo doc, and uploads artifacts. None of these actions require write access to repository contents; they only require read access to pull the code. The safest minimal fix, without changing existing functionality, is to add a permissions block with contents: read to the build-docs job. The deploy-docs job already has an explicit permissions block, so it does not need changes. Other jobs (e.g., fmt, kani, build-stm32-l4r5zi-def, and presumably test/container) might also warrant explicit permissions in a broader hardening pass, but CodeQL’s reported issue is for build-docs, so we will scope the change there.

Concretely, in .github/workflows/ci.yml, under the build-docs: job (after runs-on / needs or before container), add:

    permissions:
      contents: read

No imports or other definitions are needed, since this is pure workflow YAML.

Suggested changeset 1
.github/workflows/ci.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -138,6 +138,8 @@
     name: Build the documentation
     runs-on: ubuntu-latest
     needs: [container]
+    permissions:
+      contents: read
     container:
       image: ${{ needs.container.outputs.container_name }}
     steps:
EOF
@@ -138,6 +138,8 @@
name: Build the documentation
runs-on: ubuntu-latest
needs: [container]
permissions:
contents: read
container:
image: ${{ needs.container.outputs.container_name }}
steps:
Copilot is powered by AI and may make mistakes. Always verify output.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants