Skip to content
This repository has been archived by the owner on Jun 15, 2023. It is now read-only.

Commit

Permalink
Added existing files
Browse files Browse the repository at this point in the history
  • Loading branch information
Wakeful-Cloud committed Jun 20, 2021
1 parent aa69bb2 commit 4b2f39d
Show file tree
Hide file tree
Showing 24 changed files with 424 additions and 672 deletions.
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Always use our version of the below files
.gitattributes merge=ours
.github merge=ours
docker merge=ours
build.sh merge=ours
wapm.toml merge=ours
40 changes: 0 additions & 40 deletions .github/ISSUE_TEMPLATE.md

This file was deleted.

80 changes: 80 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Automated builds for Cura Engine

name: Build

on:
# Run when pushed
push:
branches:
- main

env:
# SHA256 of Benchy GCODE for an Ultimaker 2
BENCHY_HASH: f4654841badfc91a22afd35593ef6024203c0ae3cefa119bd119711eecc3c737

jobs:
# Build and test Cura Engine
build:
name: Build Cura Engine
runs-on: ubuntu-latest
steps:
# Checkout source code
- name: Checkout source code
uses: actions/checkout@v2

# Setup Wasmer
- name: Setup Wasmer
uses: cloud-cnc/setup-wasmer@v1

# Checkout 3D printer definitions
- name: Checkout 3D printer definitions
uses: actions/checkout@v2
with:
path: cura
repository: Ultimaker/Cura

# Download data
- name: Download data
run: |
mkdir data
wget https://github.com/CreativeTools/3DBenchy/raw/master/Single-part/3DBenchy.stl -O data/benchy.stl
# Build the Docker image
- name: Build the Docker image
uses: docker/build-push-action@v2
with:
context: .
file: docker/build.dockerfile
push: false
tags: cloud-cnc/cura-engine

# Run the Docker image
- name: Run the Docker image
uses: addnab/docker-run-action@v3
with:
image: cloud-cnc/cura-engine
options: -v ${{ github.workspace }}/build:/root/cura-engine/build
run: ./build.sh

# Move the build
- name: Move the build
run: sudo mv ./build/CuraEngine.wasm ./cura-engine.wasm

# Slice Benchy
- name: Slice Benchy
run: wasmer ./cura-engine.wasm --mapdir /definitions:./cura/resources/definitions --mapdir /data:./data -- slice -j /definitions/ultimaker2.def.json -o /data/benchy.gcode -l /data/benchy.stl

# Verify output
- name: Verify output
working-directory: data
run: |
if [ "${{ hashFiles('./benchy.gcode') }}" != "${{ env.BENCHY_HASH }}" ]; then
exit 1
fi
# Cache the build
- name: Cache the build
uses: actions/cache@v2
with:
key: build-production-${{ hashFiles('./cura-engine.wasm') }}
path: ./cura-engine.wasm
53 changes: 0 additions & 53 deletions .github/workflows/cicd-mingw64.yml

This file was deleted.

13 changes: 0 additions & 13 deletions .github/workflows/cicd.yml

This file was deleted.

48 changes: 48 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Automated publishing for Cura Engine

name: Publish

on:
# Run when a new release is created
release:
types:
- published

jobs:
# Publish Cura Engine to WAPM
publish:
name: Publish Cura Engine to WAPM
runs-on: ubuntu-latest
steps:
# Checkout source code
- name: Checkout source code
uses: actions/checkout@v2
with:
path: source

# Setup Wasmer
- name: Setup Wasmer
uses: cloud-cnc/setup-wasmer@v1

# Restore the build from the cache
- name: Restore the build
uses: actions/cache@v2
with:
key: build-production-
restore-keys: build-production-
path: ./cura-engine.wasm

# Add package assets to a dedicated directory
- name: Add package assets
run: |
mkdir package
mv ./cura-engine.wasm package
mv ./source/README.md package
mv ./source/wapm.toml package
# Publish to WAPM
- name: Publish to WAPM
uses: cloud-cnc/wapm-publish@v1
with:
username: ${{ secrets.WAPM_USERNAME }}
password: ${{ secrets.WAPM_PASSWORD }}
43 changes: 43 additions & 0 deletions .github/workflows/sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Synchronize this repository with its upstream source (ultimaker/curaengine)

name: Synchronize

on:
# Run every Saturday at 00:00 UTC
schedule:
- cron: '0 0 * * 6'

# Run when manually triggered
workflow_dispatch:

jobs:
synchronize:
name: Synchronize with upstream
runs-on: ubuntu-latest
steps:
# Checkout downstream (This repository)
- name: Checkout downstream
uses: actions/checkout@v2
with:
fetch-depth: 0

# Authenticate to Git
- name: Authenticate to Git
uses: OleksiyRudenko/gha-git-credentials@v2
with:
token: ${{ github.token }}

# Merge upstream
- name: Merge upstream
run: |
git config merge.ours.driver true
git config pull.rebase false
git remote add upstream https://github.com/ultimaker/curaengine.git
git pull upstream master
git merge upstream/master
# Stage and commit changes
- name: Add and commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Synchronized with upstream
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ endif()

set(CMAKE_CXX_STANDARD 11)

# Disable exceptions (Fix for https://github.com/WebAssembly/wasi-sdk#notable-limitations)
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions")
endif()

if(APPLE AND CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
endif()
Expand Down Expand Up @@ -101,7 +106,7 @@ if (ENABLE_MORE_COMPILER_OPTIMIZATION_FLAGS AND NOT (CMAKE_BUILD_TYPE_UPPER MATC
if (MSVC)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} /fp:fast")
else()
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -Ofast -funroll-loops")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -funroll-loops")
endif()
endif ()

Expand Down Expand Up @@ -215,7 +220,6 @@ set(engine_SRCS # Except main.cpp.
src/utils/polygon.cpp
src/utils/ProximityPointLink.cpp
src/utils/SVG.cpp
src/utils/socket.cpp
)

# List of tests. For each test there must be a file tests/${NAME}.cpp.
Expand Down
Loading

0 comments on commit 4b2f39d

Please sign in to comment.