Skip to content

Commit 2837bc1

Browse files
authored
Cura 11622 conan v2 (#2178)
2 parents 1812a2e + 38fbb28 commit 2837bc1

16 files changed

+81
-375
lines changed

.github/workflows/benchmark.yml

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,30 +28,17 @@ permissions:
2828
contents: write
2929
deployments: write
3030

31-
env:
32-
CONAN_LOGIN_USERNAME: ${{ secrets.CONAN_USER }}
33-
CONAN_PASSWORD: ${{ secrets.CONAN_PASS }}
34-
3531

3632
jobs:
3733
check_actor:
3834
uses: ultimaker/cura-workflows/.github/workflows/check-actor.yml@main
3935
secrets: inherit
4036

41-
conan-recipe-version:
42-
needs: [ check_actor ]
43-
if: ${{ needs.check_actor.outputs.proceed == 'true' }}
44-
uses: ultimaker/cura-workflows/.github/workflows/conan-recipe-version.yml@main
45-
with:
46-
project_name: curaengine
47-
4837
benchmark:
49-
needs: [ conan-recipe-version ]
5038
uses: ultimaker/cura-workflows/.github/workflows/benchmark.yml@main
5139
with:
52-
recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }}
53-
conan_extra_args: "-o curaengine:enable_benchmarks=True"
54-
benchmark_cmd: "benchmark/benchmarks --benchmark_format=json --benchmark_out=benchmark_result.json"
40+
conan_extra_args: "-o \"curaengine/*:enable_benchmarks=True\""
41+
benchmark_cmd: "./build/Release/benchmark/benchmarks --benchmark_format=json --benchmark_out=benchmark_result.json"
5542
name: "C++ Benchmark"
5643
output_file_path: "build/Release/benchmark_result.json"
5744
data_dir: "dev/bench"

.github/workflows/conan-package.yml

Lines changed: 3 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -39,47 +39,8 @@ on:
3939
- '[0-9].[0-9][0-9]*'
4040

4141
jobs:
42-
conan-recipe-version:
43-
uses: ultimaker/cura-workflows/.github/workflows/conan-recipe-version.yml@main
42+
conan-package:
43+
uses: ultimaker/cura-workflows/.github/workflows/conan-package.yml
4444
with:
45-
project_name: curaengine
46-
47-
conan-package-export:
48-
needs: [ conan-recipe-version ]
49-
uses: ultimaker/cura-workflows/.github/workflows/conan-recipe-export.yml@main
50-
with:
51-
recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }}
52-
recipe_id_latest: ${{ needs.conan-recipe-version.outputs.recipe_id_latest }}
53-
secrets: inherit
54-
55-
conan-package-create-macos:
56-
needs: [ conan-recipe-version, conan-package-export ]
57-
if: ${{ ((github.event_name == 'push' && (github.ref_name == 'main' || needs.conan-recipe-version.outputs.is_release_branch == 'true')) || github.event_name == 'pull_request') }}
58-
uses: ultimaker/cura-workflows/.github/workflows/conan-package-create-macos.yml@main
59-
with:
60-
recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }}
61-
secrets: inherit
62-
63-
conan-package-create-windows:
64-
needs: [ conan-recipe-version, conan-package-export ]
65-
if: ${{ ((github.event_name == 'push' && (github.ref_name == 'main' || needs.conan-recipe-version.outputs.is_release_branch == 'true')) || github.event_name == 'pull_request') }}
66-
uses: ultimaker/cura-workflows/.github/workflows/conan-package-create-windows.yml@main
67-
with:
68-
recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }}
69-
secrets: inherit
70-
71-
conan-package-create-linux:
72-
needs: [ conan-recipe-version, conan-package-export ]
73-
if: ${{ ((github.event_name == 'push' && (github.ref_name == 'main' || needs.conan-recipe-version.outputs.is_release_branch == 'true')) || github.event_name == 'pull_request') }}
74-
uses: ultimaker/cura-workflows/.github/workflows/conan-package-create-linux.yml@main
75-
with:
76-
recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }}
77-
secrets: inherit
78-
79-
conan-package-create-wasm:
80-
needs: [ conan-recipe-version, conan-package-export ]
81-
if: ${{ (github.event_name == 'push' && (github.ref_name == 'main' || needs.conan-recipe-version.outputs.is_release_branch == 'true')) }}
82-
uses: ultimaker/cura-workflows/.github/workflows/conan-package-create-wasm.yml@main
83-
with:
84-
recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }}
45+
platform_wasm: true
8546
secrets: inherit

.github/workflows/gcodeanalyzer.yml

Lines changed: 10 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@ permissions:
2424
contents: write
2525
deployments: write
2626

27-
env:
28-
CONAN_LOGIN_USERNAME: ${{ secrets.CONAN_USER }}
29-
CONAN_PASSWORD: ${{ secrets.CONAN_PASS }}
30-
3127
# TODO: Make cura-workflows/benchmark.yml generic enough to fit the gcodeanalyzer benchmark
3228

3329
jobs:
@@ -39,32 +35,19 @@ jobs:
3935
needs: [ check_actor ]
4036
if: ${{ needs.check_actor.outputs.proceed == 'true' }}
4137
uses: ultimaker/cura-workflows/.github/workflows/conan-recipe-version.yml@main
42-
with:
43-
project_name: curaengine
4438

4539
gcodeanalyzer:
4640
needs: [ conan-recipe-version ]
4741
name: Run GCodeAnalyzer on the engine
4842
runs-on: ubuntu-latest
4943
steps:
50-
- name: Checkout repo
51-
uses: actions/checkout@v4
52-
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
44+
- name: Setup the build environment
45+
uses: ultimaker/cura-workflows/.github/actions/setup-build-environment@main
5346
with:
54-
path: 'CuraEngine'
55-
fetch-depth: 1
56-
ref: ${{ github.head_ref }}
57-
58-
- name: Checkout repo PR
59-
uses: actions/checkout@v4
60-
if: ${{ github.event.pull_request.head.repo.full_name != github.repository }}
61-
with:
62-
path: 'CuraEngine'
63-
fetch-depth: 1
64-
ref: ${{ github.base_ref }}
47+
install_system_dependencies: true
6548

6649
- name: Checkout GCodeAnalyzer
67-
uses: actions/checkout@v3
50+
uses: actions/checkout@v4
6851
with:
6952
repository: 'Ultimaker/GCodeAnalyzer'
7053
ref: 'main'
@@ -73,95 +56,31 @@ jobs:
7356
token: ${{ secrets.CURA_BENCHMARK_PAT }}
7457

7558
- name: Checkout Test Models
76-
uses: actions/checkout@v3
59+
uses: actions/checkout@v4
7760
with:
7861
repository: 'Ultimaker/NightlyTestModels'
7962
ref: 'main'
8063
path: 'NightlyTestModels'
8164
fetch-depth: 1
8265
token: ${{ secrets.GITHUB_TOKEN }}
8366

84-
- name: Sync pip requirements
85-
run: curl -O https://raw.githubusercontent.com/Ultimaker/cura-workflows/main/.github/workflows/requirements-runner.txt
86-
working-directory: CuraEngine/.github/workflows
87-
88-
- name: Setup Python and pip
89-
uses: actions/setup-python@v4
90-
with:
91-
python-version: 3.11.x
92-
cache: pip
93-
cache-dependency-path: CuraEngine/.github/workflows/requirements-runner.txt
94-
95-
- name: Install Python requirements and Create default Conan profile
96-
run: |
97-
pip install -r CuraEngine/.github/workflows/requirements-runner.txt
98-
pip install wheel numpy pandas python-dateutil pytz six
99-
pip install git+https://github.com/ultimaker/libcharon@CURA-9495_analyzer_requisites#egg=charon
100-
pip install pytest pytest-benchmark
101-
102-
- name: Install Linux system requirements for building
103-
run: |
104-
mkdir runner_scripts
105-
cd runner_scripts
106-
curl -O https://raw.githubusercontent.com/Ultimaker/cura-workflows/main/runner_scripts/ubuntu_setup.sh
107-
chmod +x ubuntu_setup.sh
108-
sudo ./ubuntu_setup.sh
109-
110-
- name: Setup pipeline caches
111-
run: |
112-
mkdir -p /home/runner/.conan/downloads
113-
mkdir -p /home/runner/.conan/data
114-
115-
- name: Create default Conan profile
116-
run: conan profile new default --detect
117-
118-
- name: Get Conan configuration
119-
run: |
120-
conan config install https://github.com/Ultimaker/conan-config.git
121-
conan config install https://github.com/Ultimaker/conan-config.git -a "-b runner/${{ runner.os }}/${{ runner.arch }}"
122-
123-
- name: Cache Conan packages
124-
uses: actions/cache@v3
125-
with:
126-
path: /home/runner/.conan/data
127-
key: ${{ runner.os }}-conan-data-${{ github.run_id }}
128-
restore-keys: |
129-
${{ runner.os }}-conan-data-
130-
131-
- name: Cache Conan downloads
132-
uses: actions/cache@v3
133-
with:
134-
path: /home/runner/.conan/downloads
135-
key: ${{ runner.os }}-conan-downloads-${{ github.run_id }}
136-
restore-keys: |
137-
${{ runner.os }}-conan-downloads-
138-
13967
- name: Install dependencies
140-
run: conan install . ${{ needs.conan-recipe-version.outputs.recipe_id_full }} -s build_type=Release --build=missing --update -g GitHubActionsRunEnv -g GitHubActionsBuildEnv -c tools.build:skip_test=True -o with_cura_resources=True
141-
working-directory: CuraEngine
142-
143-
- name: Set Environment variables from Conan install (bash)
144-
if: ${{ runner.os != 'Windows' }}
145-
run: |
146-
. ./activate_github_actions_runenv.sh
147-
. ./activate_github_actions_buildenv.sh
148-
working-directory: CuraEngine/build/Release/generators
68+
run: conan install . ${{ needs.conan-recipe-version.outputs.version_full }} -s "*:build_type=Release" --build=missing --update -g VirtualRunEnv -c tools.build:skip_test=True -o with_cura_resources=True
14969

15070
- name: Build CuraEngine and tests
15171
run: |
72+
source build/Release/generators/conanbuild.sh
15273
cmake --preset release
15374
cmake --build --preset release
154-
working-directory: CuraEngine
15575
15676
- name: Collect STL-files, run CuraEngine, output GCode-files
15777
run: |
158-
for file in `ls ../NightlyTestModels/*.stl`;
78+
for file in `ls NightlyTestModels/*.stl`;
15979
do
160-
( time ./build/Release/CuraEngine slice --force-read-parent --force-read-nondefault -v -p -j $CURA_RESOURCES/definitions/ultimaker_s3.def.json -l $file -o ../`basename $file .stl`.gcode ) 2> ../`basename $file .stl`.time
80+
( time ./build/Release/CuraEngine slice --force-read-parent --force-read-nondefault -v -p -j $CURA_RESOURCES/definitions/ultimaker_s3.def.json -l $file -o `basename $file .stl`.gcode ) 2> `basename $file .stl`.time
16181
done
162-
working-directory: CuraEngine
16382
164-
# TODO: Move this to GCodeAnalyzer
83+
# TODO: Move this to GCodeAnalyzer
16584
- name: Run GCodeAnalyzer on generated GCode files
16685
id: gcode_out
16786
run: |

.github/workflows/lint-formatter.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- name: Checkout
18-
uses: actions/checkout@v3
18+
uses: actions/checkout@v4
1919

20-
- uses: technote-space/get-diff-action@v6
20+
- uses: greguintow/get-diff-action@v7
2121
with:
2222
PATTERNS: |
2323
include/**/*.h*
2424
src/**/*.c*
2525
2626
- name: Setup Python and pip
2727
if: env.GIT_DIFF && !env.MATCHED_FILES # If nothing happens with python and/or pip after, the clean-up crashes.
28-
uses: actions/setup-python@v4
28+
uses: actions/setup-python@v5
2929
with:
3030
python-version: 3.11.x
3131
cache: 'pip'

.github/workflows/lint-tidier.yml

Lines changed: 1 addition & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -11,97 +11,4 @@ on:
1111
jobs:
1212
lint-tidier-job:
1313
name: Auto-apply clang-tidy
14-
15-
runs-on: ubuntu-latest
16-
steps:
17-
- name: Checkout
18-
uses: actions/checkout@v3
19-
with:
20-
fetch-depth: 2
21-
22-
- uses: technote-space/get-diff-action@v6
23-
with:
24-
PATTERNS: |
25-
include/**/*.h*
26-
src/**/*.c*
27-
28-
- name: Setup Python and pip
29-
if: env.GIT_DIFF && !env.MATCHED_FILES # If nothing happens with python and/or pip after, the clean-up crashes.
30-
uses: actions/setup-python@v4
31-
with:
32-
python-version: 3.11.x
33-
cache: "pip"
34-
cache-dependency-path: .github/workflows/requirements-linter.txt
35-
36-
- name: Install Python requirements for runner
37-
if: env.GIT_DIFF && !env.MATCHED_FILES
38-
run: pip install -r .github/workflows/requirements-linter.txt
39-
40-
# NOTE: Due to what are probably github issues, we have to remove the cache and reconfigure before the rest.
41-
# This is maybe because grub caches the disk it uses last time, which is recreated each time.
42-
- name: Install Linux system requirements
43-
if: ${{ runner.os == 'Linux' }}
44-
run: |
45-
sudo rm /var/cache/debconf/config.dat
46-
sudo dpkg --configure -a
47-
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
48-
sudo apt update
49-
sudo apt upgrade
50-
sudo apt install build-essential checkinstall libegl-dev zlib1g-dev libssl-dev ninja-build autoconf libx11-dev libx11-xcb-dev libfontenc-dev libice-dev libsm-dev libxau-dev libxaw7-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxdmcp-dev libxext-dev libxfixes-dev libxi-dev libxinerama-dev libxkbfile-dev libxmu-dev libxmuu-dev libxpm-dev libxrandr-dev libxrender-dev libxres-dev libxss-dev libxt-dev libxtst-dev libxv-dev libxvmc-dev libxxf86vm-dev xtrans-dev libxcb-render0-dev libxcb-render-util0-dev libxcb-xkb-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-xinerama0-dev xkb-data libxcb-dri3-dev uuid-dev libxcb-util-dev libxkbcommon-x11-dev pkg-config -y
51-
52-
- name: Install GCC-132 on ubuntu
53-
run: |
54-
sudo apt install g++-13 gcc-13 -y
55-
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 13
56-
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 13
57-
58-
- name: Create the default Conan profile
59-
run: conan profile new default --detect
60-
61-
- name: Get Conan configuration
62-
run: |
63-
conan config install https://github.com/Ultimaker/conan-config.git
64-
conan config install https://github.com/Ultimaker/conan-config.git -a "-b runner/${{ runner.os }}/${{ runner.arch }}"
65-
66-
- name: Install dependencies
67-
run: conan install . ${{ needs.conan-recipe-version.outputs.recipe_id_full }} -o enable_testing=True -s build_type=Release --build=missing --update -g GitHubActionsRunEnv -g GitHubActionsBuildEnv
68-
69-
- name: Set Environment variables from Conan install (bash)
70-
if: ${{ runner.os != 'Windows' }}
71-
run: |
72-
. ./activate_github_actions_runenv.sh
73-
. ./activate_github_actions_buildenv.sh
74-
working-directory: build/Release/generators
75-
76-
- name: Build CuraEngine and tests
77-
run: |
78-
cmake --preset release
79-
cmake --build --preset release
80-
81-
- name: Create results directory
82-
run: mkdir linter-result
83-
84-
- name: Diagnose file(s)
85-
if: env.GIT_DIFF && !env.MATCHED_FILES
86-
continue-on-error: true
87-
run: |
88-
clang-tidy -p ./build/Release/ --config-file=.clang-tidy ${{ env.GIT_DIFF_FILTERED }} --export-fixes=linter-result/fixes.yml
89-
90-
- name: Save PR metadata
91-
run: |
92-
echo ${{ github.event.number }} > linter-result/pr-id.txt
93-
echo ${{ github.event.pull_request.head.repo.full_name }} > linter-result/pr-head-repo.txt
94-
echo ${{ github.event.pull_request.head.sha }} > linter-result/pr-head-sha.txt
95-
96-
- uses: actions/upload-artifact@v2
97-
with:
98-
name: linter-result
99-
path: linter-result/
100-
101-
- name: Run clang-tidy-pr-comments action
102-
uses: platisd/[email protected]
103-
with:
104-
github_token: ${{ secrets.GITHUB_TOKEN }}
105-
clang_tidy_fixes: linter-result/fixes.yml
106-
request_changes: true
107-
suggestions_per_comment: 30
14+
uses: ultimaker/cura-workflows/.github/workflows/lint-tidier.yml@main

.github/workflows/process-pull-request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
add_label:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v2
11+
- uses: actions/checkout@v4
1212
- uses: actions-ecosystem/action-add-labels@v1
1313
if: ${{ github.event.pull_request.head.repo.full_name != github.repository }}
1414
with:

.github/workflows/requirements-conan-package.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/workflows/requirements-linter.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

.github/workflows/requirements-runner.txt

Whitespace-only changes.

.github/workflows/stress_benchmark.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ jobs:
4141
needs: [ check_actor ]
4242
if: ${{ needs.check_actor.outputs.proceed == 'true' }}
4343
uses: ultimaker/cura-workflows/.github/workflows/conan-recipe-version.yml@main
44-
with:
45-
project_name: curaengine
4644

4745
benchmark:
4846
needs: [ conan-recipe-version ]
@@ -55,4 +53,4 @@ jobs:
5553
output_file_path: "build/Release/benchmark_result.json"
5654
data_dir: "dev/stress_bench"
5755
tool: "customSmallerIsBetter"
58-
secrets: inherit
56+
secrets: inherit

0 commit comments

Comments
 (0)