Skip to content

Commit

Permalink
Add cura resources as optional Conan dependency (#2077)
Browse files Browse the repository at this point in the history
  • Loading branch information
jellespijker authored May 10, 2024
2 parents fc4266a + 33701fe commit 0ab361b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 25 deletions.
27 changes: 2 additions & 25 deletions .github/workflows/gcodeanalyzer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -159,15 +137,14 @@ 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)
if: ${{ runner.os != 'Windows' }}
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
Expand All @@ -180,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

Expand Down
2 changes: 2 additions & 0 deletions conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
5 changes: 5 additions & 0 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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):
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 0ab361b

Please sign in to comment.