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

Commit

Permalink
CI Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Wakeful-Cloud committed Jul 1, 2021
1 parent 52f7f76 commit 24fb8ea
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 28 deletions.
15 changes: 2 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,24 +56,13 @@ jobs:
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 -v -j /definitions/ultimaker2.def.json -o /data/benchy.gcode -l /data/benchy.stl
run: wasmer ./build/CuraEngine.wasm --mapdir /definitions:./cura/resources/definitions --mapdir /data:./data -- slice -v -j /definitions/ultimaker2.def.json -o /data/benchy.gcode -l /data/benchy.stl

# Verify output
- name: Verify output
run: |
if [ "${{ hashFiles('./data/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
fi
34 changes: 19 additions & 15 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,35 @@ jobs:
# 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
# Build the Docker image
- name: Build the Docker image
uses: docker/build-push-action@v2
with:
key: never-exists
restore-keys: build-production-
path: .

- name: Debug
run: ls .
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

# Add package assets to a dedicated directory
# Add package assets to the package directory
- name: Add package assets
run: |
mkdir package
mv ./cura-engine.wasm package
mv ./source/README.md package
mv ./source/wapm.toml package
sudo mv ./build/CuraEngine.wasm ./package/cura-engine.wasm
mv ./README.md ./package
mv ./wapm.toml ./package
# Publish to WAPM
- name: Publish to WAPM
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## WAPM
package
wapm_packages

*.tar.bz2
*.tar.gz
*.7z
Expand Down

0 comments on commit 24fb8ea

Please sign in to comment.