From 24fb8ea45a0fdc007970facb8cf4c90363e96313 Mon Sep 17 00:00:00 2001 From: Wakeful-Cloud Date: Wed, 30 Jun 2021 23:40:59 -0600 Subject: [PATCH] CI Fix --- .github/workflows/build.yml | 15 ++------------- .github/workflows/publish.yml | 34 +++++++++++++++++++--------------- .gitignore | 4 ++++ 3 files changed, 25 insertions(+), 28 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 19cecf1222..1f9cb99b9a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 0e8e6db522..e9aa110424 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -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 diff --git a/.gitignore b/.gitignore index a32f920890..8ba5023bb4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ +## WAPM +package +wapm_packages + *.tar.bz2 *.tar.gz *.7z