Skip to content

Commit

Permalink
Merge pull request #981 from Ultimaker/CURA-11622_conan_v2
Browse files Browse the repository at this point in the history
Cura 11622 conan v2
  • Loading branch information
wawanbreton authored Dec 4, 2024
2 parents f7e5334 + c9e7c81 commit 9f38cba
Show file tree
Hide file tree
Showing 12 changed files with 471 additions and 456 deletions.
31 changes: 7 additions & 24 deletions .github/workflows/conan-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,37 +8,20 @@ on:
- 'UM/**'
- 'conanfile.py'
- 'conandata.yml'
- 'requirements*.txt'
- '.github/workflows/requirements-runner.txt'
- '.github/workflows/conan-package.yml'
branches:
- main
- 'CURA-*'
- 'PP-*'
- 'NP-*'
- '[0-9].[0-9]*'
- '[0-9].[0-9][0-9]*'

env:
CONAN_LOGIN_USERNAME_CURA: ${{ secrets.CONAN_USER }}
CONAN_PASSWORD_CURA: ${{ secrets.CONAN_PASS }}
-

jobs:
conan-recipe-version:
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@main
conan-package:
uses: ultimaker/cura-workflows/.github/workflows/conan-package.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 }}
platform_windows: false
platform_mac: false
secrets: inherit

conan-package-create:
needs: [ conan-recipe-version, conan-package-export ]
uses: ultimaker/cura-workflows/.github/workflows/conan-package-create-linux.yml@main
with:
recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }}
conan_extra_args: "-o uranium:enable_i18n=True"
secrets: inherit
Empty file.
3 changes: 2 additions & 1 deletion .github/workflows/unit-test-post.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: unit-test-post

on:
workflow_run:
workflows: [ "unit-test" ]
workflows: [ unit-test ]
types: [ completed ]

jobs:
Expand All @@ -11,3 +11,4 @@ jobs:
with:
event: ${{ github.event.workflow_run.event }}
conclusion: ${{ github.event.workflow_run.conclusion }}
secrets: inherit
22 changes: 2 additions & 20 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
---
name: unit-test
# FIXME: This should be a reusable workflow

on:
push:
Expand Down Expand Up @@ -36,25 +34,9 @@ on:
- main
- '[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@main
with:
project_name: uranium

testing:
name: Run unit tests
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 }}
conan_extra_args: '-g VirtualPythonEnv -o uranium:devtools=True -c tools.build:skip_test=False --options "*:enable_sentry=False"'
unit_test_cmd: 'pytest --junitxml=junit_uranium.xml'
unit_test_dir: 'tests'
conan_generator_dir: './venv/bin'
test_use_pytest: true
82 changes: 10 additions & 72 deletions .github/workflows/update-translation.yml
Original file line number Diff line number Diff line change
@@ -1,77 +1,15 @@
name: update-translations
name: Update translations

on:
push:
paths:
- 'plugins/**'
- 'resources/**'
- 'UM/**'
- 'conanfile.py'
- 'conandata.yml'
- '.github/workflows/conan-*.yml'
- '.github/workflows/notify.yml'
- '.github/workflows/requirements-conan-package.txt'
- 'requirements*.txt'
- 'conanfile.py'
- 'conandata.yml'
- 'GitVersion.yml'
- '*.jinja'
workflow_dispatch:
inputs:
branch:
description: 'Specific branch to update translations on'
required: false
type: string

jobs:
update-translations:
name: Update translations

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 efibootmgr 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

- name: generate the files using Conan install
run: conan install . --build=missing --update -o uranium:devtools=True

- uses: stefanzweifel/git-auto-commit-action@v4
with:
file_pattern: resources/i18n/*.po resources/i18n/*.pot
status_options: --untracked-files=no
commit_message: update translations
uses: ultimaker/cura-workflows/.github/workflows/update-translations.yml@main
with:
branch: ${{ inputs.branch }}
Loading

0 comments on commit 9f38cba

Please sign in to comment.