]> OCCT Git - occt.git/commitdiff
Testing - Create occt artefact action (#658)
authorPasukhin Dmitry <dpasukhi@opencascade.com>
Wed, 30 Jul 2025 20:07:08 +0000 (21:07 +0100)
committerGitHub <noreply@github.com>
Wed, 30 Jul 2025 20:07:08 +0000 (21:07 +0100)
- Created custom upload-artifacts and download-artifacts actions with platform-specific logic
- Updated all existing workflows to use the new custom artifact actions
- Added extraction steps for tar.gz archives in the test summary workflow

.github/actions/build-occt/action.yml
.github/actions/build-sample-csharp/action.yml
.github/actions/build-sample-mfc/action.yml
.github/actions/build-sample-qt/action.yml
.github/actions/build-tinspector/action.yml
.github/actions/download-artifacts/action.yml [new file with mode: 0644]
.github/actions/retest-failures/action.yml
.github/actions/run-gtest/action.yml
.github/actions/run-tests/action.yml
.github/actions/test-summary/action.yml
.github/actions/upload-artifacts/action.yml [new file with mode: 0644]

index b503d2ac9a800f97e5a7ac746fce37ba2193e656..bdd11d90855f6cb882814173aa31dcc4a51cdfb7 100644 (file)
@@ -78,7 +78,7 @@ runs:
       shell: bash
 
     - name: Upload install directory
-      uses: actions/upload-artifact@v4.6.2
+      uses: ./.github/actions/upload-artifacts
       with:
         name: ${{ inputs.artifact-name }}
         path: install
index c73bdf8f009216603520f09f9efd222be2534bb2..1f02efb0adb0b8b1a779c8e6a09b30a9a954d671 100644 (file)
@@ -13,7 +13,7 @@ runs:
   using: "composite"
   steps:
     - name: Download OCCT installation
-      uses: actions/download-artifact@v4.3.0
+      uses: ./.github/actions/download-artifacts
       with:
         name: ${{ inputs.install-artifact-name }}
         path: occt-install
index b16465dde0cf7ea51cba176c5e4dc5c59f171416..e4103b2415245c60b020baf9fd022c4880a66399 100644 (file)
@@ -13,7 +13,7 @@ runs:
   using: "composite"
   steps:
     - name: Download OCCT installation 
-      uses: actions/download-artifact@v4.3.0
+      uses: ./.github/actions/download-artifacts
       with:
         name: ${{ inputs.install-artifact-name }}
         path: occt-install
index 5133fe5d18560ffe3fc6ceb121f99982254ef733..c910d6829d7da3d9f1fe222560071daf5374dce3 100644 (file)
@@ -17,7 +17,7 @@ runs:
   using: "composite"
   steps:
     - name: Download OCCT installation
-      uses: actions/download-artifact@v4.3.0
+      uses: ./.github/actions/download-artifacts
       with:
         name: ${{ inputs.install-artifact-name }}
         path: occt-install
index a3891605df9095b79212606a0fc26f0d2357aa06..bade453104856d642b5ceaaf2b55b98d23623798 100644 (file)
@@ -17,7 +17,7 @@ runs:
   using: "composite"
   steps:
     - name: Download OCCT installation
-      uses: actions/download-artifact@v4.3.0
+      uses: ./.github/actions/download-artifacts
       with:
         name: ${{ inputs.install-artifact-name }}
         path: occt-install
diff --git a/.github/actions/download-artifacts/action.yml b/.github/actions/download-artifacts/action.yml
new file mode 100644 (file)
index 0000000..693aa94
--- /dev/null
@@ -0,0 +1,73 @@
+name: 'Download Platform Artifacts'
+description: 'Download and extract artifacts with proper file permissions and symlinks (cross-platform)'
+inputs:
+  name:
+    description: 'Artifact name'
+    required: true
+  path:
+    description: 'Path to extract to (optional)'
+    required: false
+    default: '.'
+
+runs:
+  using: 'composite'
+  steps:
+    # For Windows, use standard GitHub action - no symlink issues
+    - name: Download artifacts (Windows)
+      if: runner.os == 'Windows'
+      uses: actions/download-artifact@v4.3.0
+      with:
+        name: ${{ inputs.name }}
+        path: ${{ inputs.path }}
+    
+    # For Linux/Unix, use custom workaround to handle symlinks properly
+    - name: Download archive (Unix)
+      if: runner.os != 'Windows'
+      uses: actions/download-artifact@v4.3.0
+      with:
+        name: ${{ inputs.name }}
+        path: ./download-temp
+    
+    - name: Extract archive (Unix)
+      if: runner.os != 'Windows'
+      shell: bash
+      run: |
+        EXTRACT_PATH="${{ inputs.path }}"
+        ARCHIVE_FILE="./download-temp/${{ inputs.name }}.tar.gz"
+        
+        if [ ! -f "$ARCHIVE_FILE" ]; then
+          echo "Error: Archive file $ARCHIVE_FILE not found"
+          ls -la ./download-temp/
+          exit 1
+        fi
+        
+        echo "Extracting $ARCHIVE_FILE to $EXTRACT_PATH"
+        
+        # Extract and handle directory structure properly
+        if [ "$EXTRACT_PATH" != "." ]; then
+          # Extract to temp location first
+          mkdir -p temp-extract
+          tar -xzf "$ARCHIVE_FILE" -C temp-extract
+          
+          # Move the extracted content to the desired path
+          if [ -d "temp-extract/install" ]; then
+            # Remove target directory if it exists to avoid nesting
+            rm -rf "$EXTRACT_PATH"
+            mv "temp-extract/install" "$EXTRACT_PATH"
+          else
+            # If archive doesn't contain install/, move everything
+            mkdir -p "$EXTRACT_PATH"
+            mv temp-extract/* "$EXTRACT_PATH/"
+          fi
+          
+          # Clean up temp directory
+          rm -rf temp-extract
+        else
+          tar -xzf "$ARCHIVE_FILE" -C "$EXTRACT_PATH"
+        fi
+        
+        echo "Extraction complete"
+        ls -la "$EXTRACT_PATH"
+        
+        # Clean up temporary download directory
+        rm -rf ./download-temp
\ No newline at end of file
index 80b25063896122d6b9db2f99ebe9b527e93e8a62..d18673a4885217806d0771fbb638f41b006a03aa 100644 (file)
@@ -118,7 +118,7 @@ runs:
 
     - name: Download and extract install directory
       if: steps.check_failures.outputs.failed_count > 0
-      uses: actions/download-artifact@v4.3.0
+      uses: ./.github/actions/download-artifacts
       with:
         name: ${{ inputs.install-artifact-name }}
         path: install
index 9b8fc4af15ad34f44acd1966c1fe676bdd116e25..44aab0ead694947d98f642de7cd4c12edf730d48 100644 (file)
@@ -25,7 +25,7 @@ runs:
   using: "composite"
   steps:
     - name: Download and extract install directory
-      uses: actions/download-artifact@v4.3.0
+      uses: ./.github/actions/download-artifacts
       with:
         name: ${{ inputs.install-artifact-name }}
         path: install
index 3d9f74f0651e0bdca128c79f8ebaaedc7f9df554..1d45559fcb750f1722a8cc9b2c56024c50c64e9d 100644 (file)
@@ -53,7 +53,7 @@ runs:
       shell: bash
 
     - name: Download and extract install directory
-      uses: actions/download-artifact@v4.3.0
+      uses: ./.github/actions/download-artifacts
       with:
         name: ${{ inputs.install-artifact-name }}
         path: install
index 6b47e1069f539cab67826ffec98138b1736487e5..1468040c78ab3b1ee1371fba62def7ab1e02b617 100644 (file)
@@ -23,7 +23,7 @@ runs:
       shell: bash
 
     - name: Download and extract install directory
-      uses: actions/download-artifact@v4.3.0
+      uses: ./.github/actions/download-artifacts
       with:
         name: install-linux-clang-x64
         path: install
diff --git a/.github/actions/upload-artifacts/action.yml b/.github/actions/upload-artifacts/action.yml
new file mode 100644 (file)
index 0000000..461b3ed
--- /dev/null
@@ -0,0 +1,53 @@
+name: 'Upload Platform Artifacts'
+description: 'Upload artifacts with proper file permissions and symlinks (cross-platform)'
+inputs:
+  name:
+    description: 'Artifact name'
+    required: true
+  path:
+    description: 'Path to archive'
+    required: true
+  retention-days:
+    description: 'Number of days to retain artifact'
+    required: false
+    default: '30'
+
+runs:
+  using: 'composite'
+  steps:
+    # For Windows, use standard GitHub action - no symlink issues
+    - name: Upload artifacts (Windows)
+      if: runner.os == 'Windows'
+      uses: actions/upload-artifact@v4.6.2
+      with:
+        name: ${{ inputs.name }}
+        path: ${{ inputs.path }}
+        retention-days: ${{ inputs.retention-days }}
+    
+    # For Linux/Unix, use custom workaround to handle symlinks properly
+    - name: Create archive (Unix)
+      if: runner.os != 'Windows'
+      shell: bash
+      run: |
+        BASE_PATH="${{ inputs.path }}"
+        ARCHIVE_NAME="${{ inputs.name }}.tar.gz"
+        
+        if [ -d "$BASE_PATH" ]; then
+          tar -czf "$ARCHIVE_NAME" -C "$(dirname "$BASE_PATH")" "$(basename "$BASE_PATH")"
+        elif [ -f "$BASE_PATH" ]; then
+          tar -czf "$ARCHIVE_NAME" -C "$(dirname "$BASE_PATH")" "$(basename "$BASE_PATH")"
+        else
+          echo "Error: Path $BASE_PATH does not exist"
+          exit 1
+        fi
+        
+        echo "Created archive: $ARCHIVE_NAME"
+        ls -la "$ARCHIVE_NAME"
+    
+    - name: Upload archive (Unix)
+      if: runner.os != 'Windows'
+      uses: actions/upload-artifact@v4.6.2
+      with:
+        name: ${{ inputs.name }}
+        path: ${{ inputs.name }}.tar.gz
+        retention-days: ${{ inputs.retention-days }}
\ No newline at end of file