Skip to content

Test Data Validation #3

Test Data Validation

Test Data Validation #3

name: Test Data Validation
on:
workflow_dispatch:
inputs:
python-version:
description: 'Python version to test'
required: true
type: choice
options:
- '3.9'
- '3.10'
- '3.11'
- '3.12'
- '3.13'
default: '3.12'
jobs:
build-linux-wheel:
uses: ./.github/workflows/build-linux-wheel.yml
with:
python-version: ${{ inputs.python-version }}
timeout-minutes: 60
build-macos-wheel:
uses: ./.github/workflows/build-mac-wheel.yml
with:
python-version: ${{ inputs.python-version }}
timeout-minutes: 60
build-windows-wheel:
uses: ./.github/workflows/build-windows-wheel.yml
with:
python-version: ${{ inputs.python-version }}
python-tag: ${{ inputs.python-version == '3.9' && '39' || inputs.python-version == '3.10' && '310' || inputs.python-version == '3.11' && '311' || inputs.python-version == '3.12' && '312' || '313' }}
architecture: 'AMD64'
create-test-data:
needs: [build-linux-wheel, build-macos-wheel, build-windows-wheel]
strategy:
matrix:
include:
- os: ubuntu-latest
os-name: Linux
wheel-artifact: wheels-linux-${{ inputs.python-version }}
- os: macos-latest
os-name: macOS
wheel-artifact: wheels-macos-${{ inputs.python-version }}
- os: windows-latest
os-name: Windows
wheel-artifact: wheels-windows-${{ inputs.python-version }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ inputs.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
- name: Download wheel
uses: actions/download-artifact@v4
with:
name: ${{ matrix.wheel-artifact }}
path: dist/
- name: Install wheel (Linux/macOS)
if: runner.os != 'Windows'
run: |
pip install dist/*.whl
- name: Install wheel (Windows)
if: runner.os == 'Windows'
run: |
$wheel = Get-ChildItem -Path dist/*.whl | Select-Object -First 1
pip install $wheel.FullName
- name: Create test data (Linux/macOS)
if: runner.os != 'Windows'
run: |
python python_tests/scripts/create_test_data.py --out_dir ./test-data-${{ matrix.os-name }}
- name: Create test data (Windows)
if: runner.os == 'Windows'
run: |
python python_tests/scripts/create_test_data.py --out_dir ./test-data-${{ matrix.os-name }}
- name: Upload test data
uses: actions/upload-artifact@v4
with:
name: test-data-${{ matrix.os-name }}
path: test-data-${{ matrix.os-name }}/
retention-days: 1
validate-test-data:
needs: create-test-data
strategy:
matrix:
validator:
- os: ubuntu-latest
os-name: Linux
wheel-artifact: wheels-linux-${{ inputs.python-version }}
- os: macos-latest
os-name: macOS
wheel-artifact: wheels-macos-${{ inputs.python-version }}
- os: windows-latest
os-name: Windows
wheel-artifact: wheels-windows-${{ inputs.python-version }}
data-source: [Linux, macOS, Windows]
runs-on: ${{ matrix.validator.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ inputs.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
- name: Download wheel for validator OS
uses: actions/download-artifact@v4
with:
name: ${{ matrix.validator.wheel-artifact }}
path: dist/
- name: Install wheel (Linux/macOS)
if: runner.os != 'Windows'
run: |
pip install dist/*.whl
- name: Install wheel (Windows)
if: runner.os == 'Windows'
run: |
$wheel = Get-ChildItem -Path dist/*.whl | Select-Object -First 1
pip install $wheel.FullName
- name: Download test data from ${{ matrix.data-source }}
uses: actions/download-artifact@v4
with:
name: test-data-${{ matrix.data-source }}
path: test-data-${{ matrix.data-source }}/
- name: Validate test data (Linux/macOS)
if: runner.os != 'Windows'
run: |
python -m dbzero_ce.python_tests.validate_test_data --input_dir ./test-data-${{ matrix.data-source }}
- name: Validate test data (Windows)
if: runner.os == 'Windows'
run: |
python -m dbzero_ce.python_tests.validate_test_data --input_dir ./test-data-${{ matrix.data-source }}
cleanup:
needs: validate-test-data
if: always()
runs-on: ubuntu-latest
steps:
- name: Delete wheel artifacts
uses: geekyeggo/delete-artifact@v5
with:
name: |
wheels-linux-${{ inputs.python-version }}
wheels-macos-${{ inputs.python-version }}
wheels-windows-${{ inputs.python-version }}
failOnError: false
- name: Delete test data artifacts
uses: geekyeggo/delete-artifact@v5
with:
name: |
test-data-Linux
test-data-macOS
test-data-Windows
failOnError: false