mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
Testing - Create occt artefact action (#658)
- 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
This commit is contained in:
2
.github/actions/build-occt/action.yml
vendored
2
.github/actions/build-occt/action.yml
vendored
@@ -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
|
||||
|
@@ -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
|
||||
|
2
.github/actions/build-sample-mfc/action.yml
vendored
2
.github/actions/build-sample-mfc/action.yml
vendored
@@ -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
|
||||
|
2
.github/actions/build-sample-qt/action.yml
vendored
2
.github/actions/build-sample-qt/action.yml
vendored
@@ -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
|
||||
|
2
.github/actions/build-tinspector/action.yml
vendored
2
.github/actions/build-tinspector/action.yml
vendored
@@ -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
|
||||
|
73
.github/actions/download-artifacts/action.yml
vendored
Normal file
73
.github/actions/download-artifacts/action.yml
vendored
Normal file
@@ -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
|
2
.github/actions/retest-failures/action.yml
vendored
2
.github/actions/retest-failures/action.yml
vendored
@@ -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
|
||||
|
2
.github/actions/run-gtest/action.yml
vendored
2
.github/actions/run-gtest/action.yml
vendored
@@ -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
|
||||
|
2
.github/actions/run-tests/action.yml
vendored
2
.github/actions/run-tests/action.yml
vendored
@@ -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
|
||||
|
2
.github/actions/test-summary/action.yml
vendored
2
.github/actions/test-summary/action.yml
vendored
@@ -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
|
||||
|
53
.github/actions/upload-artifacts/action.yml
vendored
Normal file
53
.github/actions/upload-artifacts/action.yml
vendored
Normal file
@@ -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 }}
|
Reference in New Issue
Block a user