FreeCAD

Форк
0
/
sub_buildWindowsConda.yml 
129 строк · 5.1 Кб
1
# ***************************************************************************
2
# *   Copyright (c) 2023 0penBrain                               *
3
# *                                                                         *
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.                                 *
9
# *                                                                         *
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.                  *
14
# *                                                                         *
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  *
18
# *   USA                                                                   *
19
# *                                                                         *
20
# ***************************************************************************
21

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.
24

25
name: Build Windows (Conda)
26
on:
27
  workflow_call:
28
    inputs:
29
      artifactBasename:
30
        type: string
31
        required: true
32
      allowedToFail:
33
        default: false
34
        type: boolean
35
        required: false
36
    outputs:
37
      reportFile:
38
        value: ${{ jobs.Build.outputs.reportFile }}
39

40
jobs:
41
  Build:
42
    runs-on: windows-latest
43
    continue-on-error: ${{ inputs.allowedToFail }}
44
    env:
45
      CCACHE_DIR: C:/FC/cache/
46
      CCACHE_COMPILERCHECK: "%compiler%" # default:mtime
47
      CCACHE_MAXSIZE: 1G
48
      CCACHE_COMPRESS: true
49
      CCACHE_COMPRESSLEVEL: 1
50
      CCACHE_NOHASHDIR: true
51
      CCACHE_DIRECT: 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/
56
      logdir: C:/logs/
57
      reportdir: C:/report/
58
      reportfilename: ${{ inputs.artifactBasename }}-report.md
59
    outputs:
60
      reportFile: ${{ steps.Init.outputs.reportFile }}
61

62
    steps:
63
      - name: Checking out source code
64
        uses: actions/checkout@v4
65
        with:
66
          submodules: true
67
      - name: Setup Miniconda
68
        uses: conda-incubator/setup-miniconda@v3
69
        with:
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
76
        run: |
77
          conda config --add envs_dirs $PWD/.conda
78
          mamba-devenv -f conda/environment.devenv.yml
79
      - name: Make needed directories, files and initializations
80
        id: Init
81
        run: |
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
89
        with:
90
          save-always: true
91
          path: ${{ env.CCACHE_DIR }}
92
          key: FC-Windows-Conda-${{ github.ref }}-${{ github.run_id }}
93
          restore-keys: |
94
            FC-Windows-Conda-${{ github.ref }}-
95
            FC-Windows-Conda-
96
      - name: Print Ccache statistics before build, reset stats and print config
97
        run: |
98
          ccache -s
99
          ccache -z
100
          ccache -p
101
      - name: Configuring CMake
102
        shell: cmd /C CALL {0}
103
        run: >
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}
107
        run: >
108
          conda\cmake.cmd --build build\release
109
      - name: Print Ccache statistics after build
110
        run: |
111
          ccache -s
112
      - name: CMake Install
113
        shell: cmd /C CALL {0}
114
        run: |
115
          conda\cmake.cmd  --install build\release
116
      - name: C++ unit tests
117
        timeout-minutes: 1
118
        run: |
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
121
        run: |
122
          . build\release\bin\FreeCADCmd -t 0 # 2>&1 | tee -filepath ${{ env.logdir }}/integrationTests.log
123
      - name: Upload logs
124
        if: always()
125
        uses: actions/upload-artifact@v4
126
        with:
127
          name: ${{ inputs.artifactBasename }}-Logs
128
          path: |
129
            ${{ env.logdir }}
130

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.