From b847f92fa5d5ed90bbd401a300297ef0622f4a65 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Fri, 10 May 2024 10:09:59 +0200 Subject: [PATCH 1/4] Add cura resources as optional Conan dependency This update adds an optional dependency to 'cura_resources' in the 'conandata.yml' and 'conanfile.py'. Another significant change is in the 'gcodeanalyzer.yml' where the steps to checkout Cura and the associated environment variables have been removed in favor of adding the Cura resources directly to the Conan install command. Contribute to NP-186 --- .github/workflows/gcodeanalyzer.yml | 25 +------------------------ conandata.yml | 2 ++ conanfile.py | 5 +++++ 3 files changed, 8 insertions(+), 24 deletions(-) diff --git a/.github/workflows/gcodeanalyzer.yml b/.github/workflows/gcodeanalyzer.yml index 29c83817de..8bcc738422 100644 --- a/.github/workflows/gcodeanalyzer.yml +++ b/.github/workflows/gcodeanalyzer.yml @@ -81,28 +81,6 @@ jobs: fetch-depth: 1 token: ${{ secrets.GITHUB_TOKEN }} - - name: Determine the corresponding Cura branch - id: curabranch - run: | - status_code=$(curl -s -o /dev/null -w "%{http_code}" "https://api.github.com/repos/ultimaker/cura/branches/${{ github.head_ref }}") - if [ "$status_code" -eq 200 ]; then - echo "The branch exists in Cura" - echo "branch=${{ github.head_ref }}" >> $GITHUB_OUTPUT - else - echo "branch=main" >> $GITHUB_OUTPUT - fi - - - name: Checkout Cura - uses: actions/checkout@v3 - with: - repository: 'Ultimaker/Cura' - ref: ${{ steps.curabranch.outputs.branch}} - path: 'Cura' - fetch-depth: 1 - sparse-checkout: | - resources/definitions - resources/extruders - - name: Sync pip requirements run: curl -O https://raw.githubusercontent.com/Ultimaker/cura-workflows/main/.github/workflows/requirements-runner.txt working-directory: CuraEngine/.github/workflows @@ -159,7 +137,7 @@ jobs: ${{ runner.os }}-conan-downloads- - name: Install dependencies - 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 + 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 working-directory: CuraEngine - name: Set Environment variables from Conan install (bash) @@ -167,7 +145,6 @@ jobs: run: | . ./activate_github_actions_runenv.sh . ./activate_github_actions_buildenv.sh - echo "CURA_ENGINE_SEARCH_PATH=$GITHUB_WORKSPACE/Cura/resources/definitions:$GITHUB_WORKSPACE/Cura/resources/extruders" >> $GITHUB_ENV working-directory: CuraEngine/build/Release/generators - name: Build CuraEngine and tests diff --git a/conandata.yml b/conandata.yml index 858634c9a0..38e20233f1 100644 --- a/conandata.yml +++ b/conandata.yml @@ -5,3 +5,5 @@ requirements_arcus: - "arcus/5.3.1" requirements_plugins: - "curaengine_grpc_definitions/(latest)@ultimaker/testing" +requirements_cura_resources: + - "cura_resources/(latest)@ultimaker/testing" diff --git a/conanfile.py b/conanfile.py index a696e03a1c..127a23576f 100644 --- a/conanfile.py +++ b/conanfile.py @@ -32,6 +32,7 @@ class CuraEngineConan(ConanFile): "enable_plugins": [True, False], "enable_sentry": [True, False], "enable_remote_plugins": [True, False], + "with_cura_resources": [True, False], } default_options = { "enable_arcus": True, @@ -40,6 +41,7 @@ class CuraEngineConan(ConanFile): "enable_plugins": True, "enable_sentry": False, "enable_remote_plugins": False, + "with_cura_resources": False, } def set_version(self): @@ -116,6 +118,9 @@ def requirements(self): self.requires("grpc/1.50.1") for req in self.conan_data["requirements_plugins"]: self.requires(req) + if self.options.with_cura_resources: + for req in self.conan_data["requirements_cura_resources"]: + self.requires(req) if self.options.enable_arcus or self.options.enable_plugins: self.requires("protobuf/3.21.12") self.requires("clipper/6.4.2@ultimaker/stable") From bf3442f4f644ffd1731a0870c3fce434a34ddedf Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Fri, 10 May 2024 11:21:28 +0200 Subject: [PATCH 2/4] Use current branch Contribute to NP-186 --- conandata.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conandata.yml b/conandata.yml index 38e20233f1..124b6af3d3 100644 --- a/conandata.yml +++ b/conandata.yml @@ -6,4 +6,4 @@ requirements_arcus: requirements_plugins: - "curaengine_grpc_definitions/(latest)@ultimaker/testing" requirements_cura_resources: - - "cura_resources/(latest)@ultimaker/testing" + - "cura_resources/(latest)@ultimaker/np_186" From cd2a5af11fc15f885930ac4de247fe472a0c2fb8 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Fri, 10 May 2024 11:43:58 +0200 Subject: [PATCH 3/4] Use `CURA_RESOURCES` variable Contribute to NP-186 --- .github/workflows/gcodeanalyzer.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gcodeanalyzer.yml b/.github/workflows/gcodeanalyzer.yml index 8bcc738422..0b85fb75aa 100644 --- a/.github/workflows/gcodeanalyzer.yml +++ b/.github/workflows/gcodeanalyzer.yml @@ -157,7 +157,7 @@ jobs: run: | for file in `ls ../NightlyTestModels/*.stl`; do - ( 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 + ( 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 done working-directory: CuraEngine From 33701fecec0879fcb19a57837cfba79bb8ef0eed Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Fri, 10 May 2024 13:31:48 +0200 Subject: [PATCH 4/4] Use `testing` for cura_resources Contribute to NP-186 --- conandata.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conandata.yml b/conandata.yml index 124b6af3d3..38e20233f1 100644 --- a/conandata.yml +++ b/conandata.yml @@ -6,4 +6,4 @@ requirements_arcus: requirements_plugins: - "curaengine_grpc_definitions/(latest)@ultimaker/testing" requirements_cura_resources: - - "cura_resources/(latest)@ultimaker/np_186" + - "cura_resources/(latest)@ultimaker/testing"