π Migrate Dewrangle-related files and integration tests, replacing existing implementations #61
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: | |
| pull_request: | |
| types: [opened, reopened, synchronize, ready_for_review] | |
| concurrency: | |
| group: ci-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| DEWRANGLE_DEV_PAT: ${{ secrets.DEWRANGLE_DEV_PAT }} | |
| DEWRANGLE_BASE_URL: ${{ secrets.DEWRANGLE_BASE_URL }} | |
| AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| AWS_BUCKET_DATA_TRANSFER_TEST: ${{ secrets.AWS_BUCKET_DATA_TRANSFER_TEST }} | |
| CAVATICA_BILLING_GROUP_ID: ${{ secrets.CAVATICA_BILLING_GROUP_ID }} | |
| DWDS_DELETE_SAFETY_CHECK: ${{ secrets.DWDS_DELETE_SAFETY_CHECK }} | |
| jobs: | |
| lint: | |
| name: π¨ Lint code | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| cache: pip | |
| - name: π¦ Install deps | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install black==24.10.0 | |
| - name: π¨ Lint code | |
| run: | | |
| black --check --line-length 80 tests d3b_api_client_cli | |
| unit-test: | |
| name: β Unit test | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| cache: pip | |
| - name: π¦ Install deps | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e ".[dev]" | |
| - name: β Test | |
| run: | | |
| pytest --show-capture={no,stdout,stderr} tests/unit | |
| integration-test: | |
| name: β Integration test | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| # IMPORTANT: secrets are not exposed to fork PRs | |
| if: ${{ github.event.pull_request.head.repo.fork == false }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| cache: pip | |
| - name: π³ Sanity check Docker | |
| run: | | |
| docker version | |
| docker info | |
| - name: π¦ Install deps | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e ".[dev]" | |
| d3b-clients --help | |
| - name: β Test | |
| env: | |
| # Ensure these are present in the test process | |
| DEWRANGLE_DEV_PAT: ${{ secrets.DEWRANGLE_DEV_PAT }} | |
| DEWRANGLE_BASE_URL: ${{ secrets.DEWRANGLE_BASE_URL }} | |
| run: | | |
| # Optional: hard-fail early with a clear message instead of confusing KeyErrors | |
| python -c "import os; assert os.getenv('DEWRANGLE_DEV_PAT') and os.getenv('DEWRANGLE_BASE_URL'), 'Missing Dewrangle secrets'" | |
| pytest --show-capture={no,stdout,stderr} tests/integration |