Skip to content

Commit

Permalink
Cura 11622 conan v2 (#2178)
Browse files Browse the repository at this point in the history
  • Loading branch information
wawanbreton authored Dec 4, 2024
2 parents 1812a2e + 38fbb28 commit 2837bc1
Show file tree
Hide file tree
Showing 16 changed files with 81 additions and 375 deletions.
17 changes: 2 additions & 15 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,30 +28,17 @@ permissions:
contents: write
deployments: write

env:
CONAN_LOGIN_USERNAME: ${{ secrets.CONAN_USER }}
CONAN_PASSWORD: ${{ secrets.CONAN_PASS }}


jobs:
check_actor:
uses: ultimaker/cura-workflows/.github/workflows/check-actor.yml@main
secrets: inherit

conan-recipe-version:
needs: [ check_actor ]
if: ${{ needs.check_actor.outputs.proceed == 'true' }}
uses: ultimaker/cura-workflows/.github/workflows/conan-recipe-version.yml@main
with:
project_name: curaengine

benchmark:
needs: [ conan-recipe-version ]
uses: ultimaker/cura-workflows/.github/workflows/benchmark.yml@main
with:
recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }}
conan_extra_args: "-o curaengine:enable_benchmarks=True"
benchmark_cmd: "benchmark/benchmarks --benchmark_format=json --benchmark_out=benchmark_result.json"
conan_extra_args: "-o \"curaengine/*:enable_benchmarks=True\""
benchmark_cmd: "./build/Release/benchmark/benchmarks --benchmark_format=json --benchmark_out=benchmark_result.json"
name: "C++ Benchmark"
output_file_path: "build/Release/benchmark_result.json"
data_dir: "dev/bench"
Expand Down
45 changes: 3 additions & 42 deletions .github/workflows/conan-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,47 +39,8 @@ on:
- '[0-9].[0-9][0-9]*'

jobs:
conan-recipe-version:
uses: ultimaker/cura-workflows/.github/workflows/conan-recipe-version.yml@main
conan-package:
uses: ultimaker/cura-workflows/.github/workflows/conan-package.yml
with:
project_name: curaengine

conan-package-export:
needs: [ conan-recipe-version ]
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-macos:
needs: [ conan-recipe-version, conan-package-export ]
if: ${{ ((github.event_name == 'push' && (github.ref_name == 'main' || needs.conan-recipe-version.outputs.is_release_branch == 'true')) || github.event_name == 'pull_request') }}
uses: ultimaker/cura-workflows/.github/workflows/conan-package-create-macos.yml@main
with:
recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }}
secrets: inherit

conan-package-create-windows:
needs: [ conan-recipe-version, conan-package-export ]
if: ${{ ((github.event_name == 'push' && (github.ref_name == 'main' || needs.conan-recipe-version.outputs.is_release_branch == 'true')) || github.event_name == 'pull_request') }}
uses: ultimaker/cura-workflows/.github/workflows/conan-package-create-windows.yml@main
with:
recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }}
secrets: inherit

conan-package-create-linux:
needs: [ conan-recipe-version, conan-package-export ]
if: ${{ ((github.event_name == 'push' && (github.ref_name == 'main' || needs.conan-recipe-version.outputs.is_release_branch == 'true')) || github.event_name == 'pull_request') }}
uses: ultimaker/cura-workflows/.github/workflows/conan-package-create-linux.yml@main
with:
recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }}
secrets: inherit

conan-package-create-wasm:
needs: [ conan-recipe-version, conan-package-export ]
if: ${{ (github.event_name == 'push' && (github.ref_name == 'main' || needs.conan-recipe-version.outputs.is_release_branch == 'true')) }}
uses: ultimaker/cura-workflows/.github/workflows/conan-package-create-wasm.yml@main
with:
recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }}
platform_wasm: true
secrets: inherit
101 changes: 10 additions & 91 deletions .github/workflows/gcodeanalyzer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ permissions:
contents: write
deployments: write

env:
CONAN_LOGIN_USERNAME: ${{ secrets.CONAN_USER }}
CONAN_PASSWORD: ${{ secrets.CONAN_PASS }}

# TODO: Make cura-workflows/benchmark.yml generic enough to fit the gcodeanalyzer benchmark

jobs:
Expand All @@ -39,32 +35,19 @@ jobs:
needs: [ check_actor ]
if: ${{ needs.check_actor.outputs.proceed == 'true' }}
uses: ultimaker/cura-workflows/.github/workflows/conan-recipe-version.yml@main
with:
project_name: curaengine

gcodeanalyzer:
needs: [ conan-recipe-version ]
name: Run GCodeAnalyzer on the engine
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
- name: Setup the build environment
uses: ultimaker/cura-workflows/.github/actions/setup-build-environment@main
with:
path: 'CuraEngine'
fetch-depth: 1
ref: ${{ github.head_ref }}

- name: Checkout repo PR
uses: actions/checkout@v4
if: ${{ github.event.pull_request.head.repo.full_name != github.repository }}
with:
path: 'CuraEngine'
fetch-depth: 1
ref: ${{ github.base_ref }}
install_system_dependencies: true

- name: Checkout GCodeAnalyzer
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: 'Ultimaker/GCodeAnalyzer'
ref: 'main'
Expand All @@ -73,95 +56,31 @@ jobs:
token: ${{ secrets.CURA_BENCHMARK_PAT }}

- name: Checkout Test Models
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: 'Ultimaker/NightlyTestModels'
ref: 'main'
path: 'NightlyTestModels'
fetch-depth: 1
token: ${{ secrets.GITHUB_TOKEN }}

- 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

- name: Setup Python and pip
uses: actions/setup-python@v4
with:
python-version: 3.11.x
cache: pip
cache-dependency-path: CuraEngine/.github/workflows/requirements-runner.txt

- name: Install Python requirements and Create default Conan profile
run: |
pip install -r CuraEngine/.github/workflows/requirements-runner.txt
pip install wheel numpy pandas python-dateutil pytz six
pip install git+https://github.com/ultimaker/libcharon@CURA-9495_analyzer_requisites#egg=charon
pip install pytest pytest-benchmark
- name: Install Linux system requirements for building
run: |
mkdir runner_scripts
cd runner_scripts
curl -O https://raw.githubusercontent.com/Ultimaker/cura-workflows/main/runner_scripts/ubuntu_setup.sh
chmod +x ubuntu_setup.sh
sudo ./ubuntu_setup.sh
- name: Setup pipeline caches
run: |
mkdir -p /home/runner/.conan/downloads
mkdir -p /home/runner/.conan/data
- name: Create default Conan profile
run: conan profile new default --detect

- 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: Cache Conan packages
uses: actions/cache@v3
with:
path: /home/runner/.conan/data
key: ${{ runner.os }}-conan-data-${{ github.run_id }}
restore-keys: |
${{ runner.os }}-conan-data-
- name: Cache Conan downloads
uses: actions/cache@v3
with:
path: /home/runner/.conan/downloads
key: ${{ runner.os }}-conan-downloads-${{ github.run_id }}
restore-keys: |
${{ 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 -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
working-directory: CuraEngine/build/Release/generators
run: conan install . ${{ needs.conan-recipe-version.outputs.version_full }} -s "*:build_type=Release" --build=missing --update -g VirtualRunEnv -c tools.build:skip_test=True -o with_cura_resources=True

- name: Build CuraEngine and tests
run: |
source build/Release/generators/conanbuild.sh
cmake --preset release
cmake --build --preset release
working-directory: CuraEngine
- name: Collect STL-files, run CuraEngine, output GCode-files
run: |
for file in `ls ../NightlyTestModels/*.stl`;
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
# TODO: Move this to GCodeAnalyzer
# TODO: Move this to GCodeAnalyzer
- name: Run GCodeAnalyzer on generated GCode files
id: gcode_out
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/lint-formatter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- uses: technote-space/get-diff-action@v6
- uses: greguintow/get-diff-action@v7
with:
PATTERNS: |
include/**/*.h*
src/**/*.c*
- name: Setup Python and pip
if: env.GIT_DIFF && !env.MATCHED_FILES # If nothing happens with python and/or pip after, the clean-up crashes.
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.11.x
cache: 'pip'
Expand Down
95 changes: 1 addition & 94 deletions .github/workflows/lint-tidier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,97 +11,4 @@ on:
jobs:
lint-tidier-job:
name: Auto-apply clang-tidy

runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2

- uses: technote-space/get-diff-action@v6
with:
PATTERNS: |
include/**/*.h*
src/**/*.c*
- name: Setup Python and pip
if: env.GIT_DIFF && !env.MATCHED_FILES # If nothing happens with python and/or pip after, the clean-up crashes.
uses: actions/setup-python@v4
with:
python-version: 3.11.x
cache: "pip"
cache-dependency-path: .github/workflows/requirements-linter.txt

- name: Install Python requirements for runner
if: env.GIT_DIFF && !env.MATCHED_FILES
run: pip install -r .github/workflows/requirements-linter.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 -y
- name: Install GCC-132 on ubuntu
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

- 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 }} -o enable_testing=True -s build_type=Release --build=missing --update -g GitHubActionsRunEnv -g GitHubActionsBuildEnv

- name: Set Environment variables from Conan install (bash)
if: ${{ runner.os != 'Windows' }}
run: |
. ./activate_github_actions_runenv.sh
. ./activate_github_actions_buildenv.sh
working-directory: build/Release/generators

- name: Build CuraEngine and tests
run: |
cmake --preset release
cmake --build --preset release
- name: Create results directory
run: mkdir linter-result

- name: Diagnose file(s)
if: env.GIT_DIFF && !env.MATCHED_FILES
continue-on-error: true
run: |
clang-tidy -p ./build/Release/ --config-file=.clang-tidy ${{ env.GIT_DIFF_FILTERED }} --export-fixes=linter-result/fixes.yml
- name: Save PR metadata
run: |
echo ${{ github.event.number }} > linter-result/pr-id.txt
echo ${{ github.event.pull_request.head.repo.full_name }} > linter-result/pr-head-repo.txt
echo ${{ github.event.pull_request.head.sha }} > linter-result/pr-head-sha.txt
- uses: actions/upload-artifact@v2
with:
name: linter-result
path: linter-result/

- name: Run clang-tidy-pr-comments action
uses: platisd/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
clang_tidy_fixes: linter-result/fixes.yml
request_changes: true
suggestions_per_comment: 30
uses: ultimaker/cura-workflows/.github/workflows/lint-tidier.yml@main
2 changes: 1 addition & 1 deletion .github/workflows/process-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
add_label:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: actions-ecosystem/action-add-labels@v1
if: ${{ github.event.pull_request.head.repo.full_name != github.repository }}
with:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/requirements-conan-package.txt

This file was deleted.

2 changes: 0 additions & 2 deletions .github/workflows/requirements-linter.txt

This file was deleted.

Empty file.
4 changes: 1 addition & 3 deletions .github/workflows/stress_benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ jobs:
needs: [ check_actor ]
if: ${{ needs.check_actor.outputs.proceed == 'true' }}
uses: ultimaker/cura-workflows/.github/workflows/conan-recipe-version.yml@main
with:
project_name: curaengine

benchmark:
needs: [ conan-recipe-version ]
Expand All @@ -55,4 +53,4 @@ jobs:
output_file_path: "build/Release/benchmark_result.json"
data_dir: "dev/stress_bench"
tool: "customSmallerIsBetter"
secrets: inherit
secrets: inherit
Loading

0 comments on commit 2837bc1

Please sign in to comment.