From 4c596a64ecbeb9fac38d8fb11f55c5da633904ed Mon Sep 17 00:00:00 2001 From: Jacob Oursland Date: Thu, 30 Nov 2023 18:38:15 -0700 Subject: [PATCH] CI: Add macOS. --- .github/workflows/CI_master.yml | 15 ++ .../workflows/actions/macos/build/action.yml | 73 ++++++++ .../actions/macos/configure/action.yml | 78 ++++++++ .../actions/macos/generateCacheKey/action.yml | 44 +++++ .../actions/macos/install/action.yml | 73 ++++++++ .../runCPPTests/runSingleTest/action.yml | 2 +- .../actions/runPythonTests/action.yml | 2 +- .../workflows/sub_buildMacOSCondaApple.yml | 166 ++++++++++++++++++ .../workflows/sub_buildMacOSCondaIntel.yml | 166 ++++++++++++++++++ 9 files changed, 617 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/actions/macos/build/action.yml create mode 100644 .github/workflows/actions/macos/configure/action.yml create mode 100644 .github/workflows/actions/macos/generateCacheKey/action.yml create mode 100644 .github/workflows/actions/macos/install/action.yml create mode 100644 .github/workflows/sub_buildMacOSCondaApple.yml create mode 100644 .github/workflows/sub_buildMacOSCondaIntel.yml diff --git a/.github/workflows/CI_master.yml b/.github/workflows/CI_master.yml index 1de7510563..44b40ede93 100644 --- a/.github/workflows/CI_master.yml +++ b/.github/workflows/CI_master.yml @@ -39,6 +39,19 @@ jobs: with: artifactBasename: Prepare-${{ github.run_id }} + # GA in Jan-Mar 2024 Timeframe: https://github.com/actions/runner-images/issues/8439#issuecomment-1755601587 + # MacOS_13_Conda_Apple: + # needs: [Prepare] + # uses: ./.github/workflows/sub_buildMacOSCondaApple.yml + # with: + # artifactBasename: MacOS_13_Conda_Apple-${{ github.run_id }} + + MacOS_13_Conda_Intel: + needs: [Prepare] + uses: ./.github/workflows/sub_buildMacOSCondaIntel.yml + with: + artifactBasename: MacOS_13_Conda_Intel-${{ github.run_id }} + Ubuntu_20-04: needs: [Prepare] uses: ./.github/workflows/sub_buildUbuntu2004.yml @@ -75,6 +88,8 @@ jobs: WrapUp: needs: [ Prepare, + # MacOS_13_Conda_Apple, + MacOS_13_Conda_Intel, Ubuntu_20-04, Ubuntu_22-04_Conda, Windows, diff --git a/.github/workflows/actions/macos/build/action.yml b/.github/workflows/actions/macos/build/action.yml new file mode 100644 index 0000000000..0eee7f15e3 --- /dev/null +++ b/.github/workflows/actions/macos/build/action.yml @@ -0,0 +1,73 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +# *************************************************************************** +# * * +# * Copyright (c) 2023 0penBrain. * +# * * +# * This file is part of FreeCAD. * +# * * +# * FreeCAD is free software: you can redistribute it and/or modify it * +# * under the terms of the GNU Lesser General Public License as * +# * published by the Free Software Foundation, either version 2.1 of the * +# * License, or (at your option) any later version. * +# * * +# * FreeCAD is distributed in the hope that it will be useful, but * +# * WITHOUT ANY WARRANTY; without even the implied warranty of * +# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * +# * Lesser General Public License for more details. * +# * * +# * You should have received a copy of the GNU Lesser General Public * +# * License along with FreeCAD. If not, see * +# * . * +# * * +# *************************************************************************** + +name: build +description: "macOS: build application" + +inputs: + builddir: + description: "Directory where build will happen" + required: true + logFile: + description: "Path for log file" + required: true + errorFile: + description: "Path to error file" + required: true + reportFile: + description: "Path for report file" + required: true + extraParameters: + description: "Extra parameters to CMake build" + required: false + +runs: + using: "composite" + steps: + - name: Build + id: build + shell: bash -l {0} + run: | + (cmake --build ${{ inputs.builddir }} -j$(nproc) ${{ inputs.extraParameters }}) \ + 2> >(tee -a ${{ inputs.errorFile }}) | tee -a ${{ inputs.logFile }} + - name: Write report + shell: bash -l {0} + if: always() + run: | + if [ ${{ steps.build.outcome }} == 'success' ] + then + echo "
:heavy_check_mark: CMake build succeeded" >> ${{ inputs.reportFile }} + else + echo "
:fire: CMake build failed" >> ${{ inputs.reportFile }} + fi + echo "" >> ${{ inputs.reportFile }} + echo "Build Error Log (stderr output):" >> ${{ inputs.reportFile }} + echo '```' >> ${{ inputs.reportFile }} + cat ${{ inputs.errorFile }} >> ${{ inputs.reportFile }} + echo '```' >> ${{ inputs.reportFile }} + echo "Build Log (only built targets reported):" >> ${{ inputs.reportFile }} + echo '```' >> ${{ inputs.reportFile }} + cat ${{ inputs.logFile }} | sed -ne "/Built target/p" >> ${{ inputs.reportFile }} + echo '```' >> ${{ inputs.reportFile }} + echo "
">> ${{ inputs.reportFile }} + echo "" >> ${{ inputs.reportFile }} diff --git a/.github/workflows/actions/macos/configure/action.yml b/.github/workflows/actions/macos/configure/action.yml new file mode 100644 index 0000000000..89a83d6340 --- /dev/null +++ b/.github/workflows/actions/macos/configure/action.yml @@ -0,0 +1,78 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +# *************************************************************************** +# * * +# * Copyright (c) 2023 0penBrain. * +# * * +# * This file is part of FreeCAD. * +# * * +# * FreeCAD is free software: you can redistribute it and/or modify it * +# * under the terms of the GNU Lesser General Public License as * +# * published by the Free Software Foundation, either version 2.1 of the * +# * License, or (at your option) any later version. * +# * * +# * FreeCAD is distributed in the hope that it will be useful, but * +# * WITHOUT ANY WARRANTY; without even the implied warranty of * +# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * +# * Lesser General Public License for more details. * +# * * +# * You should have received a copy of the GNU Lesser General Public * +# * License along with FreeCAD. If not, see * +# * . * +# * * +# *************************************************************************** + +name: configure +description: "macOS: configure CMake" + +inputs: + sourcedir: + description: "Directory where sources are stored" + required: false + default: ./ + builddir: + description: "Directory where build will happen" + required: true + logFile: + description: "Path for log file" + required: true + errorFile: + description: "Path to error file" + required: true + reportFile: + description: "Path for report file" + required: true + extraParameters: + description: "Extra parameters to CMake configure" + required: false + +runs: + using: "composite" + steps: + - name: Configure CMake + id: configure + shell: bash -l {0} + run: | + (cmake -S ${{ inputs.sourcedir }} -B ${{ inputs.builddir }} -D CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE ${{inputs.extraParameters }}) \ + 2> >(tee -a ${{ inputs.errorFile }}) | tee -a ${{ inputs.logFile }} + - name: Write report + shell: bash -l {0} + if: always() + run: | + if [ ${{ steps.configure.outcome }} == 'success' ] + then + echo "
:heavy_check_mark: CMake configure succeeded" >> ${{ inputs.reportFile }} + echo "" >> ${{ inputs.reportFile }} + echo "Configure Error Log (stderr output):" >> ${{ inputs.reportFile }} + echo '```' >> ${{ inputs.reportFile }} + cat ${{ inputs.errorFile }} >> ${{ inputs.reportFile }} + echo '```' >> ${{ inputs.reportFile }} + else + echo "
:fire: CMake configure failed" >> ${{ inputs.reportFile }} + fi + echo "" >> ${{ inputs.reportFile }} + echo "Configure Log (only final configuration values reported):" >> ${{ inputs.reportFile }} + echo '```' >> ${{ inputs.reportFile }} + cat ${{ inputs.logFile }} | sed -ne "/^ *==/,/^====/p" >> ${{ inputs.reportFile }} + echo '```' >> ${{ inputs.reportFile }} + echo "
">> ${{ inputs.reportFile }} + echo "" >> ${{ inputs.reportFile }} diff --git a/.github/workflows/actions/macos/generateCacheKey/action.yml b/.github/workflows/actions/macos/generateCacheKey/action.yml new file mode 100644 index 0000000000..ca444f739f --- /dev/null +++ b/.github/workflows/actions/macos/generateCacheKey/action.yml @@ -0,0 +1,44 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +# *************************************************************************** +# * * +# * Copyright (c) 2023 0penBrain. * +# * * +# * This file is part of FreeCAD. * +# * * +# * FreeCAD is free software: you can redistribute it and/or modify it * +# * under the terms of the GNU Lesser General Public License as * +# * published by the Free Software Foundation, either version 2.1 of the * +# * License, or (at your option) any later version. * +# * * +# * FreeCAD is distributed in the hope that it will be useful, but * +# * WITHOUT ANY WARRANTY; without even the implied warranty of * +# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * +# * Lesser General Public License for more details. * +# * * +# * You should have received a copy of the GNU Lesser General Public * +# * License along with FreeCAD. If not, see * +# * . * +# * * +# *************************************************************************** + +name: generateCacheKey +description: "macOS: generates a cache key taking into account distro and compiler" + +inputs: + compiler: + description: "Binary name/path of compiler to be used" + required: true +outputs: + cacheKey: + description: "Cache key with distro and compiler version" + value: ${{ steps.generateCacheKey.outputs.cacheKey }} + +runs: + using: "composite" + steps: + - id: generateCacheKey + shell: bash -l {0} + run: | + cacheKey=$(sw_vers --productName)-$(sw_vers --productVersion)-$(basename ${{ inputs.compiler }})$(${{ inputs.compiler }} -dumpfullversion -dumpversion) + echo "Generated cache key : $cacheKey" + echo "cacheKey=$cacheKey" >> $GITHUB_OUTPUT diff --git a/.github/workflows/actions/macos/install/action.yml b/.github/workflows/actions/macos/install/action.yml new file mode 100644 index 0000000000..1b513b9fdb --- /dev/null +++ b/.github/workflows/actions/macos/install/action.yml @@ -0,0 +1,73 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +# *************************************************************************** +# * * +# * Copyright (c) 2023 0penBrain. * +# * * +# * This file is part of FreeCAD. * +# * * +# * FreeCAD is free software: you can redistribute it and/or modify it * +# * under the terms of the GNU Lesser General Public License as * +# * published by the Free Software Foundation, either version 2.1 of the * +# * License, or (at your option) any later version. * +# * * +# * FreeCAD is distributed in the hope that it will be useful, but * +# * WITHOUT ANY WARRANTY; without even the implied warranty of * +# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * +# * Lesser General Public License for more details. * +# * * +# * You should have received a copy of the GNU Lesser General Public * +# * License along with FreeCAD. If not, see * +# * . * +# * * +# *************************************************************************** + +name: install +description: "macOS: install application" + +inputs: + builddir: + description: "Directory where build is stored" + required: true + logFile: + description: "Path for log file" + required: true + errorFile: + description: "Path to error file" + required: true + reportFile: + description: "Path for report file" + required: true + extraParameters: + description: "Extra parameters to CMake install" + required: false + +runs: + using: "composite" + steps: + - name: Install + id: install + shell: bash -l {0} + run: | + (sudo cmake --install ${{ inputs.builddir }} ${{ inputs.extraParameters }}) \ + 2> >(tee -a ${{ inputs.errorFile }}) | tee -a ${{ inputs.logFile }} + - name: Write report + shell: bash -l {0} + if: always() + run: | + if [ ${{ steps.install.outcome }} == 'success' ] + then + echo "
:heavy_check_mark: CMake install succeeded" >> ${{ inputs.reportFile }} + else + echo "
:fire: CMake install failed" >> ${{ inputs.reportFile }} + fi + echo "" >> ${{ inputs.reportFile }} + echo "Install Error Log (stderr output):" >> ${{ inputs.reportFile }} + echo '```' >> ${{ inputs.reportFile }} + cat ${{ inputs.errorFile }} >> ${{ inputs.reportFile }} + echo '```' >> ${{ inputs.reportFile }} + echo "Install Error Log (stdout output trimmed to the last 100 Lines):" >> ${{ inputs.reportFile }} + echo '```' >> ${{ inputs.reportFile }} + tail -n 100 ${{ inputs.logFile }} >> ${{ inputs.reportFile }} + echo '```' >> ${{ inputs.reportFile }} + echo "
">> ${{ inputs.reportFile }} + echo "" >> ${{ inputs.reportFile }} diff --git a/.github/workflows/actions/runCPPTests/runSingleTest/action.yml b/.github/workflows/actions/runCPPTests/runSingleTest/action.yml index b99c01466a..3b1736c612 100644 --- a/.github/workflows/actions/runCPPTests/runSingleTest/action.yml +++ b/.github/workflows/actions/runCPPTests/runSingleTest/action.yml @@ -45,7 +45,7 @@ runs: steps: - name: Run C++ tests shell: bash -l {0} - run: stdbuf -oL -eL ${{ inputs.testCommand }} |& tee -a ${{ inputs.testLogFile }} + run: ${{ inputs.testCommand }} | tee -a ${{ inputs.testLogFile }} - name: Parse test results if: always() id: report diff --git a/.github/workflows/actions/runPythonTests/action.yml b/.github/workflows/actions/runPythonTests/action.yml index 26b362d2bb..dca94e48fe 100644 --- a/.github/workflows/actions/runPythonTests/action.yml +++ b/.github/workflows/actions/runPythonTests/action.yml @@ -45,7 +45,7 @@ runs: id: runTests shell: bash -l {0} run: | - stdbuf -oL -eL ${{ inputs.testCommand }} |& sed -Ee "/[[:blank:]]*\([[:digit:]]{1,3} %\)[[:blank:]]*/d" | tee -a ${{ inputs.logFile }} + ${{ inputs.testCommand }} | sed -Ee "/[[:blank:]]*\([[:digit:]]{1,3} %\)[[:blank:]]*/d" | tee -a ${{ inputs.logFile }} - name: Write report shell: bash -l {0} if: always() diff --git a/.github/workflows/sub_buildMacOSCondaApple.yml b/.github/workflows/sub_buildMacOSCondaApple.yml new file mode 100644 index 0000000000..3a7a8ebb0e --- /dev/null +++ b/.github/workflows/sub_buildMacOSCondaApple.yml @@ -0,0 +1,166 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +# *************************************************************************** +# * * +# * Copyright (c) 2023 0penBrain. * +# * * +# * This file is part of FreeCAD. * +# * * +# * FreeCAD is free software: you can redistribute it and/or modify it * +# * under the terms of the GNU Lesser General Public License as * +# * published by the Free Software Foundation, either version 2.1 of the * +# * License, or (at your option) any later version. * +# * * +# * FreeCAD is distributed in the hope that it will be useful, but * +# * WITHOUT ANY WARRANTY; without even the implied warranty of * +# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * +# * Lesser General Public License for more details. * +# * * +# * You should have received a copy of the GNU Lesser General Public * +# * License along with FreeCAD. If not, see * +# * . * +# * * +# *************************************************************************** + +# This is a build and test workflow for CI of FreeCAD. +# This workflow aims at building and testing FreeCAD on a Conda environment on macOS. + +name: Build macOS 13 (Apple Silicon) +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: macos-13-xlarge + continue-on-error: ${{ inputs.allowedToFail }} + env: + CCACHE_DIR: ${{ github.workspace }}/ccache + CCACHE_CONFIGPATH: ${{ github.workspace }}/ccache/config + CCACHE_MAXSIZE: 1G + CCACHE_COMPILERCHECK: "%compiler% -dumpfullversion -dumpversion" # default:mtime + CCACHE_COMPRESS: true + CCACHE_COMPRESSLEVEL: 1 + CC: arm64-apple-darwin20.0.0-clang + CXX: arm64-apple-darwin20.0.0-clang++ + builddir: ${{ github.workspace }}/build/release/ + logdir: /tmp/logs/ + reportdir: /tmp/report/ + reportfilename: ${{ inputs.artifactBasename }}-report.md + defaults: + run: + shell: bash -l {0} + outputs: + reportFile: ${{ steps.Init.outputs.reportFile }} + + steps: + - name: Checking out source code + uses: actions/checkout@v3 + with: + submodules: true + - name: Setup Miniconda + uses: conda-incubator/setup-miniconda@v2 + with: + activate-environment: .conda/freecad + environment-file: conda/conda-env.yaml + channels: conda-forge,defaults + channel-priority: true + miniforge-version: latest + - name: Install FreeCAD dependencies + run: | + ./conda/setup-environment.sh + - name: Set Environment Variables + run: | + echo "CC=$CC" >> "$GITHUB_ENV" + echo "CXX=$CXX" >> "$GITHUB_ENV" + - 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/macos/generateCacheKey + with: + compiler: ${{ env.CXX }} + - name: Restore Compiler Cache + uses: pat-s/always-upload-cache@v3 + 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: CMake Configure + run: | + mamba run --live-stream -p .conda/freecad cmake --preset conda-macos-release -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/.conda/freecad/opt/freecad + - name: CMake Build + run: | + mamba run --live-stream -p .conda/freecad cmake --build build/release + - name: Print ccache statistics after Build + 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: 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 + run: | + mamba run --live-stream -p .conda/freecad cmake --install build/release + - name: FreeCAD CLI tests on install + timeout-minutes: 10 + uses: ./.github/workflows/actions/runPythonTests + with: + testDescription: "CLI tests on install" + testCommand: ${{ github.workspace }}/.conda/freecad/opt/freecad/bin/FreeCADCmd -t 0 + logFile: ${{ env.logdir }}TestCLIInstall.log + reportFile: ${{env.reportdir}}${{ env.reportfilename }} + - name: Upload logs + if: always() + uses: actions/upload-artifact@v3 + with: + name: ${{ inputs.artifactBasename }}-Logs + path: | + ${{ env.logdir }} + /var/crash/*FreeCAD* + - name: Upload report + if: always() + uses: actions/upload-artifact@v3 + with: + name: ${{ env.reportfilename }} + path: | + ${{env.reportdir}}${{ env.reportfilename }} diff --git a/.github/workflows/sub_buildMacOSCondaIntel.yml b/.github/workflows/sub_buildMacOSCondaIntel.yml new file mode 100644 index 0000000000..b6f497428e --- /dev/null +++ b/.github/workflows/sub_buildMacOSCondaIntel.yml @@ -0,0 +1,166 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +# *************************************************************************** +# * * +# * Copyright (c) 2023 0penBrain. * +# * * +# * This file is part of FreeCAD. * +# * * +# * FreeCAD is free software: you can redistribute it and/or modify it * +# * under the terms of the GNU Lesser General Public License as * +# * published by the Free Software Foundation, either version 2.1 of the * +# * License, or (at your option) any later version. * +# * * +# * FreeCAD is distributed in the hope that it will be useful, but * +# * WITHOUT ANY WARRANTY; without even the implied warranty of * +# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * +# * Lesser General Public License for more details. * +# * * +# * You should have received a copy of the GNU Lesser General Public * +# * License along with FreeCAD. If not, see * +# * . * +# * * +# *************************************************************************** + +# This is a build and test workflow for CI of FreeCAD. +# This workflow aims at building and testing FreeCAD on a Conda environment on macOS. + +name: Build macOS 13 (Intel) +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: macos-13 + continue-on-error: ${{ inputs.allowedToFail }} + env: + CCACHE_DIR: ${{ github.workspace }}/ccache + CCACHE_CONFIGPATH: ${{ github.workspace }}/ccache/config + CCACHE_MAXSIZE: 1G + CCACHE_COMPILERCHECK: "%compiler% -dumpfullversion -dumpversion" # default:mtime + CCACHE_COMPRESS: true + CCACHE_COMPRESSLEVEL: 1 + CC: x86_64-apple-darwin13.4.0-clang + CXX: x86_64-apple-darwin13.4.0-clang++ + builddir: ${{ github.workspace }}/build/release/ + logdir: /tmp/logs/ + reportdir: /tmp/report/ + reportfilename: ${{ inputs.artifactBasename }}-report.md + defaults: + run: + shell: bash -l {0} + outputs: + reportFile: ${{ steps.Init.outputs.reportFile }} + + steps: + - name: Checking out source code + uses: actions/checkout@v3 + with: + submodules: true + - name: Setup Miniconda + uses: conda-incubator/setup-miniconda@v2 + with: + activate-environment: .conda/freecad + environment-file: conda/conda-env.yaml + channels: conda-forge,defaults + channel-priority: true + miniforge-version: latest + - name: Install FreeCAD dependencies + run: | + ./conda/setup-environment.sh + - name: Set Environment Variables + run: | + echo "CC=$CC" >> "$GITHUB_ENV" + echo "CXX=$CXX" >> "$GITHUB_ENV" + - 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/macos/generateCacheKey + with: + compiler: ${{ env.CXX }} + - name: Restore Compiler Cache + uses: pat-s/always-upload-cache@v3 + 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: CMake Configure + run: | + mamba run --live-stream -p .conda/freecad cmake --preset conda-macos-release -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/.conda/freecad/opt/freecad + - name: CMake Build + run: | + mamba run --live-stream -p .conda/freecad cmake --build build/release + - name: Print ccache statistics after Build + 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: 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 + run: | + mamba run --live-stream -p .conda/freecad cmake --install build/release + - name: FreeCAD CLI tests on install + timeout-minutes: 10 + uses: ./.github/workflows/actions/runPythonTests + with: + testDescription: "CLI tests on install" + testCommand: ${{ github.workspace }}/.conda/freecad/opt/freecad/bin/FreeCADCmd -t 0 + logFile: ${{ env.logdir }}TestCLIInstall.log + reportFile: ${{env.reportdir}}${{ env.reportfilename }} + - name: Upload logs + if: always() + uses: actions/upload-artifact@v3 + with: + name: ${{ inputs.artifactBasename }}-Logs + path: | + ${{ env.logdir }} + /var/crash/*FreeCAD* + - name: Upload report + if: always() + uses: actions/upload-artifact@v3 + with: + name: ${{ env.reportfilename }} + path: | + ${{env.reportdir}}${{ env.reportfilename }}