Skip to content

Commit

Permalink
Merge branch '5.1' of github.com:Ultimaker/Uranium
Browse files Browse the repository at this point in the history
  • Loading branch information
nallath committed Jul 8, 2022
2 parents 0445f45 + ba7fd05 commit 925e1f0
Show file tree
Hide file tree
Showing 27 changed files with 697 additions and 322 deletions.
13 changes: 0 additions & 13 deletions .github/workflows/cicd.yml

This file was deleted.

86 changes: 86 additions & 0 deletions .github/workflows/conan-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
---
name: conan-package

# Exports the recipe, sources and binaries for Mac, Windows and Linux and upload these to the server such that these can
# be used downstream.
#
# It should run on pushes against main or CURA-* branches, but it will only create the binaries for main and release branches

on:
push:
paths:
- 'plugins/**'
- 'resources/**'
- 'UM/**'
- 'conanfile.py'
- 'conandata.yml'
- 'GitVersion.yml'
- '.github/workflows/conan-package.yml'
- '.github/workflows/requirements-conan-package.txt'
branches:
- main
- 'CURA-*'
- '[1-9]+.[0-9]+'
tags:
- '[1-9]+.[0-9]+.[0-9]+'

jobs:
conan-recipe-version:
uses: ultimaker/cura/.github/workflows/[email protected]
with:
project_name: uranium

conan-package-export-macos:
needs: [ conan-recipe-version ]
uses: ultimaker/cura/.github/workflows/[email protected]
with:
recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }}
recipe_id_latest: ${{ needs.conan-recipe-version.outputs.recipe_id_latest }}
recipe_id_pr: ${{ needs.conan-recipe-version.outputs.recipe_id_pr }}
runs_on: 'macos-10.15'
python_version: '3.10.4'
conan_config_branch: 'master'
conan_logging_level: 'info'
conan_export_binaries: true
secrets: inherit

conan-package-export-linux:
needs: [ conan-recipe-version ]
uses: ultimaker/cura/.github/workflows/[email protected]
with:
recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }}
recipe_id_latest: ${{ needs.conan-recipe-version.outputs.recipe_id_latest }}
recipe_id_pr: ${{ needs.conan-recipe-version.outputs.recipe_id_pr }}
runs_on: 'ubuntu-20.04'
python_version: '3.10.4'
conan_config_branch: 'master'
conan_logging_level: 'info'
conan_export_binaries: true
secrets: inherit

conan-package-export-windows:
needs: [ conan-recipe-version ]
uses: ultimaker/cura/.github/workflows/[email protected]
with:
recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }}
recipe_id_latest: ${{ needs.conan-recipe-version.outputs.recipe_id_latest }}
recipe_id_pr: ${{ needs.conan-recipe-version.outputs.recipe_id_pr }}
runs_on: 'windows-2022'
python_version: '3.10.4'
conan_config_branch: 'master'
conan_logging_level: 'info'
conan_export_binaries: true
secrets: inherit

notify-export:
if: ${{ always() }}
needs: [ conan-package-export-linux, conan-package-export-macos, conan-package-export-windows ]

uses: ultimaker/cura/.github/workflows/[email protected]
with:
success: ${{ contains(join(needs.*.result, ','), 'success') }}
success_title: "New Conan recipe exported in ${{ github.repository }}"
success_body: "Exported ${{ needs.conan-recipe-version.outputs.recipe_id_full }}"
failure_title: "Failed to export Conan Export in ${{ github.repository }}"
failure_body: "Failed to exported ${{ needs.conan-recipe-version.outputs.recipe_id_full }}"
secrets: inherit
2 changes: 2 additions & 0 deletions .github/workflows/requirements-conan-package.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
conan
sip==6.5.1
127 changes: 127 additions & 0 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
---
name: unit-test
# FIXME: This should be a reusable workflow

on:
push:
paths:
- 'plugins/**'
- 'resources/**'
- 'UM/**'
- 'tests/**'
- 'packaging/**'
- '.github/workflows/conan-*.yml'
- '.github/workflows/unit-test.yml'
- '.github/workflows/notify.yml'
- '.github/workflows/requirements-conan-package.txt'
- 'requirements*.txt'
- 'conanfile.py'
- 'conandata.yml'
- 'GitVersion.yml'
- '*.jinja'
branches:
- main
- 'CURA-*'
- '[1-9]+.[0-9]+'
tags:
- '[0-9]+.[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+-beta'
pull_request:
paths:
- 'plugins/**'
- 'resources/**'
- 'UM/**'
- 'icons/**'
- 'tests/**'
- 'packaging/**'
- '.github/workflows/conan-*.yml'
- '.github/workflows/unit-test.yml'
- '.github/workflows/notify.yml'
- '.github/workflows/requirements-conan-package.txt'
- 'requirements*.txt'
- 'conanfile.py'
- 'conandata.yml'
- 'GitVersion.yml'
- '*.jinja'
branches:
- main
- '[1-9]+.[0-9]+'
tags:
- '[0-9]+.[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+-beta'

env:
CONAN_LOGIN_USERNAME_CURA: ${{ secrets.CONAN_USER }}
CONAN_PASSWORD_CURA: ${{ secrets.CONAN_PASS }}
CONAN_LOGIN_USERNAME_CURA_CE: ${{ secrets.CONAN_USER }}
CONAN_PASSWORD_CURA_CE: ${{ secrets.CONAN_PASS }}
CONAN_LOG_RUN_TO_OUTPUT: 1
CONAN_LOGGING_LEVEL: info
CONAN_NON_INTERACTIVE: 1

jobs:
conan-recipe-version:
uses: ultimaker/cura/.github/workflows/[email protected]
with:
project_name: uranium

testing:
runs-on: ubuntu-20.04
needs: [ conan-recipe-version ]

steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Setup Python and pip
uses: actions/setup-python@v4
with:
python-version: '3.10.x'
architecture: 'x64'
cache: 'pip'
cache-dependency-path: .github/workflows/requirements-conan-package.txt

- name: Install Python requirements and Create default Conan profile
run: |
pip install -r requirements-conan-package.txt
conan profile new default --detect
working-directory: .github/workflows/

- name: Use Conan download cache (Bash)
if: ${{ runner.os != 'Windows' }}
run: conan config set storage.download_cache="$HOME/.conan/conan_download_cache"

- name: Install Linux system requirements
if: ${{ runner.os == 'Linux' }}
run: 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 -y

- name: Get Conan configuration
run: conan config install https://github.com/Ultimaker/conan-config.git

- name: Install dependencies
run: conan install . ${{ needs.conan-recipe-version.outputs.recipe_id_full }} --build=missing --update -o uranium:devtools=True -g VirtualPythonEnv -if venv

- name: Upload the Dependency package(s)
run: conan upload "*" -r cura --all -c

- name: Set Environment variables for Uranium (bash)
if: ${{ runner.os != 'Windows' }}
run: |
. ./venv/bin/activate_github_actions_env.sh
- name: Run Unit Test
id: run-test
run: |
pytest --junitxml=junit_uranium.xml
working-directory: tests

- name: Publish Unit Test Results
id: test-results
uses: EnricoMi/publish-unit-test-result-action@v1
if: ${{ always() }}
with:
files: |
tests/*.xml
- name: Conclusion
run: echo "Conclusion is ${{ fromJSON( steps.test-results.outputs.json ).conclusion }}"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,5 @@ resources/.DS_Store

#Common plug-ins
plugins/UraniumExample*Plugin
/conanbuildinfo.txt
/graph_info.json
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Copyright (c) 2022 Ultimaker B.V.
# Uranium is released under the terms of the LGPLv3 or higher.

# For MSVC flags, will be ignored on non-Windows OS's and this project in general. Only needed for cura-build-environment.
cmake_policy(SET CMP0091 NEW)
project(uranium NONE)

cmake_minimum_required(VERSION 3.18)
Expand Down
42 changes: 42 additions & 0 deletions GitVersion.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
mode: ContinuousDelivery
next-version: 5.1
branches:
main:
regex: ^main$
mode: ContinuousDelivery
tag: alpha
increment: None
prevent-increment-of-merged-branch-version: true
track-merge-target: false
source-branches: [ ]
tracks-release-branches: false
is-release-branch: false
is-mainline: true
pre-release-weight: 55000
develop:
regex: ^CURA-.*$
mode: ContinuousDelivery
tag: alpha
increment: None
prevent-increment-of-merged-branch-version: false
track-merge-target: true
source-branches: [ 'main' ]
tracks-release-branches: true
is-release-branch: false
is-mainline: false
pre-release-weight: 0
release:
regex: ^[\d].[\d]$
mode: ContinuousDelivery
tag: beta
increment: None
prevent-increment-of-merged-branch-version: true
track-merge-target: false
source-branches: [ 'main' ]
tracks-release-branches: false
is-release-branch: true
is-mainline: false
pre-release-weight: 30000
ignore:
sha: [ ]
merge-message-formats: { }
9 changes: 8 additions & 1 deletion UM/Application.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,14 @@ def initialize(self) -> None:
Resources.addSecureSearchPath(os.path.join(self._app_install_dir, "Resources", self._app_name, "resources"))

if not hasattr(sys, "frozen"):
Resources.addSecureSearchPath(os.path.join(os.path.abspath(os.path.dirname(__file__)), "..", "resources"))
Resources.addSearchPath(os.path.join(os.path.abspath(os.path.dirname(__file__)), "..", "resources"))

# local Conan cache
Resources.addSearchPath(os.path.join(os.path.abspath(os.path.dirname(__file__)), "..", "..", "resources"))
Resources.addSearchPath(os.path.join(os.path.abspath(os.path.dirname(__file__)), "..", "..", "plugins"))

# venv site-packages
Resources.addSearchPath(os.path.join(os.path.dirname(sys.executable), "..", "share", "uranium", "resources"))

i18nCatalog.setApplication(self)

Expand Down
3 changes: 2 additions & 1 deletion UM/Qt/qml/UM/Preferences/PreferencesDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import ".."

import UM 1.5 as UM

Dialog
UM.Dialog
{
id: base

Expand All @@ -19,6 +19,7 @@ Dialog
minimumHeight: UM.Theme.getSize("modal_window_minimum").height
width: minimumWidth
height: minimumHeight
backgroundColor: UM.Theme.getColor("main_background")

property alias currentPage: pagesList.currentIndex

Expand Down
2 changes: 1 addition & 1 deletion UM/Resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ def _getCacheStorageRootPath(cls) -> Optional[str]:
def __initializeStoragePaths(cls) -> None:
Logger.log("d", "Initializing storage paths")
# use nested structure: <app-name>/<version>/...
if cls.ApplicationVersion == "master" or cls.ApplicationVersion == "unknown":
if cls.ApplicationVersion in ["master", "main", "dev"] or cls.ApplicationVersion == "unknown":
storage_dir_name = os.path.join(cls.ApplicationIdentifier, cls.ApplicationVersion)
else:
version = Version(cls.ApplicationVersion)
Expand Down
16 changes: 16 additions & 0 deletions conandata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
"None":
requirements:
- "arcus/(latest)@ultimaker/cura_9365"
- "cpython/3.10.4"
"5.1.0":
requirements:
- "arcus/5.1.0"
- "cpython/3.10.4"
"5.1.0-beta":
requirements:
- "arcus/(latest)@ultimaker/stable"
- "cpython/3.10.4"
"5.1.0-alpha":
requirements:
- "arcus/(latest)@ultimaker/cura_9365"
- "cpython/3.10.4"
Loading

0 comments on commit 925e1f0

Please sign in to comment.