Skip to content

Commit

Permalink
Refactor CSharp, MFC, and Qt sample build actions to streamline envir…
Browse files Browse the repository at this point in the history
…onment setup and improve build process
  • Loading branch information
dpasukhi committed Feb 2, 2025
1 parent 54633c3 commit 342bb50
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 47 deletions.
7 changes: 2 additions & 5 deletions .github/actions/build-sample-csharp/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,14 @@ runs:
name: ${{ inputs.install-artifact-name }}
path: occt-install

- name: Setup MSBuild
if: inputs.platform == 'windows'
uses: microsoft/setup-msbuild@v2

- name: Build CSharp Sample
if: inputs.platform == 'windows'
shell: cmd
run: |
REM Setup environment
call "${{ github.workspace }}\occt-install\env.bat" vc14 win64 Release
call "%VCVARS%" x64
cd ${{ github.workspace }}/samples/CSharp
set "PATH=%DevEnvDir%;%PATH%"
Expand Down
5 changes: 1 addition & 4 deletions .github/actions/build-sample-mfc/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,13 @@ runs:
name: ${{ inputs.install-artifact-name }}
path: occt-install

- name: Setup MSBuild
if: inputs.platform == 'windows'
uses: microsoft/setup-msbuild@v2

- name: Build MFC Sample
if: inputs.platform == 'windows'
shell: cmd
run: |
REM Setup environment
call "${{ github.workspace }}\occt-install\env.bat" vc14 win64 Release
call "%VCVARS%" x64
cd ${{ github.workspace }}/samples/mfc/standard
set "PATH=%DevEnvDir%;%PATH%"
Expand Down
55 changes: 17 additions & 38 deletions .github/actions/build-sample-qt/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,58 +45,37 @@ runs:
run: |
REM Setup environment
call "${{ github.workspace }}\occt-install\env.bat" vc14 win64 Release
call "%VCVARS%" x64
REM Setup Qt environment
set "QTDIR=${{ github.workspace }}\3rdparty-vc14-64\qt5.11.2-vc14-64"
set "PATH=%QTDIR%\bin;%DevEnvDir%;%PATH%"
cd ${{ github.workspace }}/samples/qt
REM Build IESample
cd IESample
qmake
devenv.exe IESample.sln /upgrade
devenv.exe IESample.sln /build "Release|x64"
cd ..
REM Build Tutorial
cd Tutorial
qmake
devenv.exe Tutorial.sln /upgrade
devenv.exe Tutorial.sln /build "Release|x64"
cd ..
REM Build FuncDemo
cd FuncDemo
qmake
devenv.exe FuncDemo.sln /upgrade
devenv.exe FuncDemo.sln /build "Release|x64"
cd ..
for %%s in (IESample Tutorial FuncDemo) do (
cd %%s
qmake
devenv.exe %%s.sln /upgrade
devenv.exe %%s.sln /build "Release|x64"
cd ..
)
- name: Build Qt Samples - Linux
if: inputs.platform == 'linux'
shell: bash
run: |
source ${{ github.workspace }}/occt-install/bin/env.sh
cd ${{ github.workspace }}/samples/qt
# Build IESample
cd IESample
qmake
make -j$(nproc)
cd ..
# Build Tutorial
cd Tutorial
qmake
make -j$(nproc)
cd ..
# Build FuncDemo
cd FuncDemo
qmake
make -j$(nproc)
cd ..
for sample in IESample Tutorial FuncDemo; do
cd $sample
echo "#!/bin/bash" > custom.sh
echo "export QTDIR=/usr" >> custom.sh
chmod +x make.sh
./make.sh
cd ..
done
- name: Upload Qt Samples
uses: actions/[email protected]
Expand Down

0 comments on commit 342bb50

Please sign in to comment.