Added test workflow to install builded wheels before the upload #17
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: Unit Tests | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| get-supported-versions: | |
| name: Get Supported Versions | |
| uses: ./.github/workflows/get-supported-versions.yml | |
| secrets: inherit | |
| unit-tests: | |
| name: Unit Tests (Python ${{ matrix.python-version }}) | |
| needs: get-supported-versions | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ${{ fromJson(needs.get-supported-versions.outputs.supported_python) }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install packaging pyyaml colorama requests | |
| - name: Run unit tests | |
| run: python -m unittest discover -s test -v | |
| verify-s3-wheels: | |
| name: Verify S3 wheels against exclude list | |
| needs: get-supported-versions | |
| runs-on: ubuntu-latest | |
| env: | |
| AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Get latest Python version | |
| id: python-version | |
| run: | | |
| VERSIONS='${{ needs.get-supported-versions.outputs.supported_python }}' | |
| LATEST=$(echo "$VERSIONS" | jq -r '.[0]') | |
| echo "version=$LATEST" >> $GITHUB_OUTPUT | |
| - name: Setup Python ${{ steps.python-version.outputs.version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ steps.python-version.outputs.version }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r build_requirements.txt | |
| - name: Verify S3 wheels | |
| run: python verify_s3_wheels.py ${{ secrets.DL_BUCKET }} ${{ needs.get-supported-versions.outputs.oldest_supported_python }} | |
| # Extract packages from exclude_list.yaml for build testing (per platform) | |
| extract-exclude-packages: | |
| name: Extract exclude list packages | |
| runs-on: ubuntu-latest | |
| outputs: | |
| packages_linux: ${{ steps.extract.outputs.packages_linux }} | |
| packages_windows: ${{ steps.extract.outputs.packages_windows }} | |
| packages_macos: ${{ steps.extract.outputs.packages_macos }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: pip install pyyaml | |
| - name: Extract packages per platform | |
| id: extract | |
| run: | | |
| LINUX=$(python extract_exclude_packages.py --platform linux) | |
| WINDOWS=$(python extract_exclude_packages.py --platform windows) | |
| MACOS=$(python extract_exclude_packages.py --platform macos) | |
| echo "packages_linux=$LINUX" >> $GITHUB_OUTPUT | |
| echo "packages_windows=$WINDOWS" >> $GITHUB_OUTPUT | |
| echo "packages_macos=$MACOS" >> $GITHUB_OUTPUT | |
| echo "Linux packages: $LINUX" | |
| echo "Windows packages: $WINDOWS" | |
| echo "macOS packages: $MACOS" | |
| # Test building excluded packages on Linux | |
| test-exclude-linux: | |
| name: Test exclude builds - Linux (Python ${{ matrix.python-version }}) | |
| needs: [get-supported-versions, extract-exclude-packages] | |
| runs-on: ubuntu-latest | |
| continue-on-error: true | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ${{ fromJson(needs.get-supported-versions.outputs.supported_python) }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r build_requirements.txt | |
| - name: Install OS dependencies | |
| run: os_dependencies/ubuntu.sh | |
| - name: Test building excluded packages | |
| run: python build_wheels_from_file.py --requirements ${{ needs.extract-exclude-packages.outputs.packages_linux }} | |
| # Test building excluded packages on Windows | |
| test-exclude-windows: | |
| name: Test exclude builds - Windows (Python ${{ matrix.python-version }}) | |
| needs: [get-supported-versions, extract-exclude-packages] | |
| runs-on: windows-latest | |
| continue-on-error: true | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ${{ fromJson(needs.get-supported-versions.outputs.supported_python) }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r build_requirements.txt | |
| - name: Test building excluded packages | |
| run: python build_wheels_from_file.py --requirements ${{ needs.extract-exclude-packages.outputs.packages_windows }} | |
| # Test building excluded packages on macOS | |
| test-exclude-macos: | |
| name: Test exclude builds - macOS (Python ${{ matrix.python-version }}) | |
| needs: [get-supported-versions, extract-exclude-packages] | |
| runs-on: macos-latest | |
| continue-on-error: true | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ${{ fromJson(needs.get-supported-versions.outputs.supported_python) }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r build_requirements.txt | |
| - name: Install OS dependencies | |
| run: os_dependencies/macos.sh | |
| - name: Test building excluded packages | |
| run: python build_wheels_from_file.py --requirements ${{ needs.extract-exclude-packages.outputs.packages_macos }} | |
| # Test building excluded packages on Linux ARM64 | |
| test-exclude-linux-arm64: | |
| name: Test exclude builds - Linux ARM64 (Python ${{ matrix.python-version }}) | |
| needs: [get-supported-versions, extract-exclude-packages] | |
| runs-on: ubuntu-24.04-arm | |
| container: python:${{ matrix.python-version }}-bookworm | |
| continue-on-error: true | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ${{ fromJson(needs.get-supported-versions.outputs.supported_python) }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r build_requirements.txt | |
| - name: Install OS dependencies | |
| run: os_dependencies/linux_arm.sh | |
| - name: Test building excluded packages | |
| run: python build_wheels_from_file.py --requirements ${{ needs.extract-exclude-packages.outputs.packages_linux }} | |
| # Test building excluded packages on Linux ARMv7 | |
| test-exclude-linux-armv7: | |
| name: Test exclude builds - Linux ARMv7 (Python ${{ matrix.python-version }}) | |
| needs: [get-supported-versions, extract-exclude-packages] | |
| runs-on: ubuntu-latest | |
| continue-on-error: true | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ${{ fromJson(needs.get-supported-versions.outputs.supported_python) }} | |
| steps: | |
| - name: Set up QEMU for ARMv7 | |
| uses: docker/setup-qemu-action@v3 | |
| with: | |
| platforms: linux/arm/v7 | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Test building excluded packages (in Docker) | |
| run: | | |
| docker run --rm --platform linux/arm/v7 \ | |
| -v $(pwd):/work \ | |
| -w /work \ | |
| -e PIP_NO_CACHE_DIR=1 \ | |
| -e LDFLAGS="-Wl,-z,max-page-size=0x1000" \ | |
| python:${{ matrix.python-version }}-bookworm \ | |
| bash -c " | |
| set -e | |
| python --version | |
| python -m pip install --no-cache-dir --upgrade pip | |
| python -m pip install --no-cache-dir -r build_requirements.txt | |
| bash os_dependencies/linux_arm.sh | |
| . \$HOME/.cargo/env 2>/dev/null || true | |
| python build_wheels_from_file.py --requirements ${{ needs.extract-exclude-packages.outputs.packages_linux }} | |
| " |