Skip to content

Commit fa99d7a

Browse files
committed
0033805: Configuration - Implement GitHub Actions build scripts
Build Scripts: - Linux GCC x64 dynamic - Linux Clang x64 dynamic - Windows MSVC x64 dynamic - macOS Clang x64 dynamic Security scanning: - CodeQL security scanning - MSVC code scanning
1 parent b332761 commit fa99d7a

6 files changed

+296
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# This workflow will build OCCT on Ubuntu with Clang compiler
2+
# using the provided Docker image with Clang tools.
3+
#
4+
# Notes:
5+
# freetype is disabled
6+
# samples are not built
7+
8+
name: Build OCCT on Linux with Clang x64 dynamic
9+
10+
on:
11+
pull_request:
12+
branches:
13+
- '**'
14+
15+
jobs:
16+
build-linux-clang:
17+
name: Build on Ubuntu with Clang
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/[email protected]
23+
24+
- name: Install dependencies
25+
run: sudo apt-get update && sudo apt-get install -y tcl-dev tk-dev cmake clang make libbtbb-dev libx11-dev libglu1-mesa-dev
26+
27+
- name: Configure OCCT
28+
run: |
29+
mkdir -p build
30+
cd build
31+
cmake -G "Unix Makefiles" \
32+
-D CMAKE_C_COMPILER=clang \
33+
-D CMAKE_CXX_COMPILER=clang++ \
34+
-D USE_FREETYPE=OFF \
35+
-D CMAKE_BUILD_TYPE=Release ..
36+
37+
- name: Build OCCT
38+
run: |
39+
cd build
40+
make -j$(nproc)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# This workflow will build OCCT on Linux with GCC x64 dynamic
2+
# using the provided Docker image with GCC tools.
3+
#
4+
# Notes:
5+
# freetype is disabled
6+
# samples are not built
7+
8+
name: Build OCCT on Linux with GCC x64 dynamic
9+
10+
on:
11+
pull_request:
12+
branches:
13+
- '**'
14+
15+
jobs:
16+
build-linux-gcc:
17+
name: Build on Ubuntu with GCC
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/[email protected]
23+
24+
- name: Install dependencies
25+
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
26+
27+
- name: Configure OCCT
28+
run: |
29+
mkdir -p build
30+
cd build
31+
cmake -G "Unix Makefiles" \
32+
-D CMAKE_C_COMPILER=gcc \
33+
-D CMAKE_CXX_COMPILER=g++ \
34+
-D USE_FREETYPE=OFF \
35+
-D CMAKE_BUILD_TYPE=Release ..
36+
37+
- name: Build OCCT
38+
run: |
39+
cd build
40+
make -j$(nproc)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# This workflow builds OCCT on macOS with Clang x64 dynamic.
2+
#
3+
# Notes:
4+
# freetype is disabled
5+
# samples are not built
6+
7+
name: Build OCCT on macOS with Clang x64 dynamic
8+
9+
on:
10+
pull_request:
11+
branches:
12+
- '**'
13+
14+
jobs:
15+
build-macos-clang:
16+
name: Build on macOS with Clang
17+
runs-on: macos-latest
18+
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/[email protected]
22+
23+
- name: Install dependencies
24+
run: |
25+
brew update
26+
brew install tcl-tk tbb gl2ps xerces-c \
27+
libxmu libxi libxft libxpm \
28+
glew
29+
30+
- name: Configure OCCT
31+
run: |
32+
mkdir -p build
33+
cd build
34+
cmake -G "Unix Makefiles" \
35+
-D CMAKE_C_COMPILER=clang \
36+
-D CMAKE_CXX_COMPILER=clang++ \
37+
-D USE_FREETYPE=OFF \
38+
-D CMAKE_BUILD_TYPE=Release ..
39+
40+
- name: Build OCCT
41+
run: |
42+
cd build
43+
make -j$(sysctl -n hw.logicalcpu)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# This workflow will build OCCT on Windows with MSVC x64 in dynamic mode
2+
# using the provided Docker image with MSVC tools.
3+
#
4+
# Notes:
5+
# freetype is disabled
6+
# Draw module is disabled
7+
# samples are not built
8+
9+
name: Build OCCT on Windows with MSVC x64 dynamic
10+
11+
on:
12+
pull_request:
13+
branches:
14+
- '**'
15+
16+
jobs:
17+
build-windows-msvc:
18+
name: Build on Windows with MSVC
19+
runs-on: windows-latest
20+
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/[email protected]
24+
25+
- name: Set up MSVC
26+
uses: ilammy/[email protected]
27+
with:
28+
arch: x64
29+
30+
- name: Install dependencies
31+
run: |
32+
choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System' -y
33+
choco install magicsplat-tcl-tk -y
34+
35+
- name: Configure OCCT
36+
run: |
37+
mkdir build
38+
cd build
39+
cmake -T host=x64 -D USE_FREETYPE=OFF -D BUILD_MODULE_Draw=OFF -D CMAKE_BUILD_TYPE=Release ..
40+
41+
- name: Build OCCT
42+
run: |
43+
cd build
44+
cmake --build . --config Release -- /m

.github/workflows/codemsvc.yml

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Security scanning with Microsoft C++ Code Analysis.
2+
# Checks any master integration and publish warnings into security GitHub tab.
3+
#
4+
# Find more information at:
5+
# https://github.com/microsoft/msvc-code-analysis-action
6+
7+
name: Microsoft C++ Code Analysis
8+
9+
on:
10+
push:
11+
branches:
12+
- 'master'
13+
14+
env:
15+
# Path to the CMake build directory.
16+
build: '${{ github.workspace }}/build'
17+
config: 'Debug'
18+
19+
permissions:
20+
contents: read
21+
22+
jobs:
23+
analyze:
24+
permissions:
25+
contents: read # for actions/checkout to fetch code
26+
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
27+
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
28+
name: Analyze
29+
runs-on: windows-latest
30+
31+
steps:
32+
- name: Checkout repository
33+
uses: actions/[email protected]
34+
35+
- name: Install dependencies
36+
run: |
37+
choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System' -y
38+
choco install magicsplat-tcl-tk -y
39+
40+
- name: Configure CMake
41+
run: |
42+
mkdir build
43+
cd build
44+
cmake -D USE_FREETYPE=OFF -DCMAKE_BUILD_TYPE=${{ env.config }} ..
45+
46+
- name: Run MSVC Code Analysis
47+
uses: microsoft/[email protected]
48+
# Provide a unique ID to access the sarif output path
49+
id: run-analysis
50+
with:
51+
cmakeBuildDirectory: ${{ env.build }}
52+
buildConfiguration: ${{ env.config }}
53+
# Ruleset file that will determine what checks will be run
54+
ruleset: NativeRecommendedRules.ruleset
55+
# Paths to ignore analysis of CMake targets and includes
56+
# ignoredPaths: ${{ github.workspace }}/dependencies;${{ github.workspace }}/test
57+
58+
# Upload SARIF file to GitHub Code Scanning Alerts
59+
#- name: Upload SARIF to GitHub
60+
# uses: github/codeql-action/[email protected]
61+
# with:
62+
# sarif_file: ${{ steps.run-analysis.outputs.sarif }}
63+
64+
# Upload SARIF file as an Artifact to download and view
65+
- name: Upload SARIF as an Artifact
66+
uses: actions/[email protected]
67+
with:
68+
name: sarif-file
69+
path: ${{ steps.run-analysis.outputs.sarif }}

.github/workflows/codeql.yml

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Security scanning with CodeQL.
2+
# Checks any master integration and publish warnings into security GitHub tab.
3+
#
4+
# Find more information at:
5+
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/about-code-scanning
6+
7+
name: CodeQL Code Analysis
8+
9+
on:
10+
push:
11+
branches:
12+
- 'master'
13+
14+
jobs:
15+
analyze:
16+
name: Analyze (${{ matrix.language }})
17+
runs-on: ${{ 'ubuntu-latest' }}
18+
permissions:
19+
# required for all workflows
20+
security-events: write
21+
22+
# required to fetch internal or private CodeQL packs
23+
packages: read
24+
25+
strategy:
26+
fail-fast: false
27+
matrix:
28+
include:
29+
- language: c-cpp
30+
build-mode: manual
31+
steps:
32+
- name: Checkout repository
33+
uses: actions/[email protected]
34+
35+
- name: Install dependencies
36+
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
37+
38+
# Initializes the CodeQL tools for scanning.
39+
- name: Initialize CodeQL
40+
uses: github/codeql-action/[email protected]
41+
with:
42+
languages: ${{ matrix.language }}
43+
build-mode: ${{ matrix.build-mode }}
44+
45+
- if: matrix.build-mode == 'manual'
46+
shell: bash
47+
run: |
48+
mkdir -p build
49+
cd build
50+
cmake -G "Unix Makefiles" \
51+
-D CMAKE_C_COMPILER=gcc \
52+
-D CMAKE_CXX_COMPILER=g++ \
53+
-D USE_FREETYPE=OFF \
54+
-D CMAKE_BUILD_TYPE=Release ..
55+
make -j$(nproc)
56+
57+
- name: Perform CodeQL Analysis
58+
uses: github/codeql-action/[email protected]
59+
with:
60+
category: "/language:${{matrix.language}}"

0 commit comments

Comments
 (0)