1
# ***************************************************************************
2
# * Copyright (c) 2023 0penBrain *
4
# * This program is free software; you can redistribute it and/or modify *
5
# * it under the terms of the GNU Lesser General Public License (LGPL) *
6
# * as published by the Free Software Foundation; either version 2 of *
7
# * the License, or (at your option) any later version. *
8
# * for detail see the LICENCE text file. *
10
# * This program is distributed in the hope that it will be useful, *
11
# * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13
# * GNU Library General Public License for more details. *
15
# * You should have received a copy of the GNU Library General Public *
16
# * License along with this program; if not, write to the Free Software *
17
# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
20
# ***************************************************************************
22
# This is a build and test workflow for CI of FreeCAD.
23
# This workflow aims at building and testing FreeCAD using a Conda environment on Windows with MSVC.
25
name: Build Windows (Conda)
38
value: ${{ jobs.Build.outputs.reportFile }}
42
runs-on: windows-latest
43
continue-on-error: ${{ inputs.allowedToFail }}
45
CCACHE_DIR: C:/FC/cache/
46
CCACHE_COMPILERCHECK: "%compiler%" # default:mtime
49
CCACHE_COMPRESSLEVEL: 1
50
CCACHE_NOHASHDIR: true
52
#CCACHE_SLOPPINESS: "pch_defines,time_macros" # Can't get PCH to work on Windows
53
CCACHE_LOGFILE: C:/logs/ccache.log
54
## Have to use C:\ because not enough space on workspace drive
55
builddir: C:/FC/build/
58
reportfilename: ${{ inputs.artifactBasename }}-report.md
60
reportFile: ${{ steps.Init.outputs.reportFile }}
63
- name: Checking out source code
64
uses: actions/checkout@v4
67
- name: Setup Miniconda
68
uses: conda-incubator/setup-miniconda@v3
70
activate-environment: .conda/freecad
71
environment-file: conda/conda-env.yaml
72
channels: conda-forge,defaults
73
channel-priority: true
74
miniforge-version: latest
75
- name: Install FreeCAD dependencies
77
conda config --add envs_dirs $PWD/.conda
78
mamba-devenv -f conda/environment.devenv.yml
79
- name: Make needed directories, files and initializations
82
mkdir ${{ env.CCACHE_DIR }}
83
mkdir ${{ env.builddir }}
84
mkdir ${{ env.logdir }}
85
mkdir ${{ env.reportdir }}
86
echo "reportFile=${{ env.reportfilename }}" >> $GITHUB_OUTPUT
87
- name: Restore compiler cache
88
uses: actions/cache@v4
91
path: ${{ env.CCACHE_DIR }}
92
key: FC-Windows-Conda-${{ github.ref }}-${{ github.run_id }}
94
FC-Windows-Conda-${{ github.ref }}-
96
- name: Print Ccache statistics before build, reset stats and print config
101
- name: Configuring CMake
102
shell: cmd /C CALL {0}
104
conda\cmake.cmd --preset conda-windows-release -DFREECAD_USE_PCH:BOOL=OFF -DFREECAD_RELEASE_PDB:BOOL=OFF -DFREECAD_USE_CCACHE:BOOL=ON
105
- name: Compiling sources
106
shell: cmd /C CALL {0}
108
conda\cmake.cmd --build build\release
109
- name: Print Ccache statistics after build
112
- name: CMake Install
113
shell: cmd /C CALL {0}
115
conda\cmake.cmd --install build\release
116
- name: C++ unit tests
119
. build\release\tests\Tests_run --gtest_output=json:${{ env.reportdir }}gtest_results.json # 2>&1 | tee -filepath ${{ env.logdir }}/unitTests.log
120
- name: FreeCAD CLI tests
122
. build\release\bin\FreeCADCmd -t 0 # 2>&1 | tee -filepath ${{ env.logdir }}/integrationTests.log
125
uses: actions/upload-artifact@v4
127
name: ${{ inputs.artifactBasename }}-Logs