mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-05-15 09:08:04 +08:00
Merge branch 'main' into CURA-11137_update_pyqt6
# Conflicts: # conandata.yml
This commit is contained in:
commit
51a6e414a7
14
.github/workflows/conan-package.yml
vendored
14
.github/workflows/conan-package.yml
vendored
@ -31,26 +31,16 @@ env:
|
||||
CONAN_LOGIN_USERNAME_CURA: ${{ secrets.CONAN_USER }}
|
||||
CONAN_PASSWORD_CURA: ${{ secrets.CONAN_PASS }}
|
||||
|
||||
# FIXME: point to `main` once merged
|
||||
jobs:
|
||||
conan-recipe-version:
|
||||
uses: ultimaker/cura-workflows/.github/workflows/conan-recipe-version.yml@CURA-10831
|
||||
uses: ultimaker/cura-workflows/.github/workflows/conan-recipe-version.yml@main
|
||||
with:
|
||||
project_name: cura
|
||||
|
||||
conan-package-export:
|
||||
needs: [ conan-recipe-version ]
|
||||
uses: ultimaker/cura-workflows/.github/workflows/conan-recipe-export.yml@CURA-10831
|
||||
uses: ultimaker/cura-workflows/.github/workflows/conan-recipe-export.yml@main
|
||||
with:
|
||||
recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }}
|
||||
recipe_id_latest: ${{ needs.conan-recipe-version.outputs.recipe_id_latest }}
|
||||
secrets: inherit
|
||||
|
||||
conan-package-create-linux:
|
||||
needs: [ conan-recipe-version, conan-package-export ]
|
||||
|
||||
uses: ultimaker/cura-workflows/.github/workflows/conan-package-create-linux.yml@CURA-10831
|
||||
with:
|
||||
recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }}
|
||||
conan_extra_args: '-c tools.build:skip_test=True -o ${{ needs.conan-recipe-version.outputs.project_name }}:enable_i18n=True'
|
||||
secrets: inherit
|
||||
|
62
.github/workflows/installers.yml
vendored
62
.github/workflows/installers.yml
vendored
@ -39,57 +39,18 @@ env:
|
||||
CONAN_ARGS: ${{ inputs.conan_args || '' }}
|
||||
ENTERPRISE: ${{ inputs.enterprise || false }}
|
||||
STAGING: ${{ inputs.staging || false }}
|
||||
LATEST_RELEASE: '5.6'
|
||||
LATEST_RELEASE_SCHEDULE_HOUR: 4
|
||||
|
||||
jobs:
|
||||
default_values:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
cura_conan_version: ${{ steps.default.outputs.cura_conan_version }}
|
||||
release_tag: ${{ steps.default.outputs.release_tag }}
|
||||
uses: ultimaker/cura-workflows/.github/workflows/cura-installer-default-value.yml@main
|
||||
with:
|
||||
cura_conan_version: ${{ inputs.cura_conan_version }}
|
||||
latest_release: '5.6'
|
||||
latest_release_schedule_hour: 4
|
||||
latest_release_tag: 'nightly'
|
||||
|
||||
steps:
|
||||
- name: Output default values
|
||||
id: default
|
||||
shell: python
|
||||
run: |
|
||||
import os
|
||||
import datetime
|
||||
|
||||
if "${{ github.event_name }}" != "schedule":
|
||||
cura_conan_version = "${{ github.event.inputs.cura_conan_version }}"
|
||||
else:
|
||||
now = datetime.datetime.now()
|
||||
cura_conan_version = "cura/latest@ultimaker/stable" if now.hour == int(os.environ['LATEST_RELEASE_SCHEDULE_HOUR']) else "cura/latest@ultimaker/testing"
|
||||
|
||||
release_tag = f"nightly-{os.environ['LATEST_RELEASE']}" if "/stable" in cura_conan_version else "nightly"
|
||||
|
||||
# Set cura_conan_version environment variable
|
||||
output_env = os.environ["GITHUB_OUTPUT"]
|
||||
content = ""
|
||||
if os.path.exists(output_env):
|
||||
with open(output_env, "r") as f:
|
||||
content = f.read()
|
||||
with open(output_env, "w") as f:
|
||||
f.write(content)
|
||||
f.writelines(f"cura_conan_version={cura_conan_version}\n")
|
||||
f.writelines(f"release_tag={release_tag}\n")
|
||||
|
||||
summary_env = os.environ["GITHUB_STEP_SUMMARY"]
|
||||
content = ""
|
||||
if os.path.exists(summary_env):
|
||||
with open(summary_env, "r") as f:
|
||||
content = f.read()
|
||||
|
||||
with open(summary_env, "w") as f:
|
||||
f.write(content)
|
||||
f.writelines(f"# cura_conan_version = {cura_conan_version}\n")
|
||||
f.writelines(f"# release_tag = {release_tag}\n")
|
||||
|
||||
# FIXME: point to `main` once merged
|
||||
windows-installer:
|
||||
uses: ultimaker/cura-workflows/.github/workflows/cura-installer-windows.yml@CURA-10831
|
||||
uses: ultimaker/cura-workflows/.github/workflows/cura-installer-windows.yml@main
|
||||
needs: [ default_values ]
|
||||
with:
|
||||
cura_conan_version: ${{ needs.default_values.outputs.cura_conan_version }}
|
||||
@ -100,9 +61,8 @@ jobs:
|
||||
operating_system: windows-2022
|
||||
secrets: inherit
|
||||
|
||||
# FIXME: point to `main` once merged
|
||||
linux-installer:
|
||||
uses: ultimaker/cura-workflows/.github/workflows/cura-installer-linux.yml@CURA-10831
|
||||
uses: ultimaker/cura-workflows/.github/workflows/cura-installer-linux.yml@main
|
||||
needs: [ default_values ]
|
||||
with:
|
||||
cura_conan_version: ${{ needs.default_values.outputs.cura_conan_version }}
|
||||
@ -113,9 +73,8 @@ jobs:
|
||||
operating_system: ubuntu-22.04
|
||||
secrets: inherit
|
||||
|
||||
# FIXME: point to `main` once merged
|
||||
macos-installer:
|
||||
uses: ultimaker/cura-workflows/.github/workflows/cura-installer-macos.yml@CURA-10831
|
||||
uses: ultimaker/cura-workflows/.github/workflows/cura-installer-macos.yml@main
|
||||
needs: [ default_values ]
|
||||
with:
|
||||
cura_conan_version: ${{ needs.default_values.outputs.cura_conan_version }}
|
||||
@ -126,9 +85,8 @@ jobs:
|
||||
operating_system: self-hosted-X64
|
||||
secrets: inherit
|
||||
|
||||
# FIXME: point to `main` once merged
|
||||
macos-arm-installer:
|
||||
uses: ultimaker/cura-workflows/.github/workflows/cura-installer-macos.yml@CURA-10831
|
||||
uses: ultimaker/cura-workflows/.github/workflows/cura-installer-macos.yml@main
|
||||
needs: [ default_values ]
|
||||
with:
|
||||
cura_conan_version: ${{ needs.default_values.outputs.cura_conan_version }}
|
||||
|
57
.github/workflows/linux.yml
vendored
Normal file
57
.github/workflows/linux.yml
vendored
Normal file
@ -0,0 +1,57 @@
|
||||
name: Linux Installer
|
||||
run-name: ${{ inputs.cura_conan_version }} by @${{ github.actor }}
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
cura_conan_version:
|
||||
description: 'Cura Conan Version'
|
||||
default: 'cura/latest@ultimaker/testing'
|
||||
required: true
|
||||
type: string
|
||||
conan_args:
|
||||
description: 'Conan args: eq.: --require-override'
|
||||
default: ''
|
||||
required: false
|
||||
type: string
|
||||
enterprise:
|
||||
description: 'Build Cura as an Enterprise edition'
|
||||
default: false
|
||||
required: true
|
||||
type: boolean
|
||||
staging:
|
||||
description: 'Use staging API'
|
||||
default: false
|
||||
required: true
|
||||
type: boolean
|
||||
architecture:
|
||||
description: 'Architecture'
|
||||
required: true
|
||||
default: 'X64'
|
||||
type: choice
|
||||
options:
|
||||
- X64
|
||||
operating_system:
|
||||
description: 'OS'
|
||||
required: true
|
||||
default: 'ubuntu-22.04'
|
||||
type: choice
|
||||
options:
|
||||
- ubuntu-22.04
|
||||
|
||||
env:
|
||||
CONAN_ARGS: ${{ inputs.conan_args || '' }}
|
||||
ENTERPRISE: ${{ inputs.enterprise || false }}
|
||||
STAGING: ${{ inputs.staging || false }}
|
||||
|
||||
jobs:
|
||||
windows-installer:
|
||||
uses: ultimaker/cura-workflows/.github/workflows/cura-installer-linux.yml@main
|
||||
with:
|
||||
cura_conan_version: ${{ inputs.cura_conan_version }}
|
||||
conan_args: ${{ inputs.conan_args }}
|
||||
enterprise: ${{ inputs.enterprise == 'true' }}
|
||||
staging: ${{ inputs.staging == 'true' }}
|
||||
architecture: ${{ inputs.architecture }}
|
||||
operating_system: ${{ inputs.operating_system }}
|
||||
secrets: inherit
|
61
.github/workflows/macos.yml
vendored
Normal file
61
.github/workflows/macos.yml
vendored
Normal file
@ -0,0 +1,61 @@
|
||||
name: MacOS Installer
|
||||
run-name: ${{ inputs.cura_conan_version }} by @${{ github.actor }}
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
cura_conan_version:
|
||||
description: 'Cura Conan Version'
|
||||
default: 'cura/latest@ultimaker/testing'
|
||||
required: true
|
||||
type: string
|
||||
conan_args:
|
||||
description: 'Conan args: eq.: --require-override'
|
||||
default: ''
|
||||
required: false
|
||||
type: string
|
||||
enterprise:
|
||||
description: 'Build Cura as an Enterprise edition'
|
||||
default: false
|
||||
required: true
|
||||
type: boolean
|
||||
staging:
|
||||
description: 'Use staging API'
|
||||
default: false
|
||||
required: true
|
||||
type: boolean
|
||||
architecture:
|
||||
description: 'Architecture'
|
||||
required: true
|
||||
default: 'ARM64'
|
||||
type: choice
|
||||
options:
|
||||
- X64
|
||||
- ARM64
|
||||
operating_system:
|
||||
description: 'OS'
|
||||
required: true
|
||||
default: 'self-hosted-ARM64'
|
||||
type: choice
|
||||
options:
|
||||
- self-hosted-X64
|
||||
- self-hosted-ARM64
|
||||
- macos-11
|
||||
- macos-12
|
||||
|
||||
env:
|
||||
CONAN_ARGS: ${{ inputs.conan_args || '' }}
|
||||
ENTERPRISE: ${{ inputs.enterprise || false }}
|
||||
STAGING: ${{ inputs.staging || false }}
|
||||
|
||||
jobs:
|
||||
windows-installer:
|
||||
uses: ultimaker/cura-workflows/.github/workflows/cura-installer-macos.yml@main
|
||||
with:
|
||||
cura_conan_version: ${{ inputs.cura_conan_version }}
|
||||
conan_args: ${{ inputs.conan_args }}
|
||||
enterprise: ${{ inputs.enterprise == 'true' }}
|
||||
staging: ${{ inputs.staging == 'true' }}
|
||||
architecture: ${{ inputs.architecture }}
|
||||
operating_system: ${{ inputs.operating_system }}
|
||||
secrets: inherit
|
3
.github/workflows/process-pull-request.yml
vendored
3
.github/workflows/process-pull-request.yml
vendored
@ -4,8 +4,7 @@ on:
|
||||
pull_request_target:
|
||||
types: [ opened, reopened, edited, review_requested, ready_for_review, assigned ]
|
||||
|
||||
# FIXME: Use `main` instead of `CURA-10831` once merged
|
||||
jobs:
|
||||
add_label:
|
||||
uses: ultimaker/cura-workflows/.github/workflows/process-pull-request.yml@CURA-10831
|
||||
uses: ultimaker/cura-workflows/.github/workflows/process-pull-request.yml@main
|
||||
secrets: inherit
|
0
.github/workflows/requirements-runner.txt
vendored
Normal file
0
.github/workflows/requirements-runner.txt
vendored
Normal file
85
.github/workflows/unit-test-post.yml
vendored
85
.github/workflows/unit-test-post.yml
vendored
@ -1,82 +1,13 @@
|
||||
name: unit-test-post
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: [ "unit-test" ]
|
||||
types: [ completed ]
|
||||
workflow_run:
|
||||
workflows: [ "unit-test" ]
|
||||
types: [ completed ]
|
||||
|
||||
jobs:
|
||||
publish-test-results:
|
||||
if: ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' }}
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Download analysis results
|
||||
uses: actions/github-script@v3.1.0
|
||||
with:
|
||||
script: |
|
||||
let artifacts = await github.actions.listWorkflowRunArtifacts({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
run_id: ${{github.event.workflow_run.id }},
|
||||
});
|
||||
let matchArtifact = artifacts.data.artifacts.filter((artifact) => {
|
||||
return artifact.name == "test-result"
|
||||
})[0];
|
||||
let download = await github.actions.downloadArtifact({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
artifact_id: matchArtifact.id,
|
||||
archive_format: "zip",
|
||||
});
|
||||
let fs = require("fs");
|
||||
fs.writeFileSync("${{github.workspace}}/test-result.zip", Buffer.from(download.data));
|
||||
|
||||
- name: Set environment variables
|
||||
run: |
|
||||
mkdir pr_env
|
||||
unzip test-result.zip -d pr_env
|
||||
echo "pr_id=$(cat pr_env/pr-id.txt)" >> $GITHUB_ENV
|
||||
echo "pr_head_repo=$(cat pr_env/pr-head-repo.txt)" >> $GITHUB_ENV
|
||||
echo "pr_head_ref=$(cat pr_env/pr-head-ref.txt)" >> $GITHUB_ENV
|
||||
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
repository: ${{ env.pr_head_repo }}
|
||||
ref: ${{ env.pr_head_ref }}
|
||||
persist-credentials: false
|
||||
|
||||
- name: Redownload analysis results
|
||||
uses: actions/github-script@v3.1.0
|
||||
with:
|
||||
script: |
|
||||
let artifacts = await github.actions.listWorkflowRunArtifacts({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
run_id: ${{github.event.workflow_run.id }},
|
||||
});
|
||||
let matchArtifact = artifacts.data.artifacts.filter((artifact) => {
|
||||
return artifact.name == "test-result"
|
||||
})[0];
|
||||
let download = await github.actions.downloadArtifact({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
artifact_id: matchArtifact.id,
|
||||
archive_format: "zip",
|
||||
});
|
||||
let fs = require("fs");
|
||||
fs.writeFileSync("${{github.workspace}}/test-result.zip", Buffer.from(download.data));
|
||||
|
||||
- name: Extract analysis results
|
||||
run: |
|
||||
mkdir -p tests
|
||||
unzip test-result.zip -d tests
|
||||
|
||||
- name: Publish Unit Test Results
|
||||
id: test-results
|
||||
uses: EnricoMi/publish-unit-test-result-action@v1
|
||||
with:
|
||||
files: "tests/**/*.xml"
|
||||
|
||||
- name: Conclusion
|
||||
run: echo "Conclusion is ${{ steps.test-results.outputs.json && fromJSON( steps.test-results.outputs.json ).conclusion }}"
|
||||
publish-test-results:
|
||||
uses: ultimaker/cura-workflows/.github/workflows/unit-test-post.yml@main
|
||||
with:
|
||||
event: ${{ github.event.workflow_run.event }}
|
||||
conclusion: ${{ github.event.workflow_run.conclusion }}
|
||||
|
141
.github/workflows/unit-test.yml
vendored
141
.github/workflows/unit-test.yml
vendored
@ -1,4 +1,3 @@
|
||||
---
|
||||
name: unit-test
|
||||
|
||||
on:
|
||||
@ -9,23 +8,18 @@ on:
|
||||
- 'cura/**'
|
||||
- 'icons/**'
|
||||
- 'tests/**'
|
||||
- 'packaging/**'
|
||||
- '.github/workflows/conan-*.yml'
|
||||
- '.github/workflows/unit-test.yml'
|
||||
- '.github/workflows/notify.yml'
|
||||
- '.github/workflows/requirements-conan-package.txt'
|
||||
- '.github/workflows/requirements-runner.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'
|
||||
- 'PP-*'
|
||||
- '[0-9]+.[0-9]+'
|
||||
|
||||
pull_request:
|
||||
paths:
|
||||
- 'plugins/**'
|
||||
@ -33,134 +27,35 @@ on:
|
||||
- 'cura/**'
|
||||
- 'icons/**'
|
||||
- 'tests/**'
|
||||
- 'packaging/**'
|
||||
- '.github/workflows/conan-*.yml'
|
||||
- '.github/workflows/unit-test.yml'
|
||||
- '.github/workflows/notify.yml'
|
||||
- '.github/workflows/requirements-conan-package.txt'
|
||||
- '.github/workflows/requirements-runner.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
|
||||
- '[0-9]+.[0-9]+'
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
CONAN_LOGIN_USERNAME: ${{ secrets.CONAN_USER }}
|
||||
CONAN_PASSWORD: ${{ secrets.CONAN_PASS }}
|
||||
|
||||
jobs:
|
||||
conan-recipe-version:
|
||||
uses: ultimaker/cura-workflows/.github/workflows/conan-recipe-version.yml@CURA-10831
|
||||
uses: ultimaker/cura-workflows/.github/workflows/conan-recipe-version.yml@main
|
||||
with:
|
||||
project_name: cura
|
||||
|
||||
testing:
|
||||
runs-on: ubuntu-22.04
|
||||
uses: ultimaker/cura-workflows/.github/workflows/unit-test.yml@main
|
||||
needs: [ conan-recipe-version ]
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 2
|
||||
|
||||
- name: Setup Python and pip
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.11.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
|
||||
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: Cache Conan local repository packages (Bash)
|
||||
uses: actions/cache@v3
|
||||
if: ${{ runner.os != 'Windows' }}
|
||||
with:
|
||||
path: |
|
||||
$HOME/.conan/data
|
||||
$HOME/.conan/conan_download_cache
|
||||
key: conan-${{ runner.os }}-${{ runner.arch }}-unit-cache
|
||||
|
||||
# NOTE: Due to what are probably github issues, we have to remove the cache and reconfigure before the rest.
|
||||
# This is maybe because grub caches the disk it uses last time, which is recreated each time.
|
||||
- name: Install Linux system requirements
|
||||
if: ${{ runner.os == 'Linux' }}
|
||||
run: |
|
||||
sudo rm /var/cache/debconf/config.dat
|
||||
sudo dpkg --configure -a
|
||||
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
|
||||
sudo apt update
|
||||
sudo apt upgrade
|
||||
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
|
||||
|
||||
- name: Install GCC-13
|
||||
run: |
|
||||
sudo apt install g++-13 gcc-13 -y
|
||||
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 13
|
||||
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 13
|
||||
|
||||
- name: Get Conan configuration
|
||||
run: |
|
||||
conan config install https://github.com/Ultimaker/conan-config.git
|
||||
conan config install https://github.com/Ultimaker/conan-config.git -a "-b runner/${{ runner.os }}/${{ runner.arch }}"
|
||||
|
||||
- name: Get Conan profile
|
||||
run: conan profile new default --detect --force
|
||||
|
||||
- name: Install dependencies
|
||||
run: conan install . ${{ needs.conan-recipe-version.outputs.recipe_id_full }} --build=missing --update -o cura:devtools=True -g VirtualPythonEnv -if venv
|
||||
|
||||
- name: Upload the Dependency package(s)
|
||||
run: conan upload "*" -r cura --all -c
|
||||
|
||||
- name: Set Environment variables for Cura (bash)
|
||||
if: ${{ runner.os != 'Windows' }}
|
||||
run: |
|
||||
. ./venv/bin/activate_github_actions_env.sh
|
||||
|
||||
- name: Run Unit Test
|
||||
id: run-test
|
||||
run: |
|
||||
pytest --junitxml=junit_cura.xml
|
||||
working-directory: tests
|
||||
|
||||
- name: Save PR metadata
|
||||
if: always()
|
||||
run: |
|
||||
echo ${{ github.event.number }} > pr-id.txt
|
||||
echo ${{ github.event.pull_request.head.repo.full_name }} > pr-head-repo.txt
|
||||
echo ${{ github.event.pull_request.head.ref }} > pr-head-ref.txt
|
||||
working-directory: tests
|
||||
|
||||
- name: Upload Test Results
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: test-result
|
||||
path: |
|
||||
tests/**/*.xml
|
||||
tests/pr-id.txt
|
||||
tests/pr-head-repo.txt
|
||||
tests/pr-head-ref.txt
|
||||
with:
|
||||
recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }}
|
||||
conan_extra_args: '-g VirtualPythonEnv -o cura:devtools=True -c tools.build:skip_test=False'
|
||||
unit_test_cmd: 'pytest --junitxml=junit_cura.xml'
|
||||
unit_test_dir: 'tests'
|
||||
conan_generator_dir: './venv/bin'
|
57
.github/workflows/windows.yml
vendored
Normal file
57
.github/workflows/windows.yml
vendored
Normal file
@ -0,0 +1,57 @@
|
||||
name: Windows Installer
|
||||
run-name: ${{ inputs.cura_conan_version }} by @${{ github.actor }}
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
cura_conan_version:
|
||||
description: 'Cura Conan Version'
|
||||
default: 'cura/latest@ultimaker/testing'
|
||||
required: true
|
||||
type: string
|
||||
conan_args:
|
||||
description: 'Conan args: eq.: --require-override'
|
||||
default: ''
|
||||
required: false
|
||||
type: string
|
||||
enterprise:
|
||||
description: 'Build Cura as an Enterprise edition'
|
||||
default: false
|
||||
required: true
|
||||
type: boolean
|
||||
staging:
|
||||
description: 'Use staging API'
|
||||
default: false
|
||||
required: true
|
||||
type: boolean
|
||||
architecture:
|
||||
description: 'Architecture'
|
||||
required: true
|
||||
default: 'X64'
|
||||
type: choice
|
||||
options:
|
||||
- X64
|
||||
operating_system:
|
||||
description: 'OS'
|
||||
required: true
|
||||
default: 'windows-2022'
|
||||
type: choice
|
||||
options:
|
||||
- windows-2022
|
||||
|
||||
env:
|
||||
CONAN_ARGS: ${{ inputs.conan_args || '' }}
|
||||
ENTERPRISE: ${{ inputs.enterprise || false }}
|
||||
STAGING: ${{ inputs.staging || false }}
|
||||
|
||||
jobs:
|
||||
windows-installer:
|
||||
uses: ultimaker/cura-workflows/.github/workflows/cura-installer-windows.yml@main
|
||||
with:
|
||||
cura_conan_version: ${{ inputs.cura_conan_version }}
|
||||
conan_args: ${{ inputs.conan_args }}
|
||||
enterprise: ${{ inputs.enterprise == 'true' }}
|
||||
staging: ${{ inputs.staging == 'true' }}
|
||||
architecture: ${{ inputs.architecture }}
|
||||
operating_system: ${{ inputs.operating_system }}
|
||||
secrets: inherit
|
@ -1,18 +1,18 @@
|
||||
version: "5.7.0-alpha.0"
|
||||
requirements:
|
||||
- "uranium/(latest)@ultimaker/cura_11137"
|
||||
- "curaengine/(latest)@ultimaker/cura_10831"
|
||||
- "cura_binary_data/(latest)@ultimaker/cura_10831"
|
||||
- "fdm_materials/(latest)@ultimaker/cura_10831"
|
||||
- "curaengine_plugin_gradual_flow/0.1.0"
|
||||
- "dulcificum/latest@ultimaker/stable"
|
||||
- "curaengine/(latest)@ultimaker/testing"
|
||||
- "cura_binary_data/(latest)@ultimaker/testing"
|
||||
- "fdm_materials/(latest)@ultimaker/testing"
|
||||
- "curaengine_plugin_gradual_flow/(latest)@ultimaker/stable"
|
||||
- "dulcificum/latest@ultimaker/testing"
|
||||
- "pyarcus/5.3.0"
|
||||
- "pysavitar/5.3.0"
|
||||
- "pynest2d/5.3.0"
|
||||
- "curaengine_grpc_definitions/0.1.0"
|
||||
- "curaengine_grpc_definitions/(latest)@ultimaker/testing"
|
||||
requirements_internal:
|
||||
- "fdm_materials/(latest)@internal/cura_10831"
|
||||
- "cura_private_data/(latest)@internal/cura_10831"
|
||||
- "fdm_materials/(latest)@internal/testing"
|
||||
- "cura_private_data/(latest)@internal/testing"
|
||||
urls:
|
||||
default:
|
||||
cloud_api_root: "https://api.ultimaker.com"
|
||||
|
29
conanfile.py
29
conanfile.py
@ -4,7 +4,7 @@ from pathlib import Path
|
||||
from jinja2 import Template
|
||||
|
||||
from conan import ConanFile
|
||||
from conan.tools.files import copy, rmdir, save, mkdir, rm
|
||||
from conan.tools.files import copy, rmdir, save, mkdir, rm, update_conandata
|
||||
from conan.tools.microsoft import unix_path
|
||||
from conan.tools.env import VirtualRunEnv, Environment, VirtualBuildEnv
|
||||
from conan.tools.scm import Version
|
||||
@ -34,7 +34,7 @@ class CuraConan(ConanFile):
|
||||
"cloud_api_version": "ANY",
|
||||
"display_name": "ANY", # TODO: should this be an option??
|
||||
"cura_debug_mode": [True, False], # FIXME: Use profiles
|
||||
"internal": [True, False],
|
||||
"internal": ["True", "False", "true", "false"], # Workaround for GH Action passing boolean as lowercase string
|
||||
"enable_i18n": [True, False],
|
||||
}
|
||||
default_options = {
|
||||
@ -44,7 +44,7 @@ class CuraConan(ConanFile):
|
||||
"cloud_api_version": "1",
|
||||
"display_name": "UltiMaker Cura",
|
||||
"cura_debug_mode": False, # Not yet implemented
|
||||
"internal": False,
|
||||
"internal": "False",
|
||||
"enable_i18n": False,
|
||||
}
|
||||
|
||||
@ -72,7 +72,7 @@ class CuraConan(ConanFile):
|
||||
self._cura_env.define("QML2_IMPORT_PATH", str(self._site_packages.joinpath("PyQt6", "Qt6", "qml")))
|
||||
self._cura_env.define("QT_PLUGIN_PATH", str(self._site_packages.joinpath("PyQt6", "Qt6", "plugins")))
|
||||
if not self.in_local_cache:
|
||||
self._cura_env.define( "CURA_DATA_ROOT", str(self._share_dir.joinpath("cura")))
|
||||
self._cura_env.define("CURA_DATA_ROOT", str(self._share_dir.joinpath("cura")))
|
||||
|
||||
if self.settings.os == "Linux":
|
||||
self._cura_env.define("QT_QPA_FONTDIR", "/usr/share/fonts")
|
||||
@ -84,6 +84,10 @@ class CuraConan(ConanFile):
|
||||
def _enterprise(self):
|
||||
return self.options.enterprise in ["True", 'true']
|
||||
|
||||
@property
|
||||
def _internal(self):
|
||||
return self.options.internal in ["True", 'true']
|
||||
|
||||
@property
|
||||
def _app_name(self):
|
||||
if self._enterprise:
|
||||
@ -182,7 +186,7 @@ class CuraConan(ConanFile):
|
||||
cura_version = Version(self.conf.get("user.cura:version", default = self.version, check_type = str))
|
||||
pre_tag = f"-{cura_version.pre}" if cura_version.pre else ""
|
||||
build_tag = f"+{cura_version.build}" if cura_version.build else ""
|
||||
internal_tag = f"+internal" if self.options.internal else ""
|
||||
internal_tag = f"+internal" if self._internal else ""
|
||||
cura_version = f"{cura_version.major}.{cura_version.minor}.{cura_version.patch}{pre_tag}{build_tag}{internal_tag}"
|
||||
|
||||
with open(os.path.join(location, "CuraVersion.py"), "w") as f:
|
||||
@ -206,7 +210,7 @@ class CuraConan(ConanFile):
|
||||
pyinstaller_metadata = self.conan_data["pyinstaller"]
|
||||
datas = []
|
||||
for data in pyinstaller_metadata["datas"].values():
|
||||
if not self.options.internal and data.get("internal", False):
|
||||
if not self._internal and data.get("internal", False):
|
||||
continue
|
||||
|
||||
if "package" in data: # get the paths from conan package
|
||||
@ -285,6 +289,9 @@ class CuraConan(ConanFile):
|
||||
short_version = f"'{cura_version.major}.{cura_version.minor}.{cura_version.patch}'",
|
||||
))
|
||||
|
||||
def export(self):
|
||||
update_conandata(self, {"version": self.version})
|
||||
|
||||
def export_sources(self):
|
||||
copy(self, "*", os.path.join(self.recipe_folder, "plugins"), os.path.join(self.export_sources_folder, "plugins"))
|
||||
copy(self, "*", os.path.join(self.recipe_folder, "resources"), os.path.join(self.export_sources_folder, "resources"), excludes = "*.mo")
|
||||
@ -311,6 +318,8 @@ class CuraConan(ConanFile):
|
||||
if self.settings.os == "Linux":
|
||||
self.options["curaengine_grpc_definitions"].shared = True
|
||||
self.options["openssl"].shared = True
|
||||
if self.conf.get("user.curaengine:sentry_url", "", check_type=str) != "":
|
||||
self.options["curaengine"].enable_sentry = True
|
||||
|
||||
def validate(self):
|
||||
version = self.conf.get("user.cura:version", default = self.version, check_type = str)
|
||||
@ -319,13 +328,11 @@ class CuraConan(ConanFile):
|
||||
|
||||
def requirements(self):
|
||||
for req in self.conan_data["requirements"]:
|
||||
if self.options.internal and "fdm_materials" in req:
|
||||
if self._internal and "fdm_materials" in req:
|
||||
continue
|
||||
self.requires(req)
|
||||
if self.options.internal:
|
||||
if self._internal:
|
||||
for req in self.conan_data["requirements_internal"]:
|
||||
if "fdm_materials" in req:
|
||||
continue
|
||||
self.requires(req)
|
||||
self.requires("cpython/3.10.4@ultimaker/stable")
|
||||
self.requires("openssl/3.2.0")
|
||||
@ -392,7 +399,7 @@ class CuraConan(ConanFile):
|
||||
copy(self, "*", fdm_materials.resdirs[0], self.source_folder)
|
||||
|
||||
# Copy internal resources
|
||||
if self.options.internal:
|
||||
if self._internal:
|
||||
cura_private_data = self.dependencies["cura_private_data"].cpp_info
|
||||
copy(self, "*", cura_private_data.resdirs[0], str(self._share_dir.joinpath("cura")))
|
||||
|
||||
|
@ -241,14 +241,8 @@ class GridArrange(Arranger):
|
||||
center_grid_x = coord_grid_x + (0.5 * self._grid_width)
|
||||
center_grid_y = coord_grid_y + (0.5 * self._grid_height)
|
||||
|
||||
bounding_box = node.getBoundingBox()
|
||||
center_node_x = (bounding_box.left + bounding_box.right) * 0.5
|
||||
center_node_y = (bounding_box.back + bounding_box.front) * 0.5
|
||||
|
||||
delta_x = center_grid_x - center_node_x
|
||||
delta_y = center_grid_y - center_node_y
|
||||
|
||||
return TranslateOperation(node, Vector(delta_x, 0, delta_y))
|
||||
return TranslateOperation(node, Vector(center_grid_x, node.getWorldPosition().y, center_grid_y),
|
||||
set_position=True)
|
||||
|
||||
def _getGridCornerPoints(
|
||||
self,
|
||||
|
@ -163,6 +163,7 @@ class CuraEngineBackend(QObject, Backend):
|
||||
self._is_disabled: bool = False
|
||||
|
||||
application.getPreferences().addPreference("general/auto_slice", False)
|
||||
application.getPreferences().addPreference("info/send_engine_crash", True)
|
||||
|
||||
self._use_timer: bool = False
|
||||
|
||||
@ -173,6 +174,8 @@ class CuraEngineBackend(QObject, Backend):
|
||||
self._change_timer.setSingleShot(True)
|
||||
self._change_timer.setInterval(500)
|
||||
self.determineAutoSlicing()
|
||||
|
||||
|
||||
application.getPreferences().preferenceChanged.connect(self._onPreferencesChanged)
|
||||
|
||||
self._slicing_error_message = Message(
|
||||
@ -193,6 +196,9 @@ class CuraEngineBackend(QObject, Backend):
|
||||
|
||||
application.initializationFinished.connect(self.initialize)
|
||||
|
||||
# Ensure that the initial value for send_engine_crash is handled correctly.
|
||||
application.callLater(self._onPreferencesChanged, "info/send_engine_crash")
|
||||
|
||||
def startPlugins(self) -> None:
|
||||
"""
|
||||
Ensure that all backend plugins are started
|
||||
@ -1088,11 +1094,14 @@ class CuraEngineBackend(QObject, Backend):
|
||||
self._change_timer.timeout.disconnect(self.slice)
|
||||
|
||||
def _onPreferencesChanged(self, preference: str) -> None:
|
||||
if preference != "general/auto_slice":
|
||||
if preference != "general/auto_slice" and preference != "info/send_engine_crash":
|
||||
return
|
||||
auto_slice = self.determineAutoSlicing()
|
||||
if auto_slice:
|
||||
self._change_timer.start()
|
||||
if preference == "general/auto_slice":
|
||||
auto_slice = self.determineAutoSlicing()
|
||||
if auto_slice:
|
||||
self._change_timer.start()
|
||||
elif preference == "info/send_engine_crash":
|
||||
os.environ["use_sentry"] = "1" if CuraApplication.getInstance().getPreferences().getValue("info/send_engine_crash") else "0"
|
||||
|
||||
def tickle(self) -> None:
|
||||
"""Tickle the backend so in case of auto slicing, it starts the timer."""
|
||||
|
@ -329,6 +329,7 @@
|
||||
"machine_name": { "default_value": "UltiMaker Method" },
|
||||
"machine_nozzle_cool_down_speed": { "value": 0.8 },
|
||||
"machine_nozzle_heat_up_speed": { "value": 3.5 },
|
||||
"machine_scale_fan_speed_zero_to_one": { "value": true },
|
||||
"machine_start_gcode": { "default_value": "" },
|
||||
"material_bed_temperature": { "enabled": "machine_heated_bed" },
|
||||
"material_bed_temperature_layer_0": { "enabled": "machine_heated_bed" },
|
||||
|
@ -45,6 +45,16 @@ UM.Dialog
|
||||
anchors.centerIn: parent
|
||||
}
|
||||
|
||||
Image
|
||||
{
|
||||
id: enterpriseLogo
|
||||
visible: CuraApplication.isEnterprise
|
||||
source: UM.Theme.getImage("enterprise")
|
||||
fillMode: Image.PreserveAspectFit
|
||||
|
||||
anchors.bottom: parent.bottom
|
||||
}
|
||||
|
||||
UM.Label
|
||||
{
|
||||
id: version
|
||||
|
@ -120,6 +120,10 @@ UM.PreferencesPage
|
||||
|
||||
UM.Preferences.resetPreference("info/send_slice_info")
|
||||
sendDataCheckbox.checked = boolCheck(UM.Preferences.getValue("info/send_slice_info"))
|
||||
|
||||
UM.Preferences.resetPreference("info/send_engine_crash")
|
||||
sendEngineCrashCheckbox.checked = boolCheck(UM.Preferences.getValue("info/send_engine_crash"))
|
||||
|
||||
UM.Preferences.resetPreference("info/automatic_update_check")
|
||||
checkUpdatesCheckbox.checked = boolCheck(UM.Preferences.getValue("info/automatic_update_check"))
|
||||
|
||||
@ -855,6 +859,21 @@ UM.PreferencesPage
|
||||
font: UM.Theme.getFont("medium_bold")
|
||||
text: catalog.i18nc("@label", "Privacy")
|
||||
}
|
||||
UM.TooltipArea
|
||||
{
|
||||
width: childrenRect.width
|
||||
height: visible ? childrenRect.height : 0
|
||||
text: catalog.i18nc("@info:tooltip", "Should slicing crashes be automatically reported to Ultimaker? Note, no models, IP addresses or other personally identifiable information is sent or stored.")
|
||||
|
||||
UM.CheckBox
|
||||
{
|
||||
id: sendEngineCrashCheckbox
|
||||
text: catalog.i18nc("@option:check","Send (anonymous) engine crash reports")
|
||||
checked: boolCheck(UM.Preferences.getValue("info/send_engine_crash"))
|
||||
onCheckedChanged: UM.Preferences.setValue("info/send_engine_crash", checked)
|
||||
}
|
||||
}
|
||||
|
||||
UM.TooltipArea
|
||||
{
|
||||
width: childrenRect.width
|
||||
|
BIN
resources/themes/cura-light/images/enterprise.png
Normal file
BIN
resources/themes/cura-light/images/enterprise.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.4 KiB |
Loading…
x
Reference in New Issue
Block a user