From 69d3a867d2604bdb65416790542db0812f57cde5 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Sat, 11 Nov 2023 08:54:22 +0100 Subject: [PATCH 01/13] Set requirements and version with conandata This will allow workflow automations to easily create release branches and set the versions Contributes to CURA-10831 --- conandata.yml | 1 + conanfile.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 conandata.yml diff --git a/conandata.yml b/conandata.yml new file mode 100644 index 000000000..16850d180 --- /dev/null +++ b/conandata.yml @@ -0,0 +1 @@ +version: "5.6.0-beta.1" \ No newline at end of file diff --git a/conanfile.py b/conanfile.py index 42d3ace69..7164dd704 100644 --- a/conanfile.py +++ b/conanfile.py @@ -34,7 +34,7 @@ class UraniumConan(ConanFile): def set_version(self): if not self.version: - self.version = "5.6.0-beta.1" + self.version = self.conan_data["version"] @property def _base_dir(self): From 81d40008b3726dc67c66068e39646eb8b7e1b048 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Sat, 11 Nov 2023 08:59:52 +0100 Subject: [PATCH 02/13] Use cura-workflows to determine version Contributes to CURA-10831 --- .github/workflows/conan-package.yml | 2 +- .github/workflows/unit-test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/conan-package.yml b/.github/workflows/conan-package.yml index fecbef851..405c79870 100644 --- a/.github/workflows/conan-package.yml +++ b/.github/workflows/conan-package.yml @@ -38,7 +38,7 @@ env: jobs: conan-recipe-version: - uses: ultimaker/cura/.github/workflows/conan-recipe-version.yml@main + uses: ultimaker/cura-workflows/.github/workflows/conan-recipe-version.yml@CURA-10831 with: project_name: uranium diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 821217deb..6b531c908 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -61,7 +61,7 @@ env: jobs: conan-recipe-version: - uses: ultimaker/cura/.github/workflows/conan-recipe-version.yml@main + uses: ultimaker/cura-workflows/.github/workflows/conan-recipe-version.yml@CURA-10831 with: project_name: uranium From 01da29514cdc19e3a817afbd0a7b36b624f27729 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Sat, 11 Nov 2023 10:42:04 +0100 Subject: [PATCH 03/13] add release tagging info to conandata Contributes to CURA-10831 --- conandata.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/conandata.yml b/conandata.yml index 16850d180..f24ef450c 100644 --- a/conandata.yml +++ b/conandata.yml @@ -1 +1,2 @@ -version: "5.6.0-beta.1" \ No newline at end of file +version: "5.6.0-beta.1" +release: false \ No newline at end of file From 55a5261005d44389f42e08628a540372d865bcdc Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Sat, 11 Nov 2023 11:59:56 +0100 Subject: [PATCH 04/13] don't set release from conandata.yml Contributes to CURA-10831 --- conandata.yml | 3 ++- conanfile.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/conandata.yml b/conandata.yml index f24ef450c..58b8a6142 100644 --- a/conandata.yml +++ b/conandata.yml @@ -1,2 +1,3 @@ version: "5.6.0-beta.1" -release: false \ No newline at end of file +requirements: + - "pyarcus/5.3.0" \ No newline at end of file diff --git a/conanfile.py b/conanfile.py index 7164dd704..b450e2a6b 100644 --- a/conanfile.py +++ b/conanfile.py @@ -95,7 +95,8 @@ def validate(self): raise ConanInvalidConfiguration("Only versions 5+ are support") def requirements(self): - self.requires("pyarcus/5.3.0") + for req in self.conan_data["requirements"]: + self.requires(req) self.requires("cpython/3.10.4") def build_requirements(self): From 5f931ad04451f63eb57208a614b5c78100d21e19 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Sat, 11 Nov 2023 19:02:45 +0100 Subject: [PATCH 05/13] use conan-recipe-export from cura-workflows This commit updates the Uranium dependency in the Conan file and introduces an internationalization (i18n) option. It refactor the devtool checks to check for the "enable_i18n" option instead. Lastly, cleanups and adjustments are done in preparation for enabling i18n in the build process. Contributes to CURA-10831 --- .github/workflows/conan-package.yml | 107 +++--------------- .../workflows/requirements-conan-package.txt | 2 - .github/workflows/requirements-runner.txt | 0 conanfile.py | 56 ++++----- 4 files changed, 46 insertions(+), 119 deletions(-) delete mode 100644 .github/workflows/requirements-conan-package.txt create mode 100644 .github/workflows/requirements-runner.txt diff --git a/.github/workflows/conan-package.yml b/.github/workflows/conan-package.yml index 405c79870..f54d7987b 100644 --- a/.github/workflows/conan-package.yml +++ b/.github/workflows/conan-package.yml @@ -1,11 +1,5 @@ ---- 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: @@ -16,105 +10,36 @@ on: - 'conandata.yml' - 'requirements*.txt' - '.github/workflows/conan-package.yml' - - '.github/workflows/requirements-conan-package.txt' + - '.github/workflows/requirements-runner.txt' branches: - main - 'CURA-*' - - '[1-9].[0-9]*' - - '[1-9].[0-9][0-9]*' + - 'PP-*' + - '[0-9].[0-9]*' + - '[0-9].[0-9][0-9]*' tags: - - '[1-9].[0-9].[0-9]*' - - '[1-9].[0-9].[0-9]' - - '[1-9].[0-9][0-9].[0-9]*' + - '[0-9].[0-9].[0-9]*' + - '[0-9].[0-9].[0-9]' + - '[0-9].[0-9][0-9].[0-9]*' 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 +# FIXME: point to `main` once merged jobs: conan-recipe-version: uses: ultimaker/cura-workflows/.github/workflows/conan-recipe-version.yml@CURA-10831 with: project_name: uranium - conan-package-create-linux: + conan-package-export-linux: needs: [ conan-recipe-version ] - runs-on: 'ubuntu-latest' - - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Cache Conan data - id: cache-conan - uses: actions/cache@v3 - with: - path: ~/.conan - key: ${{ runner.os }}-conan - - - name: Setup Python and pip - uses: actions/setup-python@v4 - with: - python-version: '3.11.x' - cache: 'pip' - cache-dependency-path: .github/workflows/requirements-conan-package.txt - - - name: Install Python requirements for runner - run: pip install -r .github/workflows/requirements-conan-package.txt - - # 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 flex bison g++-12 gcc-12 -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: Create the default Conan profile - run: conan profile new default --detect --force - - - 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: Create the Packages - run: conan create . ${{ needs.conan-recipe-version.outputs.recipe_id_full }} --build=missing --update -o ${{ needs.conan-recipe-version.outputs.project_name }}:devtools=True -c tools.build:skip_test=True - - - name: Create the latest alias - if: always() - run: conan alias ${{ needs.conan-recipe-version.outputs.recipe_id_latest }} ${{ needs.conan-recipe-version.outputs.recipe_id_full }} - - - name: Upload the Package(s) - if: always() - run: | - conan upload ${{ needs.conan-recipe-version.outputs.recipe_id_full }} -r cura --all -c - conan upload ${{ needs.conan-recipe-version.outputs.recipe_id_latest }} -r cura -c - - notify-create: - if: ${{ always() && (github.event_name == 'push' && (github.ref_name == 'main' || github.ref_name == 'master' || needs.conan-recipe-version.outputs.is_release_branch == 'true')) }} - needs: [ conan-recipe-version, conan-package-create-linux ] - - uses: ultimaker/cura/.github/workflows/notify.yml@main + uses: ultimaker/cura-workflows/.github/workflows/conan-recipe-export.yml@CURA-10831 with: - success: ${{ contains(join(needs.*.result, ','), 'success') }} - success_title: "New binaries created in ${{ github.repository }}" - success_body: "Created binaries for ${{ needs.conan-recipe-version.outputs.recipe_id_full }}" - failure_title: "Failed to create binaries in ${{ github.repository }}" - failure_body: "Failed to created binaries for ${{ needs.conan-recipe-version.outputs.recipe_id_full }}" - secrets: inherit + recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }} + recipe_id_latest: ${{ needs.conan-recipe-version.outputs.recipe_id_latest }} + update_system_requirements: true + conan_export_binaries: true + conan_extra_args: '-c tools.build:skip_test=True -o ${{ needs.conan-recipe-version.outputs.project_name }}:enable_i18n=True' + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/requirements-conan-package.txt b/.github/workflows/requirements-conan-package.txt deleted file mode 100644 index 9380d1cb9..000000000 --- a/.github/workflows/requirements-conan-package.txt +++ /dev/null @@ -1,2 +0,0 @@ -conan>=1.60.2,<2.0.0 -sip diff --git a/.github/workflows/requirements-runner.txt b/.github/workflows/requirements-runner.txt new file mode 100644 index 000000000..e69de29bb diff --git a/conanfile.py b/conanfile.py index b450e2a6b..4ffe8afb0 100644 --- a/conanfile.py +++ b/conanfile.py @@ -4,14 +4,13 @@ from conan import ConanFile from conan.tools.env import VirtualBuildEnv, VirtualRunEnv -from conan.tools.files import copy, mkdir +from conan.tools.files import copy, mkdir, update_conandata from conan.tools.microsoft import unix_path from conan.tools.scm import Version from conan.errors import ConanInvalidConfiguration required_conan_version = ">=1.58.0 <2.0.0" - class UraniumConan(ConanFile): name = "uranium" license = "LGPL-3.0" @@ -22,14 +21,15 @@ class UraniumConan(ConanFile): exports = "LICENSE*" settings = "os", "compiler", "build_type", "arch" - python_requires = "umbase/[>=0.1.7]@ultimaker/stable", "translationextractor/[>=2.1.2]@ultimaker/stable" - python_requires_extend = "umbase.UMBaseConanfile" + python_requires = "translationextractor/[>=2.1.2]@ultimaker/stable" options = { - "devtools": [True, False] + "devtools": [True, False], + "enable_i18n": [True, False], } default_options = { "devtools": False, + "enable_i18n": False, } def set_version(self): @@ -77,6 +77,9 @@ def _py_interp(self): py_interp = Path(*[f'"{p}"' if " " in p else p for p in py_interp.parts]) return py_interp + 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") @@ -85,6 +88,10 @@ def export_sources(self): copy(self, "requirements.txt", self.recipe_folder, self.export_sources_folder) copy(self, "requirements-dev.txt", self.recipe_folder, self.export_sources_folder) + def config_options(self): + if self.settings.os == "Windows" and not self.conf.get("tools.microsoft.bash:path", check_type=str): + del self.options.enable_i18n + def configure(self): self.options["pyarcus"].shared = True self.options["cpython"].shared = True @@ -100,35 +107,31 @@ def requirements(self): self.requires("cpython/3.10.4") def build_requirements(self): - if self.options.devtools: - if self.settings.os != "Windows" or self.conf.get("tools.microsoft.bash:path", check_type = str): - # FIXME: once m4, autoconf, automake are Conan V2 ready use self.win_bash and add gettext as base tool_requirement - self.tool_requires("gettext/0.21@ultimaker/testing", force_host_context = True) + if self.options.get_safe("enable_i18n", False): + self.tool_requires("gettext/0.21@ultimaker/testing", force_host_context = True) def generate(self): vr = VirtualRunEnv(self) vr.generate() - if self.options.devtools: - if self.settings.os != "Windows" or self.conf.get("tools.microsoft.bash:path", check_type=str): - vb = VirtualBuildEnv(self) - vb.generate() + if self.options.get_safe("enable_i18n", False): + # Update the po and pot files + vb = VirtualBuildEnv(self) + vb.generate() - # FIXME: once m4, autoconf, automake are Conan V2 ready use self.win_bash and add gettext as base tool_requirement - cpp_info = self.dependencies["gettext"].cpp_info - pot = self.python_requires["translationextractor"].module.ExtractTranslations(self, cpp_info.bindirs[0]) - pot.generate() + # # FIXME: once m4, autoconf, automake are Conan V2 ready use self.win_bash and add gettext as base tool_requirement + cpp_info = self.dependencies["gettext"].cpp_info + pot = self.python_requires["translationextractor"].module.ExtractTranslations(self, cpp_info.bindirs[0]) + pot.generate() def build(self): - if self.options.devtools: - if self.settings.os != "Windows" or self.conf.get("tools.microsoft.bash:path", check_type = str): - # FIXME: once m4, autoconf, automake are Conan V2 ready use self.win_bash and add gettext as base tool_requirement - for po_file in self.source_path.joinpath("resources", "i18n").glob("**/*.po"): - mo_file = Path(self.build_folder, po_file.with_suffix('.mo').relative_to(self.source_path)) - mo_file = mo_file.parent.joinpath("LC_MESSAGES", mo_file.name) - mkdir(self, str(unix_path(self, Path(mo_file).parent))) - cpp_info = self.dependencies["gettext"].cpp_info - self.run(f"{cpp_info.bindirs[0]}/msgfmt {po_file} -o {mo_file} -f", env="conanbuild", ignore_errors=True) + if self.options.get_safe("enable_i18n", False): + for po_file in self.source_path.joinpath("resources", "i18n").glob("**/*.po"): + mo_file = Path(self.build_folder, po_file.with_suffix('.mo').relative_to(self.source_path)) + mo_file = mo_file.parent.joinpath("LC_MESSAGES", mo_file.name) + mkdir(self, str(unix_path(self, Path(mo_file).parent))) + cpp_info = self.dependencies["gettext"].cpp_info + self.run(f"{cpp_info.bindirs[0]}/msgfmt {po_file} -o {mo_file} -f", env="conanbuild", ignore_errors=True) def layout(self): self.folders.source = "." @@ -160,4 +163,5 @@ def package_id(self): self.info.clear() del self.info.options.devtools + self.options.rm_safe("enable_i18n") From 31b61e0f18abe07d4a296824637da83a38efbc1a Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Mon, 13 Nov 2023 11:23:48 +0100 Subject: [PATCH 06/13] Don't decouple export and system update Contributes to CURA-10831 --- .github/workflows/conan-package.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/conan-package.yml b/.github/workflows/conan-package.yml index f54d7987b..90e20b672 100644 --- a/.github/workflows/conan-package.yml +++ b/.github/workflows/conan-package.yml @@ -39,7 +39,6 @@ jobs: with: recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }} recipe_id_latest: ${{ needs.conan-recipe-version.outputs.recipe_id_latest }} - update_system_requirements: true conan_export_binaries: true conan_extra_args: '-c tools.build:skip_test=True -o ${{ needs.conan-recipe-version.outputs.project_name }}:enable_i18n=True' secrets: inherit \ No newline at end of file From 8044971b2e88905b6b988c951ec3bce525ff9463 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Thu, 16 Nov 2023 11:36:20 +0100 Subject: [PATCH 07/13] Create the Uranium binaries Contributes to CURA-10831 --- .github/workflows/conan-package.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/conan-package.yml b/.github/workflows/conan-package.yml index 90e20b672..4509d74b1 100644 --- a/.github/workflows/conan-package.yml +++ b/.github/workflows/conan-package.yml @@ -9,7 +9,6 @@ on: - 'conanfile.py' - 'conandata.yml' - 'requirements*.txt' - - '.github/workflows/conan-package.yml' - '.github/workflows/requirements-runner.txt' branches: - main @@ -33,12 +32,19 @@ jobs: with: project_name: uranium - conan-package-export-linux: + conan-package-export: needs: [ conan-recipe-version ] uses: ultimaker/cura-workflows/.github/workflows/conan-recipe-export.yml@CURA-10831 with: recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }} recipe_id_latest: ${{ needs.conan-recipe-version.outputs.recipe_id_latest }} - conan_export_binaries: true + 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 \ No newline at end of file From 827bfaa70bbd5d68e92e0b7982e9125fc120f37d Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Mon, 27 Nov 2023 08:10:34 +0100 Subject: [PATCH 08/13] Merge main and update versions Contribute to CURA-10831 --- conandata.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conandata.yml b/conandata.yml index 58b8a6142..0e5b93b24 100644 --- a/conandata.yml +++ b/conandata.yml @@ -1,3 +1,3 @@ -version: "5.6.0-beta.1" +version: "5.7.0-alpha.0" requirements: - "pyarcus/5.3.0" \ No newline at end of file From 4b0060abc8856f0654757d9ec1c89796f89fdeb4 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Tue, 5 Dec 2023 06:17:52 +0100 Subject: [PATCH 09/13] Use cura-workflows unit-test Contributes to CURA-10831 --- .github/workflows/unit-test.yml | 136 ++++---------------------------- 1 file changed, 16 insertions(+), 120 deletions(-) diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 6b531c908..2bc548db7 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -9,23 +9,17 @@ on: - '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' + - 'PP-*' + - '[0-9]+.[0-9]+' + pull_request: paths: - 'plugins/**' @@ -33,31 +27,21 @@ on: - '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' + - '[0-9]+.[0-9]+' + +permissions: + contents: read 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 + CONAN_LOGIN_USERNAME: ${{ secrets.CONAN_USER }} + CONAN_PASSWORD: ${{ secrets.CONAN_PASS }} jobs: conan-recipe-version: @@ -66,99 +50,11 @@ jobs: project_name: uranium testing: - runs-on: ubuntu-20.04 + uses: ultimaker/cura-workflows/.github/workflows/unit-test.yml@CURA-10831 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" - - # 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: 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: 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: Upload Test Results - if: always() - uses: actions/upload-artifact@v3 - with: - name: Test Results - path: "tests/**/*.xml" - - publish-test-results: - runs-on: ubuntu-20.04 - needs: [ testing ] - if: success() || failure() - - steps: - - name: Checkout - 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: Download Artifacts - uses: actions/download-artifact@v3 - with: - path: artifacts - - - name: Publish Unit Test Results - id: test-results - uses: EnricoMi/publish-unit-test-result-action@v1 - with: - files: "artifacts/**/*.xml" - - - name: Conclusion - run: echo "Conclusion is ${{ steps.test-results.outputs.json && fromJSON( steps.test-results.outputs.json ).conclusion }}" + 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' From d268e2902ae69e7311ec3a878d2ddfcabb1ff0e3 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Tue, 5 Dec 2023 07:17:56 +0100 Subject: [PATCH 10/13] Post the unit test result on PR's Contributes to CURA-10831 --- .github/workflows/unit-test-post.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .github/workflows/unit-test-post.yml diff --git a/.github/workflows/unit-test-post.yml b/.github/workflows/unit-test-post.yml new file mode 100644 index 000000000..119ca30f3 --- /dev/null +++ b/.github/workflows/unit-test-post.yml @@ -0,0 +1,13 @@ +name: unit-test-post + +on: + workflow_run: + workflows: [ "unit-test" ] + types: [ completed ] + +jobs: + publish-test-results: + uses: ultimaker/cura-workflows/.github/workflows/unit-test-post.yml@CURA-10831 + with: + event: ${{ github.event.workflow_run.event }} + conclusion: ${{ github.event.workflow_run.conclusion }} From aecc29a3bb167a23c4795fd67fbb483aa90bf917 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Tue, 5 Dec 2023 07:18:57 +0100 Subject: [PATCH 11/13] Add FIXME reminder Contributes to CURA-10831 --- .github/workflows/unit-test-post.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/unit-test-post.yml b/.github/workflows/unit-test-post.yml index 119ca30f3..23d4e5f8a 100644 --- a/.github/workflows/unit-test-post.yml +++ b/.github/workflows/unit-test-post.yml @@ -6,6 +6,7 @@ on: types: [ completed ] jobs: + # FIXME: Use `main` instead of `CURA-10831` once merged publish-test-results: uses: ultimaker/cura-workflows/.github/workflows/unit-test-post.yml@CURA-10831 with: From a413936151cd21d43e8078043c05a2ca8637e7b7 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Fri, 8 Dec 2023 07:42:05 +0100 Subject: [PATCH 12/13] No need to create a conan-package Contributes to CURA-10831 --- .github/workflows/conan-package.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/conan-package.yml b/.github/workflows/conan-package.yml index 4509d74b1..459f6648e 100644 --- a/.github/workflows/conan-package.yml +++ b/.github/workflows/conan-package.yml @@ -38,13 +38,4 @@ jobs: 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 \ No newline at end of file From b250645cbb19120851e16a959649f93fc48cab7a Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Fri, 8 Dec 2023 14:31:30 +0100 Subject: [PATCH 13/13] Apply suggestions from code review Co-authored-by: Casper Lamboo --- .github/workflows/conan-package.yml | 5 ++--- .github/workflows/unit-test-post.yml | 3 +-- .github/workflows/unit-test.yml | 4 ++-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/conan-package.yml b/.github/workflows/conan-package.yml index 459f6648e..9c04dde48 100644 --- a/.github/workflows/conan-package.yml +++ b/.github/workflows/conan-package.yml @@ -25,16 +25,15 @@ 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: uranium 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 }} diff --git a/.github/workflows/unit-test-post.yml b/.github/workflows/unit-test-post.yml index 23d4e5f8a..eaf69692a 100644 --- a/.github/workflows/unit-test-post.yml +++ b/.github/workflows/unit-test-post.yml @@ -6,9 +6,8 @@ on: types: [ completed ] jobs: - # FIXME: Use `main` instead of `CURA-10831` once merged publish-test-results: - uses: ultimaker/cura-workflows/.github/workflows/unit-test-post.yml@CURA-10831 + uses: ultimaker/cura-workflows/.github/workflows/unit-test-post.yml@main with: event: ${{ github.event.workflow_run.event }} conclusion: ${{ github.event.workflow_run.conclusion }} diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index 2bc548db7..65cc28eb1 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -45,12 +45,12 @@ env: 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: uranium testing: - uses: ultimaker/cura-workflows/.github/workflows/unit-test.yml@CURA-10831 + uses: ultimaker/cura-workflows/.github/workflows/unit-test.yml@main needs: [ conan-recipe-version ] with: recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }}