| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| | |
| | |
| |
|
| | name: Build Windows |
| | on: |
| | workflow_call: |
| | inputs: |
| | artifactBasename: |
| | type: string |
| | required: true |
| | allowedToFail: |
| | default: false |
| | type: boolean |
| | required: false |
| | outputs: |
| | reportFile: |
| | value: ${{ jobs.Build.outputs.reportFile }} |
| |
|
| | jobs: |
| | Build: |
| | runs-on: windows-latest |
| | continue-on-error: ${{ inputs.allowedToFail }} |
| | env: |
| | CCACHE_COMPILERCHECK: "%compiler%" |
| | CCACHE_COMPRESS: true |
| | CCACHE_COMPRESSLEVEL: 5 |
| | CCACHE_DIR: C:/FC/cache/ |
| | CCACHE_LOGFILE: C:/logs/ccache.log |
| | CCACHE_MAXSIZE: 1G |
| | CCACHE_NODIRECT: true |
| | CCACHE_NOHASHDIR: true |
| | CCACHE_NOINODECACHE: true |
| | CCACHE_SLOPPINESS: "include_file_ctime,include_file_mtime,pch_defines,time_macros" |
| | |
| | builddir: C:/FC/build/release/ |
| | cacheKey: Windows |
| | ccachebindir: C:/FC/ccache/ |
| | config: release |
| | libpackdir: C:/FC/libpack/ |
| | logdir: C:/logs/ |
| | reportdir: C:/report/ |
| | reportfilename: ${{ inputs.artifactBasename }}-report.md |
| | outputs: |
| | reportFile: ${{ steps.Init.outputs.reportFile }} |
| |
|
| | steps: |
| | - name: Harden the runner (Audit all outbound calls) |
| | uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 |
| | with: |
| | egress-policy: audit |
| |
|
| | - name: Checking out source code |
| | uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 |
| | with: |
| | submodules: true |
| |
|
| | - name: Make needed directories, files and initializations |
| | id: Init |
| | run: | |
| | mkdir ${{ env.CCACHE_DIR }} |
| | mkdir ${{ env.ccachebindir }} |
| | mkdir ${{ env.libpackdir }} |
| | mkdir ${{ env.builddir }} |
| | mkdir ${{ env.logdir }} |
| | mkdir ${{ env.reportdir }} |
| | echo "reportFile=${{ env.reportfilename }}" >> $GITHUB_OUTPUT |
| | |
| | - name: Get Ccache |
| | uses: ./.github/workflows/actions/windows/getCcache |
| | with: |
| | ccachebindir: ${{ env.ccachebindir }} |
| |
|
| | - name: Get Libpack |
| | uses: ./.github/workflows/actions/windows/getLibpack |
| | with: |
| | libpackdir: ${{ env.libpackdir }} |
| |
|
| | - name: Restore compiler cache |
| | id: cache-restore |
| | if: always() |
| | uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 |
| | with: |
| | path: ${{ env.CCACHE_DIR }} |
| | key: FC-${{ env.cacheKey }}-${{ github.ref }}-${{ github.run_id }} |
| | restore-keys: | |
| | FC-${{ env.cacheKey }}-${{ github.ref }}- |
| | FC-${{ env.cacheKey }}- |
| | |
| | - name: Print Ccache statistics before build, reset stats and print config |
| | run: | |
| | . $env:ccachebindir\ccache -s |
| | . $env:ccachebindir\ccache -z |
| | . $env:ccachebindir\ccache -p |
| | |
| | - name: Install cmake |
| | uses: jwlawson/actions-setup-cmake@802fa1a2c4e212495c05bf94dba2704a92a472be |
| | with: |
| | cmake-version: '3.31.6' |
| |
|
| | - name: Configuring CMake |
| | run: > |
| | cmake -B"${{ env.builddir }}" . |
| | --preset ${{ env.config }} |
| | -DCMAKE_VS_NO_COMPILE_BATCHING=ON |
| | -DCMAKE_BUILD_TYPE=Release |
| | -DFREECAD_USE_PCH=OFF |
| | -DFREECAD_RELEASE_PDB=OFF |
| | -DFREECAD_LIBPACK_DIR="${{ env.libpackdir }}" |
| | -DFREECAD_COPY_DEPEND_DIRS_TO_BUILD=ON |
| | -DFREECAD_COPY_LIBPACK_BIN_TO_BUILD=ON |
| | -DFREECAD_COPY_PLUGINS_BIN_TO_BUILD=ON |
| | |
| | - name: Add msbuild to PATH |
| | uses: microsoft/setup-msbuild@6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce |
| |
|
| | - name: Compiling sources |
| | run: | |
| | cd $env:builddir |
| | msbuild ALL_BUILD.vcxproj /m /p:Configuration=Release /p:TrackFileAccess=false /p:CLToolPath=${{ env.ccachebindir }} |
| | |
| | - name: Print Ccache statistics after build |
| | if: always() |
| | run: | |
| | . $env:ccachebindir\ccache -s |
| | |
| | - name: C++ unit tests |
| | if: false |
| | timeout-minutes: 1 |
| | run: | |
| | . ${{ env.builddir }}\tests\Release\Tests_run --gtest_output=json:${{ env.reportdir }}gtest_results.json # 2>&1 | tee -filepath ${{ env.logdir }}\unitTests.log |
| | |
| | - name: FreeCAD CLI tests |
| | run: | |
| | . ${{ env.builddir }}\bin\FreeCADCmd -t 0 # 2>&1 | tee -filepath ${{ env.logdir }}\integrationTests.log |
| | |
| | - name: Save Compiler Cache |
| | id: cache-save |
| | if: always() |
| | uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 |
| | with: |
| | path: ${{ env.CCACHE_DIR }} |
| | key: FC-${{ env.cacheKey }}-${{ github.ref }}-${{ github.run_id }} |
| |
|
| | - name: Upload logs |
| | if: always() |
| | uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 |
| | with: |
| | name: ${{ inputs.artifactBasename }}-Logs |
| | path: | |
| | ${{ env.logdir }} |
| | |