Migrate integration tests from static API key secret to dd-sts #1286
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: Run Integration Tests | |
| permissions: | |
| contents: read | |
| id-token: write # Needed to federate tokens with dd-sts | |
| on: # yamllint disable-line rule:truthy | |
| pull_request: | |
| types: | |
| - labeled | |
| - unlabeled | |
| - opened | |
| - synchronize | |
| - reopened | |
| - ready_for_review | |
| concurrency: | |
| group: integration-${{ github.head_ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| integration_tests: | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'pull_request' && github.event.pull_request.draft == false && contains(github.event.pull_request.labels.*.name, 'ci/integrations') | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Get Datadog credentials | |
| id: dd-sts | |
| uses: DataDog/dd-sts-action@2e8187910199bd93129520183c093e19aa585c75 # v1.0.0 | |
| with: | |
| policy: datadogpy-integration-tests | |
| - name: Set up Python 3.9 | |
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | |
| with: | |
| python-version: "3.9" | |
| cache: "pip" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install tox | |
| - name: Run integration tests | |
| run: tox -e integration -- --vcr-record=all | |
| env: | |
| DD_TEST_CLIENT_API_KEY: ${{ steps.dd-sts.outputs.api_key }} | |
| DD_TEST_CLIENT_APP_KEY: ${{ steps.dd-sts.outputs.app_key }} | |
| DD_TEST_CLIENT_USER: ${{ vars.DD_TEST_CLIENT_USER }} | |
| - name: Run admin integration tests | |
| run: tox -e integration-admin -- --vcr-record=all | |
| env: | |
| DD_TEST_CLIENT_API_KEY: ${{ steps.dd-sts.outputs.api_key }} | |
| DD_TEST_CLIENT_APP_KEY: ${{ steps.dd-sts.outputs.app_key }} | |
| DD_TEST_CLIENT_USER: ${{ vars.DD_TEST_CLIENT_USER }} |