From e42bf765936ed08cdb2d95609d7ed40bbc647ee6 Mon Sep 17 00:00:00 2001 From: Vijai Kumar S Date: Wed, 22 May 2024 12:52:08 +0530 Subject: [PATCH] Cleaned up the actions before PR --- .github/workflows/build.yml | 409 ++++++++++++++++++------------------ 1 file changed, 209 insertions(+), 200 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 62bcdd8a8..2f86045de 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,18 +1,17 @@ -on: [ push, pull_request, workflow_dispatch ] +on: [push, pull_request] 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-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 @@ -30,9 +29,11 @@ jobs: with: name: bindings.zip path: build/bindings.zip - - name: Set up Docker Buildx + - + name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - name: Docker Build + - + name: Docker Build uses: docker/build-push-action@v5 with: context: . @@ -40,7 +41,8 @@ jobs: platforms: linux/amd64 tags: lib3mf_ubi8:latest load: true - - name: Docker Extract + - + name: Docker Extract uses: shrink/actions-docker-extract@v3.0.0 id: extract with: @@ -50,7 +52,8 @@ jobs: - run: unzip out.zip working-directory: ./dist - - name: Upload Artifact + - + name: Upload Artifact uses: actions/upload-artifact@v2 with: name: lib3mf.so @@ -72,51 +75,51 @@ jobs: with: name: lib3mf.dylib path: build/lib3mf.dylib -# -# 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-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: @@ -138,66 +141,66 @@ jobs: with: name: lib3mf.lib path: build/Release/lib3mf.lib -# 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 + 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 ] + needs: [build-windows-release, build-macos, build-linux-ubi8-gcc12] steps: - run: sudo apt install -y zip unzip - run: mkdir build @@ -217,85 +220,88 @@ jobs: with: name: lib3mf_sdk.zip path: build/lib3mf_sdk.zip -# deploy-linux: -# runs-on: ubuntu-20.04 -# needs: [ assemble-sdk ] -# steps: -# - run: sudo apt install -y zip unzip -# - 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 -# 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 -# 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 + deploy-linux: + runs-on: ubuntu-20.04 + needs: [assemble-sdk] + steps: + - run: sudo apt install -y zip unzip + - 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 + 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 + 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 integration-tests-latest-release: runs-on: ubuntu-20.04 + needs: [deploy-linux, deploy-windows, deploy-macos] + # uncomment the following line if this is only needed for a release event + if: github.event_name == 'release' steps: - name: Checkout code uses: actions/checkout@v2 @@ -349,7 +355,7 @@ jobs: run: | cd test_suites && /usr/bin/time -v python integration_test.py 2>&1 | tee latest_sdk_test.log - - name: Print results + - name: Print results (Checks the total python script execution time) run: | LATEST_TIME=$(grep "Elapsed (wall clock) time" test_suites/latest_sdk_test.log | awk '{print $8}') LATEST_TOTAL_SECONDS=$(echo $LATEST_TIME | awk -F: '{ print ($1 * 60) + $2 }') @@ -358,6 +364,9 @@ jobs: integration-tests-last-two-releases: runs-on: ubuntu-20.04 + needs: [deploy-linux, deploy-windows, deploy-macos] + # comment or uncomment the following line if this is only needed for a release event + if: github.event_name == 'release' steps: - name: Checkout code uses: actions/checkout@v2 @@ -441,7 +450,7 @@ jobs: cd test_suites /usr/bin/time -v python integration_test.py 2>&1 | tee second_latest_sdk_test.log - - name: Compare results + - name: Compare results (Checks the total python script execution time) run: | LATEST_TIME=$(grep "Elapsed (wall clock) time" test_suites/latest_sdk_test.log | awk '{print $8}') SECOND_LATEST_TIME=$(grep "Elapsed (wall clock) time" test_suites/second_latest_sdk_test.log | awk '{print $8}') @@ -458,7 +467,7 @@ jobs: integration-tests-latest-commit: runs-on: ubuntu-20.04 - needs: [ assemble-sdk ] + needs: [deploy-linux, deploy-windows, deploy-macos] steps: - name: Checkout code uses: actions/checkout@v2 @@ -504,7 +513,7 @@ jobs: run: | cd test_suites && /usr/bin/time -v python integration_test.py 2>&1 | tee latest_sdk_test.log - - name: Print results + - name: Print results (Checks the total python script execution time) run: | LATEST_TIME=$(grep "Elapsed (wall clock) time" test_suites/latest_sdk_test.log | awk '{print $8}') LATEST_TOTAL_SECONDS=$(echo $LATEST_TIME | awk -F: '{ print ($1 * 60) + $2 }')