Skip to content

Commit dd797d6

Browse files
authored
Merge pull request #10 from Ultimaker/CURA-11622_conan_v2
Cura 11622 conan v2
2 parents 746a78e + 829354a commit dd797d6

File tree

9 files changed

+118
-308
lines changed

9 files changed

+118
-308
lines changed
Lines changed: 23 additions & 154 deletions
Original file line numberDiff line numberDiff line change
@@ -1,159 +1,28 @@
1-
---
21
name: conan-package
32

4-
# Exports the recipe, sources and binaries for Mac, Windows and Linux and upload these to the server such that these can
5-
# be used downstream.
6-
#
7-
# It should run on pushes against main or CURA-* branches, but it will only create the binaries for main and release branches
8-
93
on:
10-
workflow_dispatch:
11-
inputs:
12-
# FIXME: Not yet implemented
13-
conan_id:
14-
required: false
15-
type: string
16-
description: 'The full conan package ID, e.g. "libnest2d/1.2.3@ultimaker/stable"'
17-
create_latest_alias:
18-
required: true
19-
default: false
20-
type: boolean
21-
description: 'Create latest alias'
22-
create_binaries_windows:
23-
required: true
24-
default: false
25-
type: boolean
26-
description: 'create binaries Windows'
27-
create_binaries_linux:
28-
required: true
29-
default: false
30-
type: boolean
31-
description: 'create binaries Linux'
32-
create_binaries_macos:
33-
required: true
34-
default: false
35-
type: boolean
36-
description: 'create binaries Macos'
37-
38-
push:
39-
paths:
40-
- 'src/**'
41-
- 'include/**'
42-
- 'test_package/**'
43-
- 'tests/**'
44-
- 'cmake/**'
45-
- 'conanfile.py'
46-
- 'conandata.yml'
47-
- 'CMakeLists.txt'
48-
- 'requirements.txt'
49-
- '.github/workflows/conan-package.yml'
50-
- '.github/workflows/requirements*'
51-
branches:
52-
- main
53-
- master
54-
- 'CURA-*'
55-
- '[0-9].[0-9]'
56-
- '[0-9].[0-9][0-9]'
57-
tags:
58-
- '[0-9].[0-9].[0-9]*'
59-
- '[0-9].[0-9][0-9].[0-9]*'
4+
push:
5+
paths:
6+
- 'src/**'
7+
- 'include/**'
8+
- 'test_package/**'
9+
- 'tests/**'
10+
- 'cmake/**'
11+
- 'conanfile.py'
12+
- 'conandata.yml'
13+
- 'CMakeLists.txt'
14+
- 'requirements.txt'
15+
- '.github/workflows/conan-package.yml'
16+
- '.github/workflows/requirements*'
17+
branches:
18+
- main
19+
- 'CURA-*'
20+
- 'PP-*'
21+
- 'NP-*'
22+
- '[0-9].[0-9]*'
23+
- '[0-9].[0-9][0-9]*'
6024

6125
jobs:
62-
conan-recipe-version:
63-
uses: ultimaker/cura/.github/workflows/conan-recipe-version.yml@main
64-
with:
65-
project_name: nest2d
66-
67-
conan-package-export:
68-
needs: [ conan-recipe-version ]
69-
uses: ultimaker/cura/.github/workflows/conan-recipe-export.yml@main
70-
with:
71-
recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }}
72-
recipe_id_latest: ${{ needs.conan-recipe-version.outputs.recipe_id_latest }}
73-
runs_on: 'ubuntu-20.04'
74-
python_version: '3.11.x'
75-
conan_logging_level: 'info'
76-
secrets: inherit
77-
78-
conan-package-create-windows:
79-
if: ${{ (github.event_name == 'push' && (github.ref_name == 'main' || github.ref_name == 'master' || needs.conan-recipe-version.outputs.is_release_branch == 'true' )) || (github.event_name == 'workflow_dispatch' && inputs.create_binaries_windows) }}
80-
needs: [ conan-recipe-version, conan-package-export ]
81-
82-
uses: ultimaker/cura/.github/workflows/conan-package-create.yml@main
83-
with:
84-
project_name: ${{ needs.conan-recipe-version.outputs.project_name }}
85-
recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }}
86-
build_id: 4
87-
runs_on: 'windows-2022'
88-
python_version: '3.11.x'
89-
conan_config_branch: ''
90-
conan_logging_level: 'info'
91-
secrets: inherit
92-
93-
conan-package-create-macos:
94-
if: ${{ (github.event_name == 'push' && (github.ref_name == 'main' || github.ref_name == 'master' || needs.conan-recipe-version.outputs.is_release_branch == 'true')) || (github.event_name == 'workflow_dispatch' && inputs.create_binaries_macos) }}
95-
needs: [ conan-recipe-version, conan-package-export ]
96-
97-
uses: ultimaker/cura/.github/workflows/conan-package-create.yml@main
98-
with:
99-
project_name: ${{ needs.conan-recipe-version.outputs.project_name }}
100-
recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }}
101-
build_id: 3
102-
runs_on: 'macos-11'
103-
python_version: '3.11.x'
104-
conan_logging_level: 'info'
105-
secrets: inherit
106-
107-
conan-package-create-linux-modern:
108-
if: ${{ (github.event_name == 'push' && (github.ref_name == 'main' || github.ref_name == 'master' || needs.conan-recipe-version.outputs.is_release_branch == 'true')) || (github.event_name == 'workflow_dispatch' && inputs.create_binaries_linux) }}
109-
needs: [ conan-recipe-version, conan-package-export ]
110-
111-
uses: ultimaker/cura/.github/workflows/conan-package-create.yml@main
112-
with:
113-
project_name: ${{ needs.conan-recipe-version.outputs.project_name }}
114-
recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }}
115-
build_id: 2
116-
runs_on: 'ubuntu-20.04'
117-
python_version: '3.11.x'
118-
conan_logging_level: 'info'
119-
secrets: inherit
120-
121-
conan-package-create-linux:
122-
if: ${{ (github.event_name == 'push' && (github.ref_name == 'main' || github.ref_name == 'master' || needs.conan-recipe-version.outputs.is_release_branch == 'true')) || (github.event_name == 'workflow_dispatch' && inputs.create_binaries_linux) }}
123-
needs: [ conan-recipe-version, conan-package-export ]
124-
125-
uses: ultimaker/cura/.github/workflows/conan-package-create.yml@main
126-
with:
127-
project_name: ${{ needs.conan-recipe-version.outputs.project_name }}
128-
recipe_id_full: ${{ needs.conan-recipe-version.outputs.recipe_id_full }}
129-
build_id: 1
130-
runs_on: 'ubuntu-20.04'
131-
python_version: '3.11.x'
132-
conan_logging_level: 'info'
133-
secrets: inherit
134-
135-
notify-export:
136-
if: ${{ always() }}
137-
needs: [ conan-recipe-version, conan-package-export ]
138-
139-
uses: ultimaker/cura/.github/workflows/notify.yml@main
140-
with:
141-
success: ${{ contains(join(needs.*.result, ','), 'success') }}
142-
success_title: "New Conan recipe exported in ${{ github.repository }}"
143-
success_body: "Exported ${{ needs.conan-recipe-version.outputs.recipe_id_full }}"
144-
failure_title: "Failed to export Conan Export in ${{ github.repository }}"
145-
failure_body: "Failed to exported ${{ needs.conan-recipe-version.outputs.recipe_id_full }}"
146-
secrets: inherit
147-
148-
notify-create:
149-
if: ${{ always() && ((github.event_name == 'push' && (github.ref_name == 'main' || github.ref_name == 'master' || needs.conan-recipe-version.outputs.is_release_branch == 'true')) || (github.event_name == 'workflow_dispatch' && inputs.create_binaries_linux)) }}
150-
needs: [ conan-recipe-version, conan-package-create-macos, conan-package-create-windows, conan-package-create-linux, conan-package-create-linux-modern ]
151-
152-
uses: ultimaker/cura/.github/workflows/notify.yml@main
153-
with:
154-
success: ${{ contains(join(needs.*.result, ','), 'success') }}
155-
success_title: "New binaries created in ${{ github.repository }}"
156-
success_body: "Created binaries for ${{ needs.conan-recipe-version.outputs.recipe_id_full }}"
157-
failure_title: "Failed to create binaries in ${{ github.repository }}"
158-
failure_body: "Failed to created binaries for ${{ needs.conan-recipe-version.outputs.recipe_id_full }}"
159-
secrets: inherit
26+
conan-package:
27+
uses: ultimaker/cura-workflows/.github/workflows/conan-package.yml@main
28+
secrets: inherit

.github/workflows/requirements-conan-package.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: unit-test-post
2+
3+
on:
4+
workflow_run:
5+
workflows: [ unit-test ]
6+
types: [ completed ]
7+
8+
jobs:
9+
publish-test-results:
10+
uses: ultimaker/cura-workflows/.github/workflows/unit-test-post.yml@main
11+
with:
12+
event: ${{ github.event.workflow_run.event }}
13+
conclusion: ${{ github.event.workflow_run.conclusion }}
14+
secrets: inherit

.github/workflows/unit-test.yml

Lines changed: 13 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
---
21
name: unit-test
3-
# FIXME: This should be a reusable workflow
42

53
on:
64
push:
@@ -19,13 +17,11 @@ on:
1917
- '.github/workflows/requirements*'
2018
branches:
2119
- main
22-
- master
2320
- 'CURA-*'
24-
- '[0-9].[0-9]'
25-
- '[0-9].[0-9][0-9]'
26-
tags:
27-
- '[0-9].[0-9].[0-9]'
28-
- '[0-9].[0-9][0-9].[0-9]'
21+
- 'PP-*'
22+
- 'NP-*'
23+
- '[0-9].[0-9]*'
24+
- '[0-9].[0-9][0-9]*'
2925
pull_request:
3026
paths:
3127
- 'src/**'
@@ -42,117 +38,15 @@ on:
4238
- '.github/workflows/requirements*'
4339
branches:
4440
- main
45-
- master
46-
- '[0-9].[0-9]'
47-
- '[0-9].[0-9][0-9]'
48-
tags:
49-
- '[0-9].[0-9].[0-9]'
50-
- '[0-9].[0-9][0-9].[0-9]'
51-
52-
env:
53-
CONAN_LOGIN_USERNAME_CURA: ${{ secrets.CONAN_USER }}
54-
CONAN_PASSWORD_CURA: ${{ secrets.CONAN_PASS }}
55-
CONAN_LOGIN_USERNAME_CURA_CE: ${{ secrets.CONAN_USER }}
56-
CONAN_PASSWORD_CURA_CE: ${{ secrets.CONAN_PASS }}
57-
CONAN_LOG_RUN_TO_OUTPUT: 1
58-
CONAN_LOGGING_LEVEL: info
59-
CONAN_NON_INTERACTIVE: 1
41+
- 'CURA-*'
42+
- 'PP-*'
43+
- 'NP-*'
44+
- '[0-9].[0-9]*'
45+
- '[0-9].[0-9][0-9]*'
6046

6147
jobs:
62-
conan-recipe-version:
63-
uses: ultimaker/cura/.github/workflows/conan-recipe-version.yml@main
64-
with:
65-
project_name: nest2d
66-
6748
testing:
68-
runs-on: ubuntu-22.04
69-
needs: [ conan-recipe-version ]
70-
71-
steps:
72-
- name: Checkout
73-
uses: actions/checkout@v3
74-
75-
- name: Setup Python and pip
76-
uses: actions/setup-python@v4
77-
with:
78-
python-version: '3.10.x'
79-
architecture: 'x64'
80-
cache: 'pip'
81-
cache-dependency-path: .github/workflows/requirements-conan-package.txt
82-
83-
- name: Install Python requirements and Create default Conan profile
84-
run: |
85-
pip install -r .github/workflows/requirements-conan-package.txt
86-
87-
# NOTE: Due to what are probably github issues, we have to remove the cache and reconfigure before the rest.
88-
# This is maybe because grub caches the disk it uses last time, which is recreated each time.
89-
- name: Install Linux system requirements
90-
if: ${{ runner.os == 'Linux' }}
91-
run: |
92-
sudo rm /var/cache/debconf/config.dat
93-
sudo dpkg --configure -a
94-
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
95-
sudo apt update
96-
sudo apt upgrade
97-
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
98-
99-
- name: Install GCC-132 on ubuntu
100-
run: |
101-
sudo apt install g++-13 gcc-13 -y
102-
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 13
103-
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-13 13
104-
105-
- name: Create the default Conan profile
106-
run: conan profile new default --detect
107-
108-
- name: Get Conan configuration
109-
run: |
110-
conan config install https://github.com/Ultimaker/conan-config.git
111-
conan config install https://github.com/Ultimaker/conan-config.git -a "-b runner/${{ runner.os }}/${{ runner.arch }}"
112-
113-
- name: Use Conan download cache (Bash)
114-
if: ${{ runner.os != 'Windows' }}
115-
run: conan config set storage.download_cache="$HOME/.conan/conan_download_cache"
116-
117-
- name: Cache Conan local repository packages (Bash)
118-
uses: actions/cache@v3
119-
if: ${{ runner.os != 'Windows' }}
120-
with:
121-
path: |
122-
$HOME/.conan/data
123-
$HOME/.conan/conan_download_cache
124-
key: conan-${{ runner.os }}-${{ runner.arch }}
125-
126-
- name: Install dependencies
127-
run: conan install . ${{ needs.conan-recipe-version.outputs.recipe_id_full }} -o nest2d:enable_testing=True -s build_type=Release --build=missing --update -g GitHubActionsRunEnv -g GitHubActionsBuildEnv
128-
129-
- name: Upload the Dependency package(s)
130-
run: conan upload "*" -r cura --all -c
131-
132-
- name: Set Environment variables from Conan install (bash)
133-
if: ${{ runner.os != 'Windows' }}
134-
run: |
135-
. ./activate_github_actions_runenv.sh
136-
. ./activate_github_actions_buildenv.sh
137-
working-directory: build/Release/generators/
138-
139-
- name: Build Unit Test CuraEngine
140-
run: |
141-
cmake --preset release
142-
cmake --build --preset release
143-
144-
- name: Run Unit Test CuraEngine
145-
id: run-test
146-
run: ctest --output-junit engine_test.xml
147-
working-directory: build/Release/
148-
149-
- name: Publish Unit Test Results
150-
id: test-results
151-
uses: EnricoMi/publish-unit-test-result-action@v1
152-
if: ${{ always() }}
153-
with:
154-
files: |
155-
**/*.xml
156-
157-
- name: Conclusion
158-
run: echo "Conclusion is ${{ fromJSON( steps.test-results.outputs.json ).conclusion }}"
49+
name: Run unit tests
50+
uses: ultimaker/cura-workflows/.github/workflows/unit-test.yml@main
51+
with:
52+
test_use_ctest: true

.gitignore

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,3 +128,43 @@ conanbuildinfo.txt
128128
conan.lock
129129
build/
130130
graph_info.json
131+
/test_package/deactivate_conanrun.sh
132+
/test_package/nest2d-release-x86_64-data.cmake
133+
/test_package/CMakeFiles/
134+
/test_package/test
135+
/test_package/NLopt-release-x86_64-data.cmake
136+
/test_package/nest2dTargets.cmake
137+
/test_package/.ninja_log
138+
/test_package/BoostConfig.cmake
139+
/test_package/nest2d-Target-release.cmake
140+
/test_package/clipper-config.cmake
141+
/test_package/clipper-config-version.cmake
142+
/test_package/conanrun.sh
143+
/test_package/Boost-Target-release.cmake
144+
/test_package/clipperTargets.cmake
145+
/test_package/CMakePresets.json
146+
/test_package/metadata/
147+
/test_package/NLoptTargets.cmake
148+
/test_package/nest2d-config-version.cmake
149+
/test_package/.ninja_deps
150+
/test_package/NLoptConfigVersion.cmake
151+
/test_package/clipper-Target-release.cmake
152+
/test_package/conandeps_legacy.cmake
153+
/test_package/deactivate_conanbuildenv-release-x86_64.sh
154+
/test_package/BoostTargets.cmake
155+
/test_package/CMakeCache.txt
156+
/test_package/deactivate_conanbuild.sh
157+
/test_package/nest2d-config.cmake
158+
/test_package/conanrunenv-release-x86_64.sh
159+
/test_package/conanbuildenv-release-x86_64.sh
160+
/test_package/clipper-release-x86_64-data.cmake
161+
/test_package/NLoptConfig.cmake
162+
/test_package/Boost-release-x86_64-data.cmake
163+
/test_package/build.ninja
164+
/test_package/cmakedeps_macros.cmake
165+
/test_package/cmake_install.cmake
166+
/test_package/conan_toolchain.cmake
167+
/test_package/BoostConfigVersion.cmake
168+
/test_package/NLopt-Target-release.cmake
169+
/test_package/deactivate_conanrunenv-release-x86_64.sh
170+
/test_package/conanbuild.sh

0 commit comments

Comments
 (0)