Skip to content

Project page and reports deploy #56

Project page and reports deploy

Project page and reports deploy #56

# Sample workflow for building and deploying a Jekyll site to GitHub Pages
name: Project page and reports deploy
on:
# Runs on pushes targeting the default branch
# push:
# branches: ["feature/github_CI_CD_Workflow"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# 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:
runs-on: ubuntu-latest
# container: niwciu/stm32_dev_container:latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Ninja
uses: seanmiddleditch/gha-setup-ninja@v3
- name: Create Reports Folders
run: |
mkdir -p reports/Cyclomatic_Complexity/PUSHBUTTON
mkdir -p reports/Cyclomatic_Complexity/SWITCH
mkdir -p reports/Code_Coverage/PUSHBUTTON
mkdir -p reports/Code_Coverage/SWITCH
- name: Run Lizard for PUSHBUTTON
uses: niwciu/Lizard-Runner@main
with:
path: "./src/PUSHBUTTON"
CCN: "12"
Threshold: "nloc=30"
language: "cpp"
verbose: "true"
arguments: "4"
output_file: "./reports/Cyclomatic_Complexity/PUSHBUTTON/Lizard_report.html"
- name: Build pushbutton binary
working-directory: test/pushbutton
run: |
mkdir out
cmake -Bout -GNinja
cmake --build out
- name: Run pushbutton tests
working-directory: test/pushbutton/out
run: ./pushbutton_test -v
- name: Generate Code Coverage Report
uses: niwciu/gcovr-action@main
with:
html-out: ./reports/Code_Coverage/PUSHBUTTON/pushbutton_gcov_report.html
html-theme: github.dark-green
- name: Build swtich binary
working-directory: test/switch
run: |
mkdir out
cmake -Bout -GNinja
cmake --build out
- name: Run switch tests
working-directory: test/switch/out
run: ./switch_test -v
- name: Generate Code Coverage Report
uses: niwciu/gcovr-action@main
with:
html-out: ./reports/Code_Coverage/SWITCH/switch_gcov_report.html
html-theme: github.dark-green
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Build with Jekyll
uses: actions/jekyll-build-pages@v1
with:
source: ./
destination: ./_site
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
cleanup:
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: 🗑 Delete deployment
uses: strumwolf/delete-deployment-environment@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
environment: github-pages
onlyRemoveDeployments: true
# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: [build, cleanup]
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4