Skip to content

Commit

Permalink
Tests - DRAWEXE Testing integration into GH #109
Browse files Browse the repository at this point in the history
Introduced a comprehensive multi-platform build and
  test workflow for OCCT, supporting Windows, macOS, and Linux.
Added a new workflow for automated documentation building.
Reorganized a code analysis workflow using CodeQL
  and Microsoft C++ Code Analysis.
  • Loading branch information
dpasukhi committed Oct 20, 2024
1 parent 674c246 commit 857b1b6
Show file tree
Hide file tree
Showing 10 changed files with 938 additions and 333 deletions.
796 changes: 796 additions & 0 deletions .github/workflows/build-and-test-multiplatform.yml

Large diffs are not rendered by default.

36 changes: 0 additions & 36 deletions .github/workflows/build-doc-refman.yml

This file was deleted.

45 changes: 45 additions & 0 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# This workflow builds the OCCT reference manual documentation.
# It is triggered on pushes to the 'master' branch.
# The workflow includes steps to checkout the repository, install dependencies, build the documentation, and upload the generated documentation and logs as artifacts.

name: Build Documentation

on:
push:
branches:
- 'master'

jobs:
build:
name: Build Refman Documentation
runs-on: ubuntu-24.04

steps:
# Step: Checkout the repository
- name: Checkout repository
uses: actions/checkout@v4.2.1

# Step: Install necessary dependencies for building the documentation
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y tcl-dev tk-dev cmake gcc g++ make libbtbb-dev libx11-dev libglu1-mesa-dev doxygen graphviz

# Step: Build the reference manual documentation
- name: Build documentation
run: bash gendoc -refman

# Step: Upload the generated reference manual documentation as an artifact
- name: Upload refman documentation
uses: actions/upload-artifact@v4.4.3
id: artifact-upload-step
with:
name: refman-doc
path: doc/refman
retention-days: 90

# Step: Upload the documentation generation log as an artifact
- name: Upload generation log
uses: actions/upload-artifact@v4.4.3
with:
name: doxygen.log
path: doc/html_doxygen_err.log
retention-days: 90
42 changes: 0 additions & 42 deletions .github/workflows/build-linux-clang-x64-dynamic.yml

This file was deleted.

44 changes: 0 additions & 44 deletions .github/workflows/build-linux-gcc-x64-dynamic.yml

This file was deleted.

45 changes: 0 additions & 45 deletions .github/workflows/build-macos-clang-x64-dynamic.yml

This file was deleted.

44 changes: 0 additions & 44 deletions .github/workflows/build-windows-msvc-x64-dynamic.yml

This file was deleted.

97 changes: 97 additions & 0 deletions .github/workflows/code-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# This workflow performs code analysis using both CodeQL and Microsoft C++ Code Analysis.
# It is triggered on pushes to the 'master' branch and publishes warnings into the security GitHub tab.
# The workflow includes two jobs: one for CodeQL analysis on Ubuntu and another for MSVC Code Analysis on Windows.

name: Code Analysis

on:
push:
branches:
- 'master'

permissions:
contents: read
security-events: write
packages: read

env:
# Path to the CMake build directory.
build: '${{ github.workspace }}/build'
config: 'Debug'

jobs:
codeql-analyze:
name: CodeQL Analyze (C/C++)
runs-on: ubuntu-latest

steps:
# Step: Checkout the repository
- name: Checkout repository
uses: actions/checkout@v4.1.7

# Step: Install necessary dependencies for building the project
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y tcl-dev tk-dev cmake gcc g++ make libbtbb-dev libx11-dev libglu1-mesa-dev

# Step: Initialize CodeQL for scanning
- name: Initialize CodeQL
uses: github/codeql-action/init@v3.26.5
with:
languages: c-cpp
build-mode: manual

# Step: Build the project using CMake and Make
- name: Build project
shell: bash
run: |
mkdir -p build
cd build
cmake -G "Unix Makefiles" \
-D CMAKE_C_COMPILER=gcc \
-D CMAKE_CXX_COMPILER=g++ \
-D USE_FREETYPE=OFF \
-D CMAKE_BUILD_TYPE=Release ..
make -j$(nproc)
# Step: Perform CodeQL Analysis
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3.26.5
with:
category: "/language:c-cpp"

msvc-analyze:
name: Microsoft C++ Code Analysis
runs-on: windows-latest

steps:
# Step: Checkout the repository
- name: Checkout repository
uses: actions/checkout@v4.1.7

# Step: Install necessary dependencies using Chocolatey
- name: Install dependencies
run: |
choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System' -y
choco install magicsplat-tcl-tk -y
# Step: Configure the project using CMake
- name: Configure CMake
run: |
mkdir build
cd build
cmake -D USE_FREETYPE=OFF -DCMAKE_BUILD_TYPE=${{ env.config }} ..
# Step: Run MSVC Code Analysis
- name: Run MSVC Code Analysis
uses: microsoft/msvc-code-analysis-action@v0.1.1
id: run-analysis
with:
cmakeBuildDirectory: ${{ env.build }}
buildConfiguration: ${{ env.config }}
ruleset: NativeRecommendedRules.ruleset

# Step: Upload SARIF file to GitHub Code Scanning Alerts
- name: Upload SARIF to GitHub
uses: github/codeql-action/upload-sarif@v3.26.5
with:
sarif_file: ${{ steps.run-analysis.outputs.sarif }}
Loading

0 comments on commit 857b1b6

Please sign in to comment.