Skip to content

Commit

Permalink
CI: Automatically build and deploy documentation and code coverage re…
Browse files Browse the repository at this point in the history
…port
  • Loading branch information
Pagghiu committed Apr 17, 2024
1 parent 7713ea8 commit 2f66257
Showing 1 changed file with 76 additions and 0 deletions.
76 changes: 76 additions & 0 deletions .github/workflows/documentation_coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Simple workflow for deploying static content to GitHub Pages
name: Documentation and Code Coverage

on:
# Runs on pushes targeting main and development branch
push:
branches: ["main", "development"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

env:
CC: clang
CXX: clang++

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
# Build job
build:
# TODO: To use Linux we should figure out how to install libclang-9 for Doxygen 1.9.6 to work
runs-on: macos-latest
timeout-minutes: 6
steps:
- uses: actions/checkout@v4
- name: clang-format
run: ./SC.sh format check
- name: build documentation
run: ./SC.sh build documentation
- name: configure
run: ./SC.sh build configure
- name: compile
run: ./SC.sh build compile DebugCoverage
- name: coverage
run: ./SC.sh build coverage DebugCoverage
- name: move coverage to documentation
run: mv _Build/_Coverage/coverage _Build/_Documentation/docs
- name: fix documentation permissions
run: chmod -v -R +rX "_Build/_Documentation/docs"
- name: Setup Pages
if: github.ref == 'refs/heads/main'
uses: actions/configure-pages@v4
- name: Upload Artifact
if: github.ref == 'refs/heads/main'
uses: actions/upload-pages-artifact@v3
with:
# location of the coverage artifacts
path: "_Build/_Documentation/docs"

deploy:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs: build

permissions:
pages: write
id-token: write

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

0 comments on commit 2f66257

Please sign in to comment.