Add Docker-based test harness with Transloadit CLI signature parity #166
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: CI | |
| on: | |
| push: | |
| branches: [main, master] | |
| pull_request: | |
| # Run on all pull requests regardless of source branch | |
| jobs: | |
| python: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install Transloadit CLI | |
| run: npm install -g transloadit | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| architecture: x64 | |
| cache: 'pip' | |
| - name: Install Poetry (Windows) | |
| if: runner.os == 'Windows' | |
| run: | | |
| (Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | python - | |
| echo "$HOME\AppData\Roaming\Python\Scripts" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
| - name: Install Poetry (Unix) | |
| if: runner.os != 'Windows' | |
| run: pip install --upgrade poetry | |
| - name: Install Dependencies | |
| run: poetry install | |
| - name: Test with coverage | |
| if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12' | |
| run: | | |
| poetry run pytest --cov=transloadit \ | |
| --cov-report=xml \ | |
| --cov-report=json \ | |
| --cov-report=html \ | |
| --cov-report=term-missing \ | |
| --cov-fail-under=65 \ | |
| tests | |
| env: | |
| TEST_NODE_PARITY: 1 | |
| - name: Test without coverage | |
| if: matrix.os != 'ubuntu-latest' || matrix.python-version != '3.12' | |
| run: poetry run pytest tests | |
| - name: Upload coverage reports | |
| # Only upload coverage if we have a token (skip for Dependabot PRs) | |
| if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12' && (github.event_name != 'pull_request' || github.actor != 'dependabot[bot]') | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| files: ./coverage.xml | |
| flags: unittests | |
| name: python-sdk | |
| fail_ci_if_error: false | |
| - name: Upload coverage reports (tokenless) | |
| # Use tokenless upload for Dependabot PRs | |
| if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12' && github.event_name == 'pull_request' && github.actor == 'dependabot[bot]' | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| files: ./coverage.xml | |
| flags: unittests | |
| name: python-sdk | |
| fail_ci_if_error: false | |
| - name: Upload coverage artifacts | |
| if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-reports | |
| path: | | |
| coverage.json | |
| htmlcov/ |