Update build.yml #623
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: [push, pull_request] | |
env: | |
LIB3MF_VERSION: "2.3.0" | |
name: Build | |
jobs: | |
build-linux-memtest: | |
runs-on: ubuntu-20.04 | |
steps: | |
- run: sudo apt update | |
- run: sudo apt install -y valgrind uuid-dev | |
- uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- run: sh cmake/GenerateMake.sh | |
- run: cmake --build . --target lib3mf_memcheck | |
working-directory: ./build | |
build-linux-ubi8-gcc12: | |
runs-on: ubuntu-20.04 | |
steps: | |
- run: sudo apt update | |
- run: sudo apt install -y uuid-dev | |
- uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- run: mkdir -p build | |
- run: zip -r build/bindings.zip Autogenerated/Bindings | |
- name: Archive bindings | |
uses: actions/upload-artifact@v2 | |
with: | |
name: bindings.zip | |
path: build/bindings.zip | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Docker Build | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
file: ./CI/Dockerfile | |
platforms: linux/amd64 | |
tags: lib3mf_ubi8:latest | |
load: true | |
- name: Docker Extract | |
uses: shrink/[email protected] | |
id: extract | |
with: | |
image: lib3mf_ubi8:latest | |
path: out.zip | |
destination: dist | |
- run: unzip out.zip | |
working-directory: ./dist | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: lib3mf.so | |
path: dist/lib3mf.so.2 | |
- name: Extract File Name (CPacked Archive) | |
run: | | |
ZIP_FILE=$(ls dist/lib3mf-*.zip) | |
echo "ARTIFACT_NAME_ZIP=$(basename ${ZIP_FILE})" >> $GITHUB_ENV | |
shell: bash | |
- name: Upload Artifact (CPacked Archive) | |
uses: actions/upload-artifact@v2 | |
with: | |
name: ${{ env.ARTIFACT_NAME_ZIP }} | |
path: dist/${{ env.ARTIFACT_NAME_ZIP }} | |
- name: Extract File Name (Debian) | |
run: | | |
DEB_FILE=$(ls dist/lib3mf-*.deb) | |
echo "ARTIFACT_NAME_DEB=$(basename ${DEB_FILE})" >> $GITHUB_ENV | |
shell: bash | |
- name: Upload Artifact (Debian Archive) | |
uses: actions/upload-artifact@v2 | |
with: | |
name: ${{ env.ARTIFACT_NAME_DEB }} | |
path: dist/${{ env.ARTIFACT_NAME_DEB }} | |
- name: Extract File Name (RPM) | |
run: | | |
RPM_FILE=$(ls dist/lib3mf-*.rpm) | |
echo "ARTIFACT_NAME_RPM=$(basename ${RPM_FILE})" >> $GITHUB_ENV | |
shell: bash | |
- name: Upload Artifact (RPM Archive) | |
uses: actions/upload-artifact@v2 | |
with: | |
name: ${{ env.ARTIFACT_NAME_RPM }} | |
path: dist/${{ env.ARTIFACT_NAME_RPM }} | |
build-macos: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- run: sh cmake/GenerateMake.sh "-DCMAKE_OSX_ARCHITECTURES=arm64;x86_64" | |
- run: cmake --build . | |
working-directory: ./build | |
- run: ctest -V | |
working-directory: ./build | |
- run: cpack -G ZIP -C Release | |
working-directory: ./build | |
- name: Extract File Name | |
run: | | |
ZIP_FILE=$(ls build/lib3mf-*.zip) | |
echo "ARTIFACT_NAME=$(basename ${ZIP_FILE})" >> $GITHUB_ENV | |
shell: bash | |
- name: Archive Mac binary | |
uses: actions/upload-artifact@v2 | |
with: | |
name: lib3mf.dylib | |
path: build/lib3mf.dylib | |
- name: Upload Artifact (CPacked Archive) | |
uses: actions/upload-artifact@v2 | |
with: | |
name: ${{ env.ARTIFACT_NAME }} | |
path: build/${{ env.ARTIFACT_NAME }} | |
build-macos-debug: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- run: sh cmake/GenerateMake.sh "-DCMAKE_OSX_ARCHITECTURES=arm64;x86_64 -DCMAKE_BUILD_TYPE=Debug" | |
- run: cmake --build . | |
working-directory: ./build | |
- run: ctest -V | |
working-directory: ./build | |
- name: Archive Mac binary | |
uses: actions/upload-artifact@v2 | |
with: | |
name: lib3mf.debug.dylib | |
path: build/lib3mf.dylib | |
codecoverage-macos: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Install Prerequisites | |
run: | | |
brew install lcov | |
brew install gcovr | |
- run: sh cmake/GenerateMake.sh -DBUILD_FOR_CODECOVERAGE=ON | |
- run: cmake --build . | |
working-directory: ./build | |
- run: ./Tests/codecoverage/run_codecoverage.sh | |
- name: Archive Code Coverage Results | |
uses: actions/upload-artifact@v2 | |
with: | |
name: codecoverage.zip | |
path: build/codecoverage.zip | |
- name: Upload code coverage to codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: ./build/Test_CPP_Bindings_filtered.info | |
fail_ci_if_error: true # optional (default = false) | |
verbose: true # optional (default = false) | |
build-windows-release: | |
runs-on: windows-2019 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- run: ./cmake/GenerateVS2019.bat | |
- run: cmake --build . --config Release | |
working-directory: ./build | |
- run: ctest -V | |
working-directory: ./build | |
- run: cpack -G ZIP -C Release | |
working-directory: ./build | |
- name: Extract File Name | |
run: | | |
$zipFile = Get-ChildItem build\lib3mf-*.zip -Name | |
echo "ARTIFACT_NAME=$zipFile" | Out-File -FilePath $env:GITHUB_ENV -Append | |
shell: pwsh | |
- name: Archive Windows Release binary | |
uses: actions/upload-artifact@v2 | |
with: | |
name: lib3mf.dll | |
path: build/Release/lib3mf.dll | |
- name: Archive Windows Release lib | |
uses: actions/upload-artifact@v2 | |
with: | |
name: lib3mf.lib | |
path: build/Release/lib3mf.lib | |
- name: Upload Artifact (CPacked Archive) | |
uses: actions/upload-artifact@v2 | |
with: | |
name: ${{ env.ARTIFACT_NAME }} | |
path: build/${{ env.ARTIFACT_NAME }} | |
build-windows-debug: | |
runs-on: windows-2019 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- run: ./cmake/GenerateVS2019.bat | |
- run: cmake --build . --config Debug | |
working-directory: ./build | |
- run: ctest -V | |
working-directory: ./build | |
- name: Archive Windows Debug binary | |
uses: actions/upload-artifact@v2 | |
with: | |
name: lib3mf.debug.dll | |
path: build/Debug/lib3mf.dll | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: lib3mf.pdb | |
path: build/Debug/lib3mf.pdb | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: lib3mf.debug.lib | |
path: build/Debug/lib3mf.lib | |
build-windows-32bit: | |
runs-on: windows-2019 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- run: ./cmake/GenerateVS2019_32bit.bat | |
- run: cmake --build . --config Release | |
working-directory: ./build_32bit | |
- run: ctest -V | |
working-directory: ./build_32bit | |
- name: Archive Windows 32 bit Release binary | |
uses: actions/upload-artifact@v2 | |
with: | |
name: lib3mf_32bit.dll | |
path: build_32bit/Release/lib3mf.dll | |
- name: Archive Windows 32 bit Release lib | |
uses: actions/upload-artifact@v2 | |
with: | |
name: lib3mf_32bit.lib | |
path: build_32bit/Release/lib3mf.lib | |
build-mingw-w64: | |
runs-on: windows-2019 | |
steps: | |
- run: choco install mingw -y | |
- uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- run: ./cmake/GenerateMinGW.bat | |
- run: cmake --build . | |
working-directory: ./build | |
- run: ctest -V | |
working-directory: ./build | |
assemble-sdk: | |
runs-on: ubuntu-20.04 | |
needs: [build-windows-release, build-macos, build-linux-ubi8-gcc12] | |
steps: | |
- run: sudo apt install -y zip unzip | |
- run: mkdir build | |
- uses: actions/checkout@v2 | |
with: | |
submodules: false | |
- name: Download all workflow run artifacts | |
uses: actions/download-artifact@v2 | |
with: | |
path: ./build | |
- run: ls -Rl ./build | |
- run: unzip bindings.zip/bindings.zip | |
working-directory: ./build | |
- run: bash SDK/GenerateSDK_github.sh | |
- name: Archive SDK artifact (Comprehensive) | |
uses: actions/upload-artifact@v2 | |
with: | |
name: lib3mf_sdk.zip | |
path: build/lib3mf_sdk.zip | |
- name: Archive SDK artifact (CPack - Linux) | |
uses: actions/upload-artifact@v2 | |
with: | |
name: lib3mf-${{ env.LIB3MF_VERSION }}-Linux.zip | |
path: build/lib3mf-${{ env.LIB3MF_VERSION }}-Linux.zip | |
- name: Archive SDK artifact (CPack - Windows) | |
uses: actions/upload-artifact@v2 | |
with: | |
name: lib3mf-${{ env.LIB3MF_VERSION }}-Windows.zip | |
path: build/lib3mf-${{ env.LIB3MF_VERSION }}-Windows.zip | |
- name: Archive SDK artifact (CPack - Darwin) | |
uses: actions/upload-artifact@v2 | |
with: | |
name: lib3mf-${{ env.LIB3MF_VERSION }}-Darwin.zip | |
path: build/lib3mf-${{ env.LIB3MF_VERSION }}-Darwin.zip | |
- name: Archive SDK artifact (CPack - Debian) | |
uses: actions/upload-artifact@v2 | |
with: | |
name: lib3mf-${{ env.LIB3MF_VERSION }}-Linux.deb | |
path: build/lib3mf-${{ env.LIB3MF_VERSION }}-Linux.deb | |
- name: Archive SDK artifact (CPack - RPM) | |
uses: actions/upload-artifact@v2 | |
with: | |
name: lib3mf-${{ env.LIB3MF_VERSION }}-Linux.rpm | |
path: build/lib3mf-${{ env.LIB3MF_VERSION }}-Linux.rpm | |
deploy-linux: | |
runs-on: ubuntu-20.04 | |
needs: [assemble-sdk] | |
steps: | |
- run: sudo apt install -y zip unzip file | |
- run: pwd | |
- run: ls -Rl . | |
- name: Download lib3mf_sdk artifact | |
uses: actions/download-artifact@v2 | |
with: | |
name: lib3mf_sdk.zip | |
path: lib3mf_sdk.zip | |
- run: ls -Rl . | |
- name: Unpack the SDK | |
run: | | |
unzip lib3mf_sdk.zip/lib3mf_sdk.zip | |
- name: Build CppDynamic | |
run: | | |
sh Examples/CppDynamic/GenerateMake.sh | |
cd Examples/CppDynamic/build | |
cmake --build . | |
./Example_ExtractInfo ../../Files/Helix.3mf | |
- name: Build Cpp | |
run: | | |
sh Examples/Cpp/GenerateMake.sh | |
cd Examples/Cpp/build | |
cmake --build . | |
./Example_ExtractInfo ../../Files/Helix.3mf | |
- name: Download lib3mf cpack (Linux) | |
uses: actions/download-artifact@v2 | |
with: | |
name: lib3mf-${{ env.LIB3MF_VERSION }}-Linux.zip | |
path: lib3mf-${{ env.LIB3MF_VERSION }}-Linux.zip | |
- run: ls -Rl . | |
- name: Unpack the cpacked SDK | |
run: | | |
unzip lib3mf-${{ env.LIB3MF_VERSION }}-Linux.zip/lib3mf-${{ env.LIB3MF_VERSION }}-Linux.zip | |
- name: Build CppDynamicNew | |
run: | | |
sh Examples/CppDynamicNew/GenerateMake.sh | |
cd Examples/CppDynamicNew/build | |
cmake --build . | |
./Example_ExtractInfo ../../Files/Helix.3mf | |
- name: Build CppNew | |
run: | | |
sh Examples/CppNew/GenerateMake.sh | |
cd Examples/CppNew/build | |
cmake --build . | |
./Example_ExtractInfo ../../Files/Helix.3mf | |
- name: Download lib3mf (Debian Linux) | |
uses: actions/download-artifact@v2 | |
with: | |
name: lib3mf-${{ env.LIB3MF_VERSION }}-Linux.deb | |
path: lib3mf-${{ env.LIB3MF_VERSION }}-Linux.deb | |
- name: Check the file type | |
run: | | |
file lib3mf-${{ env.LIB3MF_VERSION }}-Linux.deb | |
file lib3mf-${{ env.LIB3MF_VERSION }}-Linux.deb/lib3mf-${{ env.LIB3MF_VERSION }}-Linux.deb | |
- run: pwd | |
- run: ls -Rl . | |
- name: Install the debian package | |
run: | | |
sudo dpkg -i lib3mf-${{ env.LIB3MF_VERSION }}-Linux.deb/lib3mf-${{ env.LIB3MF_VERSION }}-Linux.deb | |
- name: Build CppDynamicNew (Debian) | |
run: | | |
sh Examples/CppDynamicNew/GenerateMake.sh | |
cd Examples/CppDynamicNew/build | |
cmake --build . | |
./Example_ExtractInfo ../../Files/Helix.3mf | |
- name: Build CppNew (Debian) | |
run: | | |
sh Examples/CppNew/GenerateMake.sh | |
cd Examples/CppNew/build | |
cmake --build . | |
./Example_ExtractInfo ../../Files/Helix.3mf | |
deploy-windows: | |
runs-on: windows-2019 | |
needs: [assemble-sdk] | |
steps: | |
- name: Download lib3mf_sdk artifact | |
uses: actions/download-artifact@v2 | |
with: | |
name: lib3mf_sdk.zip | |
path: lib3mf_sdk.zip | |
- name: Unpack the SDK | |
run: | | |
unzip lib3mf_sdk.zip/lib3mf_sdk.zip | |
- name: Build CppDynamic | |
run: | | |
./Examples/CppDynamic/GenerateVS2019.bat | |
cd Examples/CppDynamic/build | |
cmake --build . --config Release | |
./Release/Example_ExtractInfo.exe ../../Files/Helix.3mf | |
- name: Build Cpp | |
run: | | |
./Examples/Cpp/GenerateVS2019.bat | |
cd Examples/Cpp/build | |
cmake --build . --config Release | |
./Release/Example_ExtractInfo.exe ../../Files/Helix.3mf | |
- name: Download lib3mf cpack (Windows) | |
uses: actions/download-artifact@v2 | |
with: | |
name: lib3mf-${{ env.LIB3MF_VERSION }}-Windows.zip | |
path: lib3mf-${{ env.LIB3MF_VERSION }}-Windows.zip | |
- name: Unpack the cpacked SDK | |
run: | | |
unzip lib3mf-${{ env.LIB3MF_VERSION }}-Windows.zip/lib3mf-${{ env.LIB3MF_VERSION }}-Windows.zip | |
- name: Build CppDynamic (Windows) | |
run: | | |
./Examples/CppDynamic/GenerateVS2019.bat | |
cd Examples/CppDynamic/build | |
cmake --build . --config Release | |
./Release/Example_ExtractInfo.exe ../../Files/Helix.3mf | |
- name: Build Cpp (Windows) | |
run: | | |
./Examples/Cpp/GenerateVS2019.bat | |
cd Examples/Cpp/build | |
cmake --build . --config Release | |
./Release/Example_ExtractInfo.exe ../../Files/Helix.3mf | |
deploy-macos: | |
runs-on: macos-latest | |
needs: [assemble-sdk] | |
steps: | |
- name: Download lib3mf_sdk artifact | |
uses: actions/download-artifact@v2 | |
with: | |
name: lib3mf_sdk.zip | |
path: lib3mf_sdk.zip | |
- name: Unpack the SDK | |
run: | | |
unzip lib3mf_sdk.zip/lib3mf_sdk.zip | |
- name: Build CppDynamic | |
run: | | |
sh Examples/CppDynamic/GenerateMake.sh | |
cd Examples/CppDynamic/build | |
cmake --build . | |
./Example_ExtractInfo ../../Files/Helix.3mf | |
- name: Build Cpp | |
run: | | |
sh Examples/Cpp/GenerateMake.sh | |
cd Examples/Cpp/build | |
cmake --build . | |
./Example_ExtractInfo ../../Files/Helix.3mf | |
- name: Download lib3mf cpack (Darwin) | |
uses: actions/download-artifact@v2 | |
with: | |
name: lib3mf-${{ env.LIB3MF_VERSION }}-Darwin.zip | |
path: lib3mf-${{ env.LIB3MF_VERSION }}-Darwin.zip | |
- run: ls -Rl . | |
- name: Unpack the cpacked SDK (Darwin) | |
run: | | |
unzip lib3mf-${{ env.LIB3MF_VERSION }}-Darwin.zip/lib3mf-${{ env.LIB3MF_VERSION }}-Darwin.zip | |
- name: Build CppDynamicNew (Darwin) | |
run: | | |
sh Examples/CppDynamicNew/GenerateMake.sh | |
cd Examples/CppDynamicNew/build | |
cmake --build . | |
./Example_ExtractInfo ../../Files/Helix.3mf | |
- name: Build CppNew (Darwin) | |
run: | | |
sh Examples/CppNew/GenerateMake.sh | |
cd Examples/CppNew/build | |
cmake --build . | |
./Example_ExtractInfo ../../Files/Helix.3mf |