Skip to content

Update stl_file to threemf_file for from_3mf #69

Update stl_file to threemf_file for from_3mf

Update stl_file to threemf_file for from_3mf #69

Workflow file for this run

name: Build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: Build and Test
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-buildtest-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install packages
run: |
sudo apt-get update
sudo apt-get install libosmesa6-dev
- name: Build
run: |
cargo build --release --verbose
strip -s target/release/stl-thumb
- name: Run tests
run: RUST_BACKTRACE=1 cargo test --verbose
package:
needs: [build]
name: Package
runs-on: ubuntu-22.04
strategy:
matrix:
target: [x86_64-unknown-linux-gnu, armv7-unknown-linux-gnueabihf, aarch64-unknown-linux-gnu]
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install packages
# This is all BS to get random dependencies to cross compile and I hate it
run: |
sudo cp .github/workflows/sources.list /etc/apt/sources.list
sudo dpkg --add-architecture arm64
sudo dpkg --add-architecture armhf
sudo apt-get update
sudo apt-get install gcc-arm-linux-gnueabihf gcc-aarch64-linux-gnu g++-arm-linux-gnueabihf g++-aarch64-linux-gnu libc-dev-armhf-cross libc-dev-arm64-cross libfreetype6-dev:arm64 libfreetype6-dev:armhf libfontconfig-dev:arm64 libfontconfig-dev:armhf
- name: Prep build environment
run: |
if [ ${{ matrix.target }} == "armv7-unknown-linux-gnueabihf" ];
then
export PKG_CONFIG_SYSROOT_DIR=/usr/arm-linux-gnueabihf
elif [ ${{ matrix.target }} == "aarch64-unknown-linux-gnu" ];
then
export PKG_CONFIG_SYSROOT_DIR=/usr/aarch64-linux-gnu
fi
rustup target add ${{ matrix.target }}
cargo install cargo-deb --force
cargo install cargo-generate-rpm --force
- name: Package DEB
run: |
cargo deb --target ${{ matrix.target }}
- name: Package RPM
run: |
cargo build --release
cargo generate-rpm --target-dir ./target --target ${{ matrix.target }}
- uses: actions/upload-artifact@v3
with:
name: deb-rpm-${{ matrix.target }}
path: |
target/${{ matrix.target }}/debian/*.deb
target/${{ matrix.target }}/generate-rpm/*.rpm