Skip to content

Commit

Permalink
Caching dependencies for Windows (#12)
Browse files Browse the repository at this point in the history
* Pinned softprops/action-gh-release github action version 0.1.12

* change github token

* added windows builc ccake

* added windows build ccake

* change windows build strategy

* change windows build strategy

* change windows build strategy

* change windows build strategy

* change windows build strategy

* change windows build strategy

* kjgvv

* fixed msys build

* fixed buid

* removed windows build verbose

* fixed windows flow

* removed cmake verbose

* removed cmake verbose

* added j parameter for cmake build

* added cache for github action step

* added cache for github action step

* added cache for github action step

* determine patg

* fixed ccache path

* fixed new directory error
  • Loading branch information
ilkerhalil authored Feb 24, 2022
1 parent 80b4aa5 commit 26a5805
Showing 1 changed file with 29 additions and 54 deletions.
83 changes: 29 additions & 54 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,17 @@ jobs:
sudo apt-get update
sudo apt-get install -y tcl tk-dev build-essential libssl-dev libgl1-mesa-dev ninja-build
mkdir build
# - name: Config CMake
# run: |
# mkdir build
# #cmake -E make_directory build
# #cmake . -DCMAKE_BUILD_TYPE=Release -DUSE_FREEIMAGE:BOOL=OFF -DUSE_RAPIDJSON:BOOL=OFF -DUSE_TBB:BOOL=OFF -DUSE_VTK:BOOL=OFF -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -GNinja
- name: build with cmake
uses: lukka/run-cmake@v3
with:
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt'
cmakeAppendedArgs: '-DCMAKE_BUILD_TYPE=Release -DUSE_FREEIMAGE:BOOL=OFF -DUSE_RAPIDJSON:BOOL=OFF -DUSE_TBB:BOOL=OFF -DUSE_VTK:BOOL=OFF -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -GNinja'
cmakeAppendedArgs: '-DCMAKE_BUILD_TYPE=Release -DUSE_FREEIMAGE:BOOL=OFF -DUSE_RAPIDJSON:BOOL=OFF -DUSE_TBB:BOOL=OFF -DUSE_VTK:BOOL=OFF -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -GNinja'
buildDirectory: '${{ github.workspace }}/build'
buildWithCMake: true

- name: Test OCCT
working-directory: ${{github.workspace}}/build
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C Release

- uses: actions/upload-artifact@v2
Expand Down Expand Up @@ -82,7 +75,11 @@ jobs:
- name: Install Doxygen
run: |
choco install doxygen.install
- uses: actions/cache@v2
with:
path: |
${{github.workspace}}\3rdparty\
key: ${{ runner.os }}-cache-3rdparty-${{ hashFiles('./3rdparty') }}
- name: Get Tcl Source
uses: actions/checkout@v2
with:
Expand All @@ -104,7 +101,7 @@ jobs:
run: |
Copy-Item -Path ${{github.workspace}}/StirlingLabs/tcl/win/* -Destination 3rdparty/tcl/win -force
Copy-Item -Path ${{github.workspace}}/StirlingLabs/tk/win/* -Destination 3rdparty/tk/win -force
New-Item -Path ${{github.workspace}}/3rdparty -Name tcltk -ItemType "directory"
New-Item -ErrorAction Ignore -Path ${{github.workspace}}/3rdparty -Name tcltk -ItemType "directory"
- name: Build & Install Tcl
run: |
Expand Down Expand Up @@ -139,60 +136,40 @@ jobs:
working-directory: ${{github.workspace}}/3rdparty/tcltk/lib

- name: Create OCCT Build Environment
# Create a separate build directory
# We'll use this as our working directory for all subsequent commands
run: cmake -E make_directory ${{github.workspace}}/build
run: mkdir build

- name: Configure OCCT CMake
# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system
shell: powershell
#working-directory: ${{github.workspace}}/build
# Note the current convention is to use the -S and -B options here to specify source
# and build directories, but this is only available with CMake 3.13 and higher.
# The CMake binaries on the Github Actions machines are (as of this writing) 3.12
run: >
cmake D:\a\OCCT\OCCT
-DCMAKE_BUILD_TYPE=$BUILD_TYPE
-DUSE_FREEIMAGE:BOOL=OFF
-DUSE_RAPIDJSON:BOOL=OFF
-DUSE_TBB:BOOL=OFF
-DUSE_VTK:BOOL=OFF
-D3RDPARTY_DIR=D:\a\OCCT\OCCT\3rdparty
-D3RDPARTY_FREETYPE_DIR=D:\a\OCCT\OCCT\3rdparty\freetype
-D3RDPARTY_FREETYPE_INCLUDE_DIR=D:\a\OCCT\OCCT\3rdparty\freetype\include
-D3RDPARTY_FREETYPE_LIBRARY_DIR=D:\a\OCCT\OCCT\3rdparty\freetype\bin
-D3RDPARTY_FREETYPE_DLL_DIR=D:\a\OCCT\OCCT\3rdparty\freetype\bin
-D3RDPARTY_TCL_INCLUDE_DIR=D:\a\OCCT\OCCT\3rdparty\tcltk\bin
-D3RDPARTY_TCL_LIBRARY_DIR=D:\a\OCCT\OCCT\3rdparty\tcltk\lib
-D3RDPARTY_TCL_DLL_DIR=D:\a\OCCT\OCCT\3rdparty\tcltk\bin
-D3RDPARTY_TK_INCLUDE_DIR=D:\a\OCCT\OCCT\3rdparty\tcltk\bin
-D3RDPARTY_TK_LIBRARY_DIR=D:\a\OCCT\OCCT\3rdparty\tcltk\lib
-D3RDPARTY_TK_DLL_DIR=D:\a\OCCT\OCCT\3rdparty\tcltk\bin
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON
env:
GITHUB_WORKSPACE: ${{github.workspace}}
- name: Add Path Msys64 Directory
run: |
echo "c:\msys64" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Install ccache
shell: msys2_shell.cmd -defterm -no-start -here -mingw64 {0}
run: |
pacman -S --noconfirm mingw-w64-x86_64-ccache
- name: Configure OCCT CMake
shell: msys2_shell.cmd -defterm -no-start -here -mingw64 {0}
run: |
${MINGW_PREFIX}/bin/cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DUSE_FREEIMAGE:BOOL=OFF -DUSE_RAPIDJSON:BOOL=OFF -DUSE_TBB:BOOL=OFF -DUSE_VTK:BOOL=OFF -D3RDPARTY_DIR=/D/a/OCCT/OCCT/3rdparty -D3RDPARTY_FREETYPE_DIR=/D/a/OCCT/OCCT/3rdparty/freetype -D3RDPARTY_FREETYPE_INCLUDE_DIR=/D/a/OCCT/OCCT/3rdparty/freetype/include -D3RDPARTY_FREETYPE_LIBRARY_DIR=/D/a/OCCT/OCCT/3rdparty/freetype/bin -D3RDPARTY_FREETYPE_DLL_DIR=/D/a/OCCT/OCCT/3rdparty/freetype/bin -D3RDPARTY_TCL_INCLUDE_DIR=/D/a/OCCT/OCCT/3rdparty/tcltk/bin -D3RDPARTY_TCL_LIBRARY_DIR=/D/a/OCCT/OCCT/3rdparty/tcltk/lib -D3RDPARTY_TCL_DLL_DIR=/D/a/OCCT/OCCT/3rdparty/tcltk/bin -D3RDPARTY_TK_INCLUDE_DIR=/D/a/OCCT/OCCT/3rdparty/tcltk/bin -D3RDPARTY_TK_LIBRARY_DIR=/D/a/OCCT/OCCT/3rdparty/tcltk/lib -D3RDPARTY_TK_DLL_DIR=/D/a/OCCT/OCCT/3rdparty/tcltk/bin -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
- uses: actions/cache@v2
with:
path: |
c:\msys64\home\runneradmin\
key: ${{ runner.os }}-cache-ccache
- name: Build OCCT
#working-directory: ${{github.workspace}}/build
shell: bash
# Execute the build. You can specify a specific target with "--target <NAME>"
run: cmake --build . --config Release -j14
shell: msys2_shell.cmd -defterm -no-start -here -mingw64 {0}
run: cmake --build . --config Release -j4

- name: Test OCCT
working-directory: ${{github.workspace}}/build
shell: bash
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
shell: msys2_shell.cmd -defterm -no-start -here -mingw64 {0}
run: ctest -C Release

- uses: actions/upload-artifact@v2
name: occt-win
with:
name: occt-win
path: |
win64/vc14/
win64\gcc
if-no-files-found: error

osx:
Expand All @@ -205,16 +182,14 @@ jobs:
run: |
brew install ninja
mkdir build
# cmake -E make_directory build
# cmake . -DCMAKE_BUILD_TYPE=Release -DUSE_FREEIMAGE:BOOL=OFF -DUSE_RAPIDJSON:BOOL=OFF -DUSE_TBB:BOOL=OFF -DUSE_VTK:BOOL=OFF -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -GNinja
- name: ccache
uses: hendrikmuhs/ccache-action@v1
- name: build with cmake
uses: lukka/run-cmake@v3
with:
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt'
cmakeAppendedArgs: '-DCMAKE_BUILD_TYPE=Release -DUSE_FREEIMAGE:BOOL=OFF -DUSE_RAPIDJSON:BOOL=OFF -DUSE_TBB:BOOL=OFF -DUSE_VTK:BOOL=OFF -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -GNinja'
cmakeAppendedArgs: '-DCMAKE_BUILD_TYPE=Release -DUSE_FREEIMAGE:BOOL=OFF -DUSE_RAPIDJSON:BOOL=OFF -DUSE_TBB:BOOL=OFF -DUSE_VTK:BOOL=OFF -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -GNinja'
buildDirectory: '${{ github.workspace }}/build'
buildWithCMake: true
- uses: actions/upload-artifact@v2
Expand Down

0 comments on commit 26a5805

Please sign in to comment.