| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| |
| |
|
|
| name: Build Ubuntu 24.04 |
|
|
| on: |
| workflow_call: |
| inputs: |
| artifactBasename: |
| type: string |
| required: true |
| testOnBuildDir: |
| default: false |
| type: boolean |
| required: false |
| allowedToFail: |
| default: false |
| type: boolean |
| required: false |
| outputs: |
| reportFile: |
| value: ${{ jobs.Build.outputs.reportFile }} |
|
|
| jobs: |
|
|
| Build: |
| runs-on: ubuntu-24.04 |
| continue-on-error: ${{ inputs.allowedToFail }} |
| env: |
| CCACHE_COMPILERCHECK: "%compiler% -dumpfullversion -dumpversion" |
| CCACHE_COMPRESS: true |
| CCACHE_COMPRESSLEVEL: 5 |
| CCACHE_CONFIGPATH: ${{ github.workspace }}/ccache/config |
| CCACHE_DIR: ${{ github.workspace }}/ccache |
| CCACHE_MAXSIZE: 1G |
| CCACHE_NODIRECT: true |
| CCACHE_NOHASHDIR: true |
| CCACHE_NOINODECACHE: true |
| CCACHE_SLOPPINESS: "include_file_ctime,include_file_mtime,pch_defines,time_macros" |
| CC: /usr/bin/gcc |
| CXX: /usr/bin/g++ |
| |
| |
| builddir: ${{ github.workspace }}/build/release/ |
| config: release |
| logdir: /tmp/logs/ |
| reportdir: /tmp/report/ |
| reportfilename: ${{ inputs.artifactBasename }}-report.md |
| defaults: |
| run: |
| shell: bash |
| 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: Install FreeCAD dependencies |
| run: ./package/ubuntu/install-apt-packages.sh |
|
|
| - name: Install FreeCAD Python test dependencies |
| run: | |
| sudo apt-get update -y -qq |
| sudo apt-get install -y -qq python3-pip |
| python3 -m pip install --upgrade pip |
| python3 -m pip install ifcopenshell==0.8.2 --break-system-packages |
| |
| - name: Make needed directories, files and initializations |
| id: Init |
| run: | |
| mkdir -p ${{ env.CCACHE_DIR }} |
| mkdir -p ${{ env.CCACHE_CONFIGPATH }} |
| mkdir -p ${{ env.builddir }} |
| mkdir -p ${{ env.logdir }} |
| mkdir -p ${{ env.reportdir }} |
| echo "reportFile=${{ env.reportfilename }}" >> $GITHUB_OUTPUT |
| |
| - name: Generate cache key |
| id: genCacheKey |
| uses: ./.github/workflows/actions/linux/generateCacheKey |
| with: |
| compiler: ${{ env.CXX }} |
| qt_major_version: 5 |
|
|
| - name: Restore Compiler Cache |
| id: cache-restore |
| if: always() |
| uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 |
| with: |
| path: ${{ env.CCACHE_DIR }} |
| key: FC-${{ steps.genCacheKey.outputs.cacheKey }}-${{ github.ref }}-${{ github.run_id }} |
| restore-keys: | |
| FC-${{ steps.genCacheKey.outputs.cacheKey }}-${{ github.ref }}- |
| FC-${{ steps.genCacheKey.outputs.cacheKey }}- |
| |
| - name: Print CCache statistics before build, reset stats and print config |
| run: | |
| ccache -s |
| ccache -z |
| ccache -p |
| |
| - name: Install cmake |
| uses: jwlawson/actions-setup-cmake@802fa1a2c4e212495c05bf94dba2704a92a472be |
| with: |
| cmake-version: '3.31.6' |
|
|
| - name: CMake Configure |
| uses: ./.github/workflows/actions/linux/configure |
| with: |
| extraParameters: -G Ninja --preset ${{ env.config }} |
| builddir: ${{ env.builddir }} |
| logFile: ${{ env.logdir }}Cmake.log |
| errorFile: ${{ env.logdir }}CmakeErrors.log |
| reportFile: ${{env.reportdir}}${{ env.reportfilename }} |
|
|
| - name: CMake Build |
| uses: ./.github/workflows/actions/linux/build |
| with: |
| builddir: ${{ env.builddir }} |
| logFile: ${{ env.logdir }}Build.log |
| errorFile: ${{ env.logdir }}BuildErrors.log |
| reportFile: ${{env.reportdir}}${{ env.reportfilename }} |
|
|
| - name: Print ccache statistics after Build |
| if: always() |
| run: | |
| ccache -s |
| |
| - name: FreeCAD CLI tests on build dir |
| if: inputs.testOnBuildDir |
| timeout-minutes: 10 |
| uses: ./.github/workflows/actions/runPythonTests |
| with: |
| testDescription: "CLI tests on build dir" |
| testCommand: ${{ env.builddir }}/bin/FreeCADCmd -t 0 |
| logFile: ${{ env.logdir }}TestCLIBuild.log |
| reportFile: ${{env.reportdir}}${{ env.reportfilename }} |
|
|
| - name: FreeCAD GUI tests on build dir |
| if: inputs.testOnBuildDir |
| timeout-minutes: 15 |
| uses: ./.github/workflows/actions/runPythonTests |
| with: |
| testDescription: "GUI tests on build dir" |
| |
| testCommand: xvfb-run python3 ./.github/scripts/run_gui_tests.py "${{ env.builddir }}" |
| logFile: ${{ env.logdir }}TestGUIBuild.log |
| reportFile: ${{env.reportdir}}${{ env.reportfilename }} |
|
|
| - name: C++ tests |
| timeout-minutes: 1 |
| uses: ./.github/workflows/actions/runCPPTests/runAllTests |
| with: |
| reportdir: ${{ env.reportdir }} |
| builddir: ${{ env.builddir }} |
| reportFile: ${{ env.reportdir }}${{ env.reportfilename }} |
|
|
| - name: CMake Install |
| uses: ./.github/workflows/actions/linux/install |
| with: |
| builddir: ${{ env.builddir }} |
| logFile: ${{ env.logdir }}Install.log |
| errorFile: ${{ env.logdir }}InstallErrors.log |
| reportFile: ${{env.reportdir}}${{ env.reportfilename }} |
|
|
| - name: FreeCAD CLI tests on install |
| timeout-minutes: 10 |
| uses: ./.github/workflows/actions/runPythonTests |
| with: |
| testDescription: "CLI tests on install" |
| testCommand: FreeCADCmd -t 0 |
| logFile: ${{ env.logdir }}TestCLIInstall.log |
| reportFile: ${{env.reportdir}}${{ env.reportfilename }} |
|
|
| - name: FreeCAD GUI tests on install |
| timeout-minutes: 15 |
| uses: ./.github/workflows/actions/runPythonTests |
| with: |
| testDescription: "GUI tests on install" |
| |
| testCommand: xvfb-run python3 ./.github/scripts/run_gui_tests.py "FreeCAD" |
| logFile: ${{ env.logdir }}TestGUIInstall.log |
| reportFile: ${{env.reportdir}}${{ env.reportfilename }} |
|
|
| - name: Save Compiler Cache |
| id: cache-save |
| if: always() |
| uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 |
| with: |
| path: ${{ env.CCACHE_DIR }} |
| key: FC-${{ steps.genCacheKey.outputs.cacheKey }}-${{ github.ref }}-${{ github.run_id }} |
|
|
| - name: Upload logs |
| if: always() |
| uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 |
| with: |
| name: ${{ inputs.artifactBasename }}-Logs |
| path: | |
| ${{ env.logdir }} |
| /var/crash/*FreeCAD* |
| |
| - name: Upload report |
| if: always() |
| uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 |
| with: |
| name: ${{ env.reportfilename }} |
| path: | |
| ${{env.reportdir}}${{ env.reportfilename }} |
| |