feat: add downlaod-wheel.sh to release note #4
Workflow file for this run
This file contains hidden or 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
| name: Test download.py | |
| on: | |
| push: | |
| branches: [ main ] | |
| paths: | |
| - 'download.py' | |
| - '.github/workflows/test-download.yml' | |
| pull_request: | |
| branches: [ main ] | |
| paths: | |
| - 'download.py' | |
| - '.github/workflows/test-download.yml' | |
| schedule: | |
| # Run tests weekly to ensure scripts work with latest releases | |
| - cron: '0 0 * * 0' | |
| workflow_dispatch: | |
| inputs: | |
| test_version: | |
| description: 'Specific version to test (e.g., 20.1.8)' | |
| required: false | |
| default: 20.1.8 # set a default version for manual runs | |
| test_tool: | |
| description: 'Tool to test (clang-format, clang-tidy, or both)' | |
| required: false | |
| default: 'both' | |
| type: choice | |
| options: | |
| - both | |
| - clang-format | |
| - clang-tidy | |
| jobs: | |
| test-python-script: | |
| name: Test Python Script | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] | |
| tool: [clang-format, clang-tidy] | |
| exclude: | |
| # Skip some combinations to reduce CI time | |
| - os: windows-latest | |
| python-version: '3.8' | |
| - os: windows-latest | |
| python-version: '3.9' | |
| - os: macos-latest | |
| python-version: '3.8' | |
| - os: macos-latest | |
| python-version: '3.9' | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Test script help functionality | |
| run: python3 download.py --help | |
| - name: Test list platforms functionality (latest) | |
| run: python3 download.py ${{ matrix.tool }} --list-platforms | |
| - name: Test list platforms functionality (specific version) | |
| if: ${{ github.event.inputs.test_version != '' || github.event_name == 'schedule' }} | |
| run: | | |
| VERSION="${{ github.event.inputs.test_version || '20.1.8' }}" | |
| python3 download.py ${{ matrix.tool }} --version $VERSION --list-platforms | |
| - name: Create test output directory | |
| run: mkdir -p test-downloads | |
| - name: Test download latest version | |
| run: | | |
| python3 download.py ${{ matrix.tool }} --output test-downloads | |
| - name: Verify downloaded wheel (latest) | |
| shell: bash | |
| run: | | |
| ls -la test-downloads/ | |
| TOOL="${{ matrix.tool }}" | |
| TOOL_UNDERSCORE="${TOOL//-/_}" | |
| # Check if wheel file exists | |
| if [ "$(ls test-downloads/${TOOL}*.whl 2>/dev/null | wc -l)" -eq 0 ]; then | |
| # Try with underscore naming | |
| if [ "$(ls test-downloads/${TOOL_UNDERSCORE}*.whl 2>/dev/null | wc -l)" -eq 0 ]; then | |
| echo "ERROR: No wheel file found for ${{ matrix.tool }}" | |
| exit 1 | |
| fi | |
| fi | |
| echo "✅ Successfully downloaded latest ${{ matrix.tool }} wheel" | |
| - name: Test download specific version | |
| if: ${{ github.event.inputs.test_version != '' || github.event_name == 'schedule' }} | |
| run: | | |
| VERSION="${{ github.event.inputs.test_version || '20.1.8' }}" | |
| python3 download.py ${{ matrix.tool }} --version $VERSION --output test-downloads | |
| - name: Verify downloaded wheel (specific version) | |
| if: ${{ github.event.inputs.test_version != '' || github.event_name == 'schedule' }} | |
| shell: bash | |
| run: | | |
| VERSION="${{ github.event.inputs.test_version || '20.1.8' }}" | |
| # Check if wheel file with specific version exists | |
| if [ "$(ls test-downloads/*$VERSION*.whl 2>/dev/null | wc -l)" -eq 0 ]; then | |
| echo "ERROR: No wheel file found for version $VERSION" | |
| exit 1 | |
| fi | |
| echo "✅ Successfully downloaded ${{ matrix.tool }} wheel version $VERSION" | |
| - name: Test wheel installation | |
| shell: bash | |
| run: | | |
| TOOL="${{ matrix.tool }}" | |
| TOOL_UNDERSCORE="${TOOL//-/_}" | |
| # Try to install the wheel (try both naming conventions) | |
| if ls test-downloads/${TOOL}*.whl >/dev/null 2>&1; then | |
| pip install test-downloads/${TOOL}*.whl | |
| elif ls test-downloads/${TOOL_UNDERSCORE}*.whl >/dev/null 2>&1; then | |
| pip install test-downloads/${TOOL_UNDERSCORE}*.whl | |
| else | |
| echo "ERROR: No wheel file found to install" | |
| exit 1 | |
| fi | |
| - name: Test installed tool functionality | |
| shell: bash | |
| run: | | |
| TOOL="${{ matrix.tool }}" | |
| TOOL_CMD="${TOOL//-/_}" # Replace hyphens with underscores | |
| # Test basic functionality | |
| if command -v $TOOL_CMD &> /dev/null; then | |
| echo "✅ $TOOL_CMD is available in PATH" | |
| $TOOL_CMD --version || $TOOL_CMD --help | head -5 || true | |
| else | |
| echo "⚠️ $TOOL_CMD not found in PATH, checking python module" | |
| python3 -m $TOOL_CMD --version || python3 -m $TOOL_CMD --help | head -5 || true | |
| fi | |
| - name: Test platform override functionality | |
| run: | | |
| # Test with a different but compatible platform | |
| if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then | |
| python3 download.py ${{ matrix.tool }} --platform musllinux_1_2_x86_64 --output test-downloads/alt-platform | |
| elif [[ "${{ matrix.os }}" == "macos-latest" ]]; then | |
| # Test both Intel and ARM platforms on macOS | |
| python3 download.py ${{ matrix.tool }} --platform macosx_10_9_x86_64 --output test-downloads/alt-platform | |
| fi | |
| continue-on-error: true # Platform override might not have wheels for all versions |