Skip to content

Commit

Permalink
Merge pull request #1691 from Ultimaker/5.1
Browse files Browse the repository at this point in the history
5.1
  • Loading branch information
Joeydelarago authored Jul 13, 2022
2 parents d370e55 + ee3670f commit 2b15a9d
Show file tree
Hide file tree
Showing 22 changed files with 481 additions and 329 deletions.
128 changes: 128 additions & 0 deletions .github/workflows/conan-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
---
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:
workflow_dispatch:
inputs:
create_binaries_windows:
required: true
default: false
description: 'create binaries Windows'
create_binaries_linux:
required: true
default: false
description: 'create binaries Linux'
create_binaries_macos:
required: true
default: false
description: 'create binaries Macos'

push:
paths:
- 'src/**'
- 'cmake/**'
- 'tests/**'
- 'conanfile.py'
- 'conandata.yml'
- 'CMakeLists.txt'
- '.github/workflows/conan-package.yml'
- '.github/worflows/requirements-conan-package.txt'
branches:
- main
- 'CURA-*'
- '[1-9]+.[0-9]+'
tags:
- '[0-9]+.[0-9]+.[0-9]+'

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

conan-package-export:
needs: [ conan-recipe-version ]
uses: ultimaker/cura/.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 }}
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'
secrets: inherit

conan-package-create-macos:
# FIXME: For release branches: maybe rename the branch to release/**
if: ${{ (github.event_name == 'push' && github.ref_name == 'main') || (github.event_name == 'workflow_dispatch' && inputs.create_binaries_macos) }}
needs: [ conan-recipe-version, conan-package-export ]

uses: ultimaker/cura/.github/workflows/conan-package-create.yml@main
with:
recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }}
runs_on: 'macos-10.15'
python_version: '3.10.4'
conan_config_branch: 'master'
conan_logging_level: 'info'
secrets: inherit

conan-package-create-windows:
# FIXME: For release branches: maybe rename the branch to release/**
if: ${{ (github.event_name == 'push' && github.ref_name == 'main') || (github.event_name == 'workflow_dispatch' && inputs.create_binaries_windows) }}
needs: [ conan-recipe-version, conan-package-export ]

uses: ultimaker/cura/.github/workflows/conan-package-create.yml@main
with:
recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }}
runs_on: 'windows-2022'
python_version: '3.10.4'
conan_config_branch: 'master'
conan_logging_level: 'info'
secrets: inherit

conan-package-create-linux:
# FIXME: For release branches: maybe rename the branch to release/**
if: ${{ (github.event_name == 'push' && github.ref_name == 'main') || (github.event_name == 'workflow_dispatch' && inputs.create_binaries_linux) }}
needs: [ conan-recipe-version, conan-package-export ]

uses: ultimaker/cura/.github/workflows/conan-package-create.yml@main
with:
recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }}
runs_on: 'ubuntu-20.04'
python_version: '3.10.4'
conan_config_branch: 'master'
conan_logging_level: 'info'
secrets: inherit

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

uses: ultimaker/cura/.github/workflows/notify.yml@main
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

notify-create:
# FIXME: For release branches: maybe rename the branch to release/**
if: ${{ always() && ((github.event_name == 'push' && github.ref_name == 'main') || (github.event_name == 'workflow_dispatch' && inputs.create_binaries_linux)) }}
needs: [ conan-package-create-macos, conan-package-create-windows, conan-package-create-linux ]

uses: ultimaker/cura/.github/workflows/notify.yml@main
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
3 changes: 3 additions & 0 deletions .github/workflows/requirements-conan-package.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
conan
gitpython
sip==6.5.1
77 changes: 57 additions & 20 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
name: unit-test
# FIXME: This should be a reusable workflow

on:
push:
Expand All @@ -8,74 +9,110 @@ on:
- 'cmake/**'
- 'tests/**'
- 'conanfile.py'
- 'conandata.yml'
- 'CMakeLists.txt'
- '.github/workflows/unit-test.yml'
- '.github/worflows/requirements-conan-package.txt'
branches:
- main
- 'CURA-*'
- 'CT_fix'
- '[0-9]+.[0-9]+'
tags:
- '[5-9].[0-9].+*'
- '[0-9]+.[0-9]+.[0-9]+'
pull_request:
paths:
- 'src/**'
- 'cmake/**'
- 'tests/**'
- 'conanfile.py'
- 'conandata.yml'
- 'CMakeLists.txt'
- '.github/workflows/unit-test.yml'
- '.github/worflows/requirements-conan-package.txt'
branches:
- main
- '[5-9].[0-9]'
- 'CURA-*'
- '[0-9]+.[0-9]+'
tags:
- '[0-9]+.[0-9]+.[0-9]+'

env:
CONAN_USER: ${{ secrets.CONAN_USER }}
CONAN_PASS: ${{ secrets.CONAN_PASS }}
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/conan-recipe-version.yml@main
with:
project_name: curaengine

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

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

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

- name: Prepare Conan and sip-build (Bash)
if: ${{ runner.os != 'Windows' }}
- name: Install Python requirements and Create default Conan profile
run: |
pip install --require-hashes -r requirements.txt
# FIXME: Once we fully support Conan change to: `conan config install https://github.com/Ultimaker/conan-config.git`
conan config install https://github.com/Ultimaker/conan-config.git -a "-b CURA-9177_Fix_CI_CD" -tf $HOME/.conan
pip install -r requirements-conan-package.txt
conan profile new default --detect
conan user -p $CONAN_PASS -r ultimaker $CONAN_USER
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
key: ${{ runner.os }}-testing
$HOME/.conan/conan_download_cache
key: conan-${{ runner.os }}-${{ runner.arch }}

- name: Install Linux system requirements
if: ${{ runner.os == 'Linux' }}
run: sudo apt install build-essential checkinstall 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 . -o enable_testing=True -pr:b cura_build.jinja -pr:h cura_release.jinja --build=missing --update -g VirtualBuildEnv
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: Upload the Dependency package(s)
run: conan upload "*" -r ultimaker --all -c
run: conan upload "*" -r cura --all -c

- 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: cmake-build-release/conan

- name: Run Unit Test CuraEngine
id: run-test
run: |
cmake --toolchain cmake-build-release/conan/conan_toolchain.cmake -S . -B cmake-build-release/
cmake --build cmake-build-release/
cd cmake-build-release/
cmake --toolchain ./conan/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release -S .. -B .
cmake --build .
ctest --output-junit engine_test.xml
working-directory: cmake-build-release

- name: Publish Unit Test Results
id: test-results
Expand All @@ -86,4 +123,4 @@ jobs:
**/*.xml
- name: Conclusion
run: echo "Conclusion is ${{ fromJSON( steps.test-results.outputs.json ).conclusion }}"
run: echo "Conclusion is ${{ fromJSON( steps.test-results.outputs.json ).conclusion }}"
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ callgrind/*
build/*
debug_build/*
release_build/*
cmake-build-debug/*
cmake-build-release/*
cmake-build-*
cmake-build-*
libs/stb
*.pyc
*.exe
Expand Down Expand Up @@ -64,3 +64,6 @@ documentation/latex/*
## Test results.
tests/output.xml
callgrind.out.*

CMakeUserPresets.json
/conan_imports_manifest.txt
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ if (ENABLE_ARCUS)
message(STATUS "Building with Arcus")

find_package(arcus 5.0.0 REQUIRED)
find_package(protobuf_BUILD 3.17.1 REQUIRED) # Used for protoc
find_package(protobuf 3.17.1 REQUIRED) # Used for linking
find_package(protobuf 3.17.1 REQUIRED)
protobuf_generate_cpp(engine_PB_SRCS engine_PB_HEADERS Cura.proto)
endif ()

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
<p align="center">
<a href="https://github.com/Ultimaker/CuraEngine/actions/workflows/unit-test.yml" alt="Unit Tests">
<img src="https://github.com/Ultimaker/CuraEngine/actions/workflows/unit-test.yml/badge.svg" /></a>
<a href="https://github.com/Ultimaker/CuraEngine/actions/workflows/conan-package.yml" alt="Unit Tests">
<img src="https://github.com/Ultimaker/CuraEngine/actions/workflows/conan-package.yml/badge.svg" /></a>
<a href="https://github.com/Ultimaker/CuraEngine/issues" alt="Open Issues">
<img src="https://img.shields.io/github/issues/ultimaker/curaengine" /></a>
<a href="https://github.com/Ultimaker/CuraEngine/issues?q=is%3Aissue+is%3Aclosed" alt="Closed Issues">
Expand Down
35 changes: 0 additions & 35 deletions clang-format

This file was deleted.

Loading

0 comments on commit 2b15a9d

Please sign in to comment.