DT Python Wrapper Release v2.6.1 #186
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: DomainTools python wrapper CI/CD | |
| on: | |
| push: | |
| pull_request: | |
| release: | |
| types: [published] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.9", "3.10", "3.11"] | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install tox | |
| - name: Test with tox | |
| run: | | |
| export TOX_SKIP_MISSING_INTERPRETERS="False"; | |
| tox -e py | |
| e2e-tests: | |
| runs-on: ubuntu-latest | |
| env: | |
| MITM_BASIC_AUTH_CONTAINER_NAME: e2e_test_mitm_basic_auth | |
| MITM_CUSTOM_CERT_CONTAINER_NAME: e2e_test_mitm_custom_cert | |
| DOCKER_NETWORK_NAME: e2e_test_docker_network | |
| TEST_USER: integrations_testing | |
| TEST_KEY: ${{ secrets.TEST_KEY }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e . | |
| pip install -r ./requirements/development.txt | |
| - name: Setup E2E environment | |
| run: | | |
| sh ./tests/e2e/scripts/setup_e2e.sh | |
| - name: Run E2E tests | |
| run: | | |
| python -m pytest -s --capture=sys -v --cov=domaintools tests/e2e | |
| - name: Cleanup E2E environment | |
| if: '!cancelled()' | |
| run: | | |
| sh ./tests/e2e/scripts/cleanup_e2e.sh | |
| # run only in main and in pull request to `main` and in publish release | |
| release-build: | |
| if: | | |
| github.ref == 'refs/heads/main' || | |
| (github.event_name == 'pull_request' && github.base_ref == 'main') || | |
| (github.event_name == 'release' && github.event.action == 'published') | |
| needs: test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install build dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install build | |
| - name: Build package | |
| run: python -m build | |
| - name: Upload distributions as artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: release-dists | |
| path: dist/ | |
| publish-to-pypi: | |
| runs-on: ubuntu-latest | |
| needs: release-build | |
| if: github.event_name == 'release' && github.event.action == 'published' | |
| permissions: | |
| id-token: write # Required for OIDC trusted publishing | |
| steps: | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: release-dists | |
| path: dist/ | |
| - name: Publish to PyPI using API token | |
| uses: pypa/gh-action-pypi-publish@release/v1 |