From 9aa965103fc7df266150529157fe50172d8f9b56 Mon Sep 17 00:00:00 2001 From: suku Date: Wed, 3 Jul 2024 09:33:52 +0200 Subject: [PATCH] SUKU workflow updated, format fixed --- .github/workflows/freecad_export.py | 6 +++--- .github/workflows/mechanical_components.yml | 14 +++++++------- .github/workflows/pythonocc_step_to_stl.py | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/freecad_export.py b/.github/workflows/freecad_export.py index c10ce21..e53538e 100644 --- a/.github/workflows/freecad_export.py +++ b/.github/workflows/freecad_export.py @@ -10,7 +10,7 @@ print(f"sys.argv = {sys.argv}") -import os +import os if os.path.isdir("temp"): print("Directory already exists") else: @@ -75,7 +75,7 @@ def exportScreenshot(label, filename): print("STEP 4",filename) FreeCADGui.updateGui() print("STEP 5",filename) - + print("SCREENSHOT", label, filename) App.Gui.ActiveDocument.ActiveView.saveImage(filename,3200,2400,'Transparent') @@ -164,4 +164,4 @@ def exportScreenshot(label, filename): App.Gui.getMainWindow().close() # sys.exit(0) -# exit(0) \ No newline at end of file +# exit(0) diff --git a/.github/workflows/mechanical_components.yml b/.github/workflows/mechanical_components.yml index 904e344..562f44c 100644 --- a/.github/workflows/mechanical_components.yml +++ b/.github/workflows/mechanical_components.yml @@ -19,7 +19,7 @@ jobs: matrix: component: - 'KNOT-ASSEMBLY' - + steps: - name: Checkout code uses: actions/checkout@v2 @@ -38,9 +38,9 @@ jobs: - name: Run GUI application continue-on-error: true run: | - ls + ls export DISPLAY=:99 - timeout 1m freecad --hidden ./Mechanical/Design/${{ matrix.component }}/${{ matrix.component }}.FCStd ./.github/workflows/freecad_export.py step pdf + timeout 5m freecad --hidden ./Mechanical/Design/${{ matrix.component }}/${{ matrix.component }}.FCStd ./.github/workflows/freecad_export.py step pdf - name: Install conda, pythonocc and do the conversion run: | @@ -74,7 +74,7 @@ jobs: - name: Set Date run: echo "action_date=$(date +'%Y-%m-%d-%H%M')" >> $GITHUB_ENV - + - name: Upload artifacts uses: actions/upload-artifact@v4 with: @@ -84,7 +84,7 @@ jobs: deploy-results: runs-on: ubuntu-latest if: github.ref == 'refs/heads/master' - needs: generate-artifacts + needs: generate-artifacts steps: - uses: actions/checkout@v2 with: @@ -111,9 +111,9 @@ jobs: done - name: Commit the files - run: | + run: | git config --global user.name ${{ github.actor }} - git config --global user.email ${{ github.actor }}@users.noreply.github.com + git config --global user.email ${{ github.actor }}@users.noreply.github.com git add Preview/* git commit -m "BOT ${{ github.workflow }} ${{ github.sha }}" git push diff --git a/.github/workflows/pythonocc_step_to_stl.py b/.github/workflows/pythonocc_step_to_stl.py index 6cc4b08..8f1002b 100644 --- a/.github/workflows/pythonocc_step_to_stl.py +++ b/.github/workflows/pythonocc_step_to_stl.py @@ -10,7 +10,7 @@ for step_file in file_list: step_file_path = os.path.join(directory_path, step_file) print(f"Converting {step_file} to STL...") - + # Read STEP file shape = read_step_file(step_file_path) @@ -21,4 +21,4 @@ # Write STL file write_stl_file(shape, stl_file_path, mode='binary', linear_deflection=0.1, angular_deflection=0.5) - print(f"Conversion of {step_file} to {stl_file} complete\n") \ No newline at end of file + print(f"Conversion of {step_file} to {stl_file} complete\n")