diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 05173db1f8..5d6e06ae43 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,6 +44,7 @@ jobs: python-version: 3.12 - run: | + pip install jinja2 python scripts/split-tox-gh-actions/split-tox-gh-actions.py --fail-on-changes build_lambda_layer: diff --git a/.github/workflows/test-common.yml b/.github/workflows/test-common.yml index 203758205c..74d66bc8f6 100644 --- a/.github/workflows/test-common.yml +++ b/.github/workflows/test-common.yml @@ -1,33 +1,26 @@ name: Test common - on: push: branches: - master - release/** - pull_request: - # Cancel in progress workflows on pull_requests. # https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true - permissions: contents: read - env: BUILD_CACHE_KEY: ${{ github.sha }} CACHED_BUILD_PATHS: | ${{ github.workspace }}/dist-serverless - jobs: - test: - name: common, python ${{ matrix.python-version }}, ${{ matrix.os }} - runs-on: ${{ matrix.os }} + test-pinned: timeout-minutes: 30 - + name: common pinned, python ${{ matrix.python-version }}, ${{ matrix.os }} + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: @@ -37,17 +30,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test common uses: nick-fields/retry@v2 with: @@ -58,30 +48,24 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-common" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - test-py27: - name: common, python 2.7, ubuntu-20.04 + timeout-minutes: 30 + name: common py27, python 2.7 runs-on: ubuntu-20.04 container: python:2.7 - timeout-minutes: 30 - steps: - uses: actions/checkout@v4 - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test common uses: nick-fields/retry@v2 with: @@ -92,22 +76,23 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh --exclude-latest "py2.7-common" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - + - uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: coverage.xml check_required_tests: name: All common tests passed or skipped - needs: [test, test-py27] + needs: [test-pinned, test-py27] # Always run this, even if a dependent job failed if: always() runs-on: ubuntu-20.04 steps: - name: Check for failures - if: contains(needs.test.result, 'failure') + if: contains(needs.test-pinned.result, 'failure') run: | echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1 - name: Check for 2.7 failures diff --git a/.github/workflows/test-integration-aiohttp.yml b/.github/workflows/test-integration-aiohttp.yml index abcf5f3fb0..b6aeb55e6e 100644 --- a/.github/workflows/test-integration-aiohttp.yml +++ b/.github/workflows/test-integration-aiohttp.yml @@ -1,33 +1,26 @@ name: Test aiohttp - on: push: branches: - master - release/** - pull_request: - # Cancel in progress workflows on pull_requests. # https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true - permissions: contents: read - env: BUILD_CACHE_KEY: ${{ github.sha }} CACHED_BUILD_PATHS: | ${{ github.workspace }}/dist-serverless - jobs: - test: - name: aiohttp, python ${{ matrix.python-version }}, ${{ matrix.os }} - runs-on: ${{ matrix.os }} + test-pinned: timeout-minutes: 30 - + name: aiohttp pinned, python ${{ matrix.python-version }}, ${{ matrix.os }} + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: @@ -37,17 +30,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test aiohttp uses: nick-fields/retry@v2 with: @@ -58,23 +48,18 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-aiohttp" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - - test-latest: + timeout-minutes: 30 name: aiohttp latest, python ${{ matrix.python-version }}, ${{ matrix.os }} runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: fail-fast: false matrix: @@ -84,17 +69,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test aiohttp uses: nick-fields/retry@v2 with: @@ -105,25 +87,22 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh "py${{ matrix.python-version }}-aiohttp-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - check_required_tests: name: All aiohttp tests passed or skipped - needs: test + needs: test-pinned # Always run this, even if a dependent job failed if: always() runs-on: ubuntu-20.04 steps: - name: Check for failures - if: contains(needs.test.result, 'failure') + if: contains(needs.test-pinned.result, 'failure') run: | echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1 diff --git a/.github/workflows/test-integration-ariadne.yml b/.github/workflows/test-integration-ariadne.yml index e821de427a..191dcd3301 100644 --- a/.github/workflows/test-integration-ariadne.yml +++ b/.github/workflows/test-integration-ariadne.yml @@ -1,33 +1,26 @@ name: Test ariadne - on: push: branches: - master - release/** - pull_request: - # Cancel in progress workflows on pull_requests. # https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true - permissions: contents: read - env: BUILD_CACHE_KEY: ${{ github.sha }} CACHED_BUILD_PATHS: | ${{ github.workspace }}/dist-serverless - jobs: - test: - name: ariadne, python ${{ matrix.python-version }}, ${{ matrix.os }} - runs-on: ${{ matrix.os }} + test-pinned: timeout-minutes: 30 - + name: ariadne pinned, python ${{ matrix.python-version }}, ${{ matrix.os }} + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: @@ -37,17 +30,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test ariadne uses: nick-fields/retry@v2 with: @@ -58,23 +48,18 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-ariadne" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - - test-latest: + timeout-minutes: 30 name: ariadne latest, python ${{ matrix.python-version }}, ${{ matrix.os }} runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: fail-fast: false matrix: @@ -84,17 +69,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test ariadne uses: nick-fields/retry@v2 with: @@ -105,25 +87,22 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh "py${{ matrix.python-version }}-ariadne-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - check_required_tests: name: All ariadne tests passed or skipped - needs: test + needs: test-pinned # Always run this, even if a dependent job failed if: always() runs-on: ubuntu-20.04 steps: - name: Check for failures - if: contains(needs.test.result, 'failure') + if: contains(needs.test-pinned.result, 'failure') run: | echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1 diff --git a/.github/workflows/test-integration-arq.yml b/.github/workflows/test-integration-arq.yml index beddc8e7a0..276b69ddaa 100644 --- a/.github/workflows/test-integration-arq.yml +++ b/.github/workflows/test-integration-arq.yml @@ -1,33 +1,26 @@ name: Test arq - on: push: branches: - master - release/** - pull_request: - # Cancel in progress workflows on pull_requests. # https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true - permissions: contents: read - env: BUILD_CACHE_KEY: ${{ github.sha }} CACHED_BUILD_PATHS: | ${{ github.workspace }}/dist-serverless - jobs: - test: - name: arq, python ${{ matrix.python-version }}, ${{ matrix.os }} - runs-on: ${{ matrix.os }} + test-pinned: timeout-minutes: 30 - + name: arq pinned, python ${{ matrix.python-version }}, ${{ matrix.os }} + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: @@ -37,17 +30,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test arq uses: nick-fields/retry@v2 with: @@ -58,23 +48,18 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-arq" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - - test-latest: + timeout-minutes: 30 name: arq latest, python ${{ matrix.python-version }}, ${{ matrix.os }} runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: fail-fast: false matrix: @@ -84,17 +69,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test arq uses: nick-fields/retry@v2 with: @@ -105,25 +87,22 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh "py${{ matrix.python-version }}-arq-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - check_required_tests: name: All arq tests passed or skipped - needs: test + needs: test-pinned # Always run this, even if a dependent job failed if: always() runs-on: ubuntu-20.04 steps: - name: Check for failures - if: contains(needs.test.result, 'failure') + if: contains(needs.test-pinned.result, 'failure') run: | echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1 diff --git a/.github/workflows/test-integration-asgi.yml b/.github/workflows/test-integration-asgi.yml index b06fc4f4d5..940d01f43f 100644 --- a/.github/workflows/test-integration-asgi.yml +++ b/.github/workflows/test-integration-asgi.yml @@ -1,33 +1,26 @@ name: Test asgi - on: push: branches: - master - release/** - pull_request: - # Cancel in progress workflows on pull_requests. # https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true - permissions: contents: read - env: BUILD_CACHE_KEY: ${{ github.sha }} CACHED_BUILD_PATHS: | ${{ github.workspace }}/dist-serverless - jobs: - test: - name: asgi, python ${{ matrix.python-version }}, ${{ matrix.os }} - runs-on: ${{ matrix.os }} + test-pinned: timeout-minutes: 30 - + name: asgi pinned, python ${{ matrix.python-version }}, ${{ matrix.os }} + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: @@ -37,17 +30,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test asgi uses: nick-fields/retry@v2 with: @@ -58,27 +48,22 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-asgi" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - - - check_required_tests: name: All asgi tests passed or skipped - needs: test + needs: test-pinned # Always run this, even if a dependent job failed if: always() runs-on: ubuntu-20.04 steps: - name: Check for failures - if: contains(needs.test.result, 'failure') + if: contains(needs.test-pinned.result, 'failure') run: | echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1 diff --git a/.github/workflows/test-integration-asyncpg.yml b/.github/workflows/test-integration-asyncpg.yml index 26c981f7ce..66c112ad47 100644 --- a/.github/workflows/test-integration-asyncpg.yml +++ b/.github/workflows/test-integration-asyncpg.yml @@ -1,33 +1,26 @@ name: Test asyncpg - on: push: branches: - master - release/** - pull_request: - # Cancel in progress workflows on pull_requests. # https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true - permissions: contents: read - env: BUILD_CACHE_KEY: ${{ github.sha }} CACHED_BUILD_PATHS: | ${{ github.workspace }}/dist-serverless - jobs: - test: - name: asyncpg, python ${{ matrix.python-version }}, ${{ matrix.os }} - runs-on: ${{ matrix.os }} + test-pinned: timeout-minutes: 30 - + name: asyncpg pinned, python ${{ matrix.python-version }}, ${{ matrix.os }} + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: @@ -56,19 +49,16 @@ jobs: SENTRY_PYTHON_TEST_POSTGRES_PASSWORD: sentry SENTRY_PYTHON_TEST_POSTGRES_NAME: ci_test SENTRY_PYTHON_TEST_POSTGRES_HOST: localhost - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" psql postgresql://postgres:sentry@localhost:5432 -c "create database ${SENTRY_PYTHON_TEST_POSTGRES_NAME};" || true psql postgresql://postgres:sentry@localhost:5432 -c "grant all privileges on database ${SENTRY_PYTHON_TEST_POSTGRES_NAME} to ${SENTRY_PYTHON_TEST_POSTGRES_USER};" || true - - name: Test asyncpg uses: nick-fields/retry@v2 with: @@ -79,23 +69,18 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-asyncpg" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - - test-latest: + timeout-minutes: 30 name: asyncpg latest, python ${{ matrix.python-version }}, ${{ matrix.os }} runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: fail-fast: false matrix: @@ -124,19 +109,16 @@ jobs: SENTRY_PYTHON_TEST_POSTGRES_PASSWORD: sentry SENTRY_PYTHON_TEST_POSTGRES_NAME: ci_test SENTRY_PYTHON_TEST_POSTGRES_HOST: localhost - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" psql postgresql://postgres:sentry@localhost:5432 -c "create database ${SENTRY_PYTHON_TEST_POSTGRES_NAME};" || true psql postgresql://postgres:sentry@localhost:5432 -c "grant all privileges on database ${SENTRY_PYTHON_TEST_POSTGRES_NAME} to ${SENTRY_PYTHON_TEST_POSTGRES_USER};" || true - - name: Test asyncpg uses: nick-fields/retry@v2 with: @@ -147,25 +129,22 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh "py${{ matrix.python-version }}-asyncpg-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - check_required_tests: name: All asyncpg tests passed or skipped - needs: test + needs: test-pinned # Always run this, even if a dependent job failed if: always() runs-on: ubuntu-20.04 steps: - name: Check for failures - if: contains(needs.test.result, 'failure') + if: contains(needs.test-pinned.result, 'failure') run: | echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1 diff --git a/.github/workflows/test-integration-aws_lambda.yml b/.github/workflows/test-integration-aws_lambda.yml index 62a221a819..8862ea3d7e 100644 --- a/.github/workflows/test-integration-aws_lambda.yml +++ b/.github/workflows/test-integration-aws_lambda.yml @@ -1,35 +1,28 @@ name: Test aws_lambda - on: push: branches: - master - release/** - pull_request: - # Cancel in progress workflows on pull_requests. # https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true - permissions: contents: read - env: SENTRY_PYTHON_TEST_AWS_ACCESS_KEY_ID: ${{ secrets.SENTRY_PYTHON_TEST_AWS_ACCESS_KEY_ID }} SENTRY_PYTHON_TEST_AWS_SECRET_ACCESS_KEY: ${{ secrets.SENTRY_PYTHON_TEST_AWS_SECRET_ACCESS_KEY }} BUILD_CACHE_KEY: ${{ github.sha }} CACHED_BUILD_PATHS: | ${{ github.workspace }}/dist-serverless - jobs: - test: - name: aws_lambda, python ${{ matrix.python-version }}, ${{ matrix.os }} - runs-on: ${{ matrix.os }} + test-pinned: timeout-minutes: 30 - + name: aws_lambda pinned, python ${{ matrix.python-version }}, ${{ matrix.os }} + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: @@ -39,17 +32,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test aws_lambda uses: nick-fields/retry@v2 with: @@ -60,27 +50,22 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-aws_lambda" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - - - check_required_tests: name: All aws_lambda tests passed or skipped - needs: test + needs: test-pinned # Always run this, even if a dependent job failed if: always() runs-on: ubuntu-20.04 steps: - name: Check for failures - if: contains(needs.test.result, 'failure') + if: contains(needs.test-pinned.result, 'failure') run: | echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1 diff --git a/.github/workflows/test-integration-beam.yml b/.github/workflows/test-integration-beam.yml index d0462c5ea5..41322686c4 100644 --- a/.github/workflows/test-integration-beam.yml +++ b/.github/workflows/test-integration-beam.yml @@ -1,33 +1,26 @@ name: Test beam - on: push: branches: - master - release/** - pull_request: - # Cancel in progress workflows on pull_requests. # https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true - permissions: contents: read - env: BUILD_CACHE_KEY: ${{ github.sha }} CACHED_BUILD_PATHS: | ${{ github.workspace }}/dist-serverless - jobs: - test: - name: beam, python ${{ matrix.python-version }}, ${{ matrix.os }} - runs-on: ${{ matrix.os }} + test-pinned: timeout-minutes: 30 - + name: beam pinned, python ${{ matrix.python-version }}, ${{ matrix.os }} + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: @@ -37,17 +30,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test beam uses: nick-fields/retry@v2 with: @@ -58,23 +48,18 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-beam" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - - test-latest: + timeout-minutes: 30 name: beam latest, python ${{ matrix.python-version }}, ${{ matrix.os }} runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: fail-fast: false matrix: @@ -84,17 +69,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test beam uses: nick-fields/retry@v2 with: @@ -105,25 +87,22 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh "py${{ matrix.python-version }}-beam-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - check_required_tests: name: All beam tests passed or skipped - needs: test + needs: test-pinned # Always run this, even if a dependent job failed if: always() runs-on: ubuntu-20.04 steps: - name: Check for failures - if: contains(needs.test.result, 'failure') + if: contains(needs.test-pinned.result, 'failure') run: | echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1 diff --git a/.github/workflows/test-integration-boto3.yml b/.github/workflows/test-integration-boto3.yml index 7cb9d49e80..34da054d64 100644 --- a/.github/workflows/test-integration-boto3.yml +++ b/.github/workflows/test-integration-boto3.yml @@ -1,33 +1,26 @@ name: Test boto3 - on: push: branches: - master - release/** - pull_request: - # Cancel in progress workflows on pull_requests. # https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true - permissions: contents: read - env: BUILD_CACHE_KEY: ${{ github.sha }} CACHED_BUILD_PATHS: | ${{ github.workspace }}/dist-serverless - jobs: - test: - name: boto3, python ${{ matrix.python-version }}, ${{ matrix.os }} - runs-on: ${{ matrix.os }} + test-pinned: timeout-minutes: 30 - + name: boto3 pinned, python ${{ matrix.python-version }}, ${{ matrix.os }} + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: @@ -37,17 +30,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test boto3 uses: nick-fields/retry@v2 with: @@ -58,30 +48,24 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-boto3" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - test-py27: - name: boto3, python 2.7, ubuntu-20.04 + timeout-minutes: 30 + name: boto3 py27, python 2.7 runs-on: ubuntu-20.04 container: python:2.7 - timeout-minutes: 30 - steps: - uses: actions/checkout@v4 - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test boto3 uses: nick-fields/retry@v2 with: @@ -92,17 +76,18 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh --exclude-latest "py2.7-boto3" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - + - uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: coverage.xml test-latest: + timeout-minutes: 30 name: boto3 latest, python ${{ matrix.python-version }}, ${{ matrix.os }} runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: fail-fast: false matrix: @@ -112,17 +97,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test boto3 uses: nick-fields/retry@v2 with: @@ -133,26 +115,23 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh "py${{ matrix.python-version }}-boto3-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - check_required_tests: name: All boto3 tests passed or skipped - needs: [test, test-py27] + needs: [test-pinned, test-py27] # Always run this, even if a dependent job failed if: always() runs-on: ubuntu-20.04 steps: - name: Check for failures - if: contains(needs.test.result, 'failure') + if: contains(needs.test-pinned.result, 'failure') run: | echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1 - name: Check for 2.7 failures diff --git a/.github/workflows/test-integration-bottle.yml b/.github/workflows/test-integration-bottle.yml index f470f115c1..e178400779 100644 --- a/.github/workflows/test-integration-bottle.yml +++ b/.github/workflows/test-integration-bottle.yml @@ -1,33 +1,26 @@ name: Test bottle - on: push: branches: - master - release/** - pull_request: - # Cancel in progress workflows on pull_requests. # https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true - permissions: contents: read - env: BUILD_CACHE_KEY: ${{ github.sha }} CACHED_BUILD_PATHS: | ${{ github.workspace }}/dist-serverless - jobs: - test: - name: bottle, python ${{ matrix.python-version }}, ${{ matrix.os }} - runs-on: ${{ matrix.os }} + test-pinned: timeout-minutes: 30 - + name: bottle pinned, python ${{ matrix.python-version }}, ${{ matrix.os }} + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: @@ -37,17 +30,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test bottle uses: nick-fields/retry@v2 with: @@ -58,30 +48,24 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-bottle" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - test-py27: - name: bottle, python 2.7, ubuntu-20.04 + timeout-minutes: 30 + name: bottle py27, python 2.7 runs-on: ubuntu-20.04 container: python:2.7 - timeout-minutes: 30 - steps: - uses: actions/checkout@v4 - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test bottle uses: nick-fields/retry@v2 with: @@ -92,17 +76,18 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh --exclude-latest "py2.7-bottle" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - + - uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: coverage.xml test-latest: + timeout-minutes: 30 name: bottle latest, python ${{ matrix.python-version }}, ${{ matrix.os }} runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: fail-fast: false matrix: @@ -112,17 +97,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test bottle uses: nick-fields/retry@v2 with: @@ -133,26 +115,23 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh "py${{ matrix.python-version }}-bottle-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - check_required_tests: name: All bottle tests passed or skipped - needs: [test, test-py27] + needs: [test-pinned, test-py27] # Always run this, even if a dependent job failed if: always() runs-on: ubuntu-20.04 steps: - name: Check for failures - if: contains(needs.test.result, 'failure') + if: contains(needs.test-pinned.result, 'failure') run: | echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1 - name: Check for 2.7 failures diff --git a/.github/workflows/test-integration-celery.yml b/.github/workflows/test-integration-celery.yml index f3b8589c22..27597859e3 100644 --- a/.github/workflows/test-integration-celery.yml +++ b/.github/workflows/test-integration-celery.yml @@ -1,33 +1,26 @@ name: Test celery - on: push: branches: - master - release/** - pull_request: - # Cancel in progress workflows on pull_requests. # https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true - permissions: contents: read - env: BUILD_CACHE_KEY: ${{ github.sha }} CACHED_BUILD_PATHS: | ${{ github.workspace }}/dist-serverless - jobs: - test: - name: celery, python ${{ matrix.python-version }}, ${{ matrix.os }} - runs-on: ${{ matrix.os }} + test-pinned: timeout-minutes: 30 - + name: celery pinned, python ${{ matrix.python-version }}, ${{ matrix.os }} + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: @@ -37,17 +30,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test celery uses: nick-fields/retry@v2 with: @@ -58,30 +48,24 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-celery" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - test-py27: - name: celery, python 2.7, ubuntu-20.04 + timeout-minutes: 30 + name: celery py27, python 2.7 runs-on: ubuntu-20.04 container: python:2.7 - timeout-minutes: 30 - steps: - uses: actions/checkout@v4 - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test celery uses: nick-fields/retry@v2 with: @@ -92,17 +76,18 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh --exclude-latest "py2.7-celery" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - + - uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: coverage.xml test-latest: + timeout-minutes: 30 name: celery latest, python ${{ matrix.python-version }}, ${{ matrix.os }} runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: fail-fast: false matrix: @@ -112,17 +97,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test celery uses: nick-fields/retry@v2 with: @@ -133,26 +115,23 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh "py${{ matrix.python-version }}-celery-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - check_required_tests: name: All celery tests passed or skipped - needs: [test, test-py27] + needs: [test-pinned, test-py27] # Always run this, even if a dependent job failed if: always() runs-on: ubuntu-20.04 steps: - name: Check for failures - if: contains(needs.test.result, 'failure') + if: contains(needs.test-pinned.result, 'failure') run: | echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1 - name: Check for 2.7 failures diff --git a/.github/workflows/test-integration-chalice.yml b/.github/workflows/test-integration-chalice.yml index 526f5c5c8a..b5181ca3e0 100644 --- a/.github/workflows/test-integration-chalice.yml +++ b/.github/workflows/test-integration-chalice.yml @@ -1,33 +1,26 @@ name: Test chalice - on: push: branches: - master - release/** - pull_request: - # Cancel in progress workflows on pull_requests. # https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true - permissions: contents: read - env: BUILD_CACHE_KEY: ${{ github.sha }} CACHED_BUILD_PATHS: | ${{ github.workspace }}/dist-serverless - jobs: - test: - name: chalice, python ${{ matrix.python-version }}, ${{ matrix.os }} - runs-on: ${{ matrix.os }} + test-pinned: timeout-minutes: 30 - + name: chalice pinned, python ${{ matrix.python-version }}, ${{ matrix.os }} + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: @@ -37,17 +30,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test chalice uses: nick-fields/retry@v2 with: @@ -58,23 +48,18 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-chalice" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - - test-latest: + timeout-minutes: 30 name: chalice latest, python ${{ matrix.python-version }}, ${{ matrix.os }} runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: fail-fast: false matrix: @@ -84,17 +69,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test chalice uses: nick-fields/retry@v2 with: @@ -105,25 +87,22 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh "py${{ matrix.python-version }}-chalice-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - check_required_tests: name: All chalice tests passed or skipped - needs: test + needs: test-pinned # Always run this, even if a dependent job failed if: always() runs-on: ubuntu-20.04 steps: - name: Check for failures - if: contains(needs.test.result, 'failure') + if: contains(needs.test-pinned.result, 'failure') run: | echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1 diff --git a/.github/workflows/test-integration-clickhouse_driver.yml b/.github/workflows/test-integration-clickhouse_driver.yml index 272a90921c..be976fb77f 100644 --- a/.github/workflows/test-integration-clickhouse_driver.yml +++ b/.github/workflows/test-integration-clickhouse_driver.yml @@ -1,33 +1,26 @@ name: Test clickhouse_driver - on: push: branches: - master - release/** - pull_request: - # Cancel in progress workflows on pull_requests. # https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true - permissions: contents: read - env: BUILD_CACHE_KEY: ${{ github.sha }} CACHED_BUILD_PATHS: | ${{ github.workspace }}/dist-serverless - jobs: - test: - name: clickhouse_driver, python ${{ matrix.python-version }}, ${{ matrix.os }} - runs-on: ${{ matrix.os }} + test-pinned: timeout-minutes: 30 - + name: clickhouse_driver pinned, python ${{ matrix.python-version }}, ${{ matrix.os }} + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: @@ -37,19 +30,15 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - uses: getsentry/action-clickhouse-in-ci@v1 - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test clickhouse_driver uses: nick-fields/retry@v2 with: @@ -60,23 +49,18 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-clickhouse_driver" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - - test-latest: + timeout-minutes: 30 name: clickhouse_driver latest, python ${{ matrix.python-version }}, ${{ matrix.os }} runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: fail-fast: false matrix: @@ -86,19 +70,15 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - uses: getsentry/action-clickhouse-in-ci@v1 - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test clickhouse_driver uses: nick-fields/retry@v2 with: @@ -109,25 +89,22 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh "py${{ matrix.python-version }}-clickhouse_driver-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - check_required_tests: name: All clickhouse_driver tests passed or skipped - needs: test + needs: test-pinned # Always run this, even if a dependent job failed if: always() runs-on: ubuntu-20.04 steps: - name: Check for failures - if: contains(needs.test.result, 'failure') + if: contains(needs.test-pinned.result, 'failure') run: | echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1 diff --git a/.github/workflows/test-integration-cloud_resource_context.yml b/.github/workflows/test-integration-cloud_resource_context.yml index 0797cb81fc..b10c16b843 100644 --- a/.github/workflows/test-integration-cloud_resource_context.yml +++ b/.github/workflows/test-integration-cloud_resource_context.yml @@ -1,33 +1,26 @@ name: Test cloud_resource_context - on: push: branches: - master - release/** - pull_request: - # Cancel in progress workflows on pull_requests. # https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true - permissions: contents: read - env: BUILD_CACHE_KEY: ${{ github.sha }} CACHED_BUILD_PATHS: | ${{ github.workspace }}/dist-serverless - jobs: - test: - name: cloud_resource_context, python ${{ matrix.python-version }}, ${{ matrix.os }} - runs-on: ${{ matrix.os }} + test-pinned: timeout-minutes: 30 - + name: cloud_resource_context pinned, python ${{ matrix.python-version }}, ${{ matrix.os }} + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: @@ -37,17 +30,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test cloud_resource_context uses: nick-fields/retry@v2 with: @@ -58,27 +48,22 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-cloud_resource_context" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - - - check_required_tests: name: All cloud_resource_context tests passed or skipped - needs: test + needs: test-pinned # Always run this, even if a dependent job failed if: always() runs-on: ubuntu-20.04 steps: - name: Check for failures - if: contains(needs.test.result, 'failure') + if: contains(needs.test-pinned.result, 'failure') run: | echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1 diff --git a/.github/workflows/test-integration-django.yml b/.github/workflows/test-integration-django.yml index 4e448ffefa..25830afb78 100644 --- a/.github/workflows/test-integration-django.yml +++ b/.github/workflows/test-integration-django.yml @@ -1,33 +1,26 @@ name: Test django - on: push: branches: - master - release/** - pull_request: - # Cancel in progress workflows on pull_requests. # https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true - permissions: contents: read - env: BUILD_CACHE_KEY: ${{ github.sha }} CACHED_BUILD_PATHS: | ${{ github.workspace }}/dist-serverless - jobs: - test: - name: django, python ${{ matrix.python-version }}, ${{ matrix.os }} - runs-on: ${{ matrix.os }} + test-pinned: timeout-minutes: 30 - + name: django pinned, python ${{ matrix.python-version }}, ${{ matrix.os }} + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: @@ -56,19 +49,16 @@ jobs: SENTRY_PYTHON_TEST_POSTGRES_PASSWORD: sentry SENTRY_PYTHON_TEST_POSTGRES_NAME: ci_test SENTRY_PYTHON_TEST_POSTGRES_HOST: localhost - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" psql postgresql://postgres:sentry@localhost:5432 -c "create database ${SENTRY_PYTHON_TEST_POSTGRES_NAME};" || true psql postgresql://postgres:sentry@localhost:5432 -c "grant all privileges on database ${SENTRY_PYTHON_TEST_POSTGRES_NAME} to ${SENTRY_PYTHON_TEST_POSTGRES_USER};" || true - - name: Test django uses: nick-fields/retry@v2 with: @@ -79,22 +69,19 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-django" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - test-py27: - name: django, python 2.7, ubuntu-20.04 + timeout-minutes: 30 + name: django py27, python 2.7 runs-on: ubuntu-20.04 container: python:2.7 - timeout-minutes: 30 services: postgres: image: postgres @@ -114,14 +101,13 @@ jobs: SENTRY_PYTHON_TEST_POSTGRES_PASSWORD: sentry SENTRY_PYTHON_TEST_POSTGRES_NAME: ci_test SENTRY_PYTHON_TEST_POSTGRES_HOST: postgres - steps: - uses: actions/checkout@v4 - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - + psql postgresql://postgres:sentry@postgres:5432 -c "create database ${SENTRY_PYTHON_TEST_POSTGRES_NAME};" || true + psql postgresql://postgres:sentry@postgres:5432 -c "grant all privileges on database ${SENTRY_PYTHON_TEST_POSTGRES_NAME} to ${SENTRY_PYTHON_TEST_POSTGRES_USER};" || true - name: Test django uses: nick-fields/retry@v2 with: @@ -132,17 +118,18 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh --exclude-latest "py2.7-django" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - + - uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: coverage.xml test-latest: + timeout-minutes: 30 name: django latest, python ${{ matrix.python-version }}, ${{ matrix.os }} runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: fail-fast: false matrix: @@ -171,19 +158,16 @@ jobs: SENTRY_PYTHON_TEST_POSTGRES_PASSWORD: sentry SENTRY_PYTHON_TEST_POSTGRES_NAME: ci_test SENTRY_PYTHON_TEST_POSTGRES_HOST: localhost - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" psql postgresql://postgres:sentry@localhost:5432 -c "create database ${SENTRY_PYTHON_TEST_POSTGRES_NAME};" || true psql postgresql://postgres:sentry@localhost:5432 -c "grant all privileges on database ${SENTRY_PYTHON_TEST_POSTGRES_NAME} to ${SENTRY_PYTHON_TEST_POSTGRES_USER};" || true - - name: Test django uses: nick-fields/retry@v2 with: @@ -194,26 +178,23 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh "py${{ matrix.python-version }}-django-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - check_required_tests: name: All django tests passed or skipped - needs: [test, test-py27] + needs: [test-pinned, test-py27] # Always run this, even if a dependent job failed if: always() runs-on: ubuntu-20.04 steps: - name: Check for failures - if: contains(needs.test.result, 'failure') + if: contains(needs.test-pinned.result, 'failure') run: | echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1 - name: Check for 2.7 failures diff --git a/.github/workflows/test-integration-falcon.yml b/.github/workflows/test-integration-falcon.yml index b0aadaed7a..a562c0b34f 100644 --- a/.github/workflows/test-integration-falcon.yml +++ b/.github/workflows/test-integration-falcon.yml @@ -1,33 +1,26 @@ name: Test falcon - on: push: branches: - master - release/** - pull_request: - # Cancel in progress workflows on pull_requests. # https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true - permissions: contents: read - env: BUILD_CACHE_KEY: ${{ github.sha }} CACHED_BUILD_PATHS: | ${{ github.workspace }}/dist-serverless - jobs: - test: - name: falcon, python ${{ matrix.python-version }}, ${{ matrix.os }} - runs-on: ${{ matrix.os }} + test-pinned: timeout-minutes: 30 - + name: falcon pinned, python ${{ matrix.python-version }}, ${{ matrix.os }} + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: @@ -37,17 +30,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test falcon uses: nick-fields/retry@v2 with: @@ -58,30 +48,24 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-falcon" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - test-py27: - name: falcon, python 2.7, ubuntu-20.04 + timeout-minutes: 30 + name: falcon py27, python 2.7 runs-on: ubuntu-20.04 container: python:2.7 - timeout-minutes: 30 - steps: - uses: actions/checkout@v4 - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test falcon uses: nick-fields/retry@v2 with: @@ -92,17 +76,18 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh --exclude-latest "py2.7-falcon" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - + - uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: coverage.xml test-latest: + timeout-minutes: 30 name: falcon latest, python ${{ matrix.python-version }}, ${{ matrix.os }} runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: fail-fast: false matrix: @@ -112,17 +97,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test falcon uses: nick-fields/retry@v2 with: @@ -133,26 +115,23 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh "py${{ matrix.python-version }}-falcon-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - check_required_tests: name: All falcon tests passed or skipped - needs: [test, test-py27] + needs: [test-pinned, test-py27] # Always run this, even if a dependent job failed if: always() runs-on: ubuntu-20.04 steps: - name: Check for failures - if: contains(needs.test.result, 'failure') + if: contains(needs.test-pinned.result, 'failure') run: | echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1 - name: Check for 2.7 failures diff --git a/.github/workflows/test-integration-fastapi.yml b/.github/workflows/test-integration-fastapi.yml index 1b1960d13b..8aff5bc0b5 100644 --- a/.github/workflows/test-integration-fastapi.yml +++ b/.github/workflows/test-integration-fastapi.yml @@ -1,33 +1,26 @@ name: Test fastapi - on: push: branches: - master - release/** - pull_request: - # Cancel in progress workflows on pull_requests. # https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true - permissions: contents: read - env: BUILD_CACHE_KEY: ${{ github.sha }} CACHED_BUILD_PATHS: | ${{ github.workspace }}/dist-serverless - jobs: - test: - name: fastapi, python ${{ matrix.python-version }}, ${{ matrix.os }} - runs-on: ${{ matrix.os }} + test-pinned: timeout-minutes: 30 - + name: fastapi pinned, python ${{ matrix.python-version }}, ${{ matrix.os }} + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: @@ -37,17 +30,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test fastapi uses: nick-fields/retry@v2 with: @@ -58,23 +48,18 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-fastapi" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - - test-latest: + timeout-minutes: 30 name: fastapi latest, python ${{ matrix.python-version }}, ${{ matrix.os }} runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: fail-fast: false matrix: @@ -84,17 +69,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test fastapi uses: nick-fields/retry@v2 with: @@ -105,25 +87,22 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh "py${{ matrix.python-version }}-fastapi-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - check_required_tests: name: All fastapi tests passed or skipped - needs: test + needs: test-pinned # Always run this, even if a dependent job failed if: always() runs-on: ubuntu-20.04 steps: - name: Check for failures - if: contains(needs.test.result, 'failure') + if: contains(needs.test-pinned.result, 'failure') run: | echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1 diff --git a/.github/workflows/test-integration-flask.yml b/.github/workflows/test-integration-flask.yml index a0a886e807..f598af0b1c 100644 --- a/.github/workflows/test-integration-flask.yml +++ b/.github/workflows/test-integration-flask.yml @@ -1,33 +1,26 @@ name: Test flask - on: push: branches: - master - release/** - pull_request: - # Cancel in progress workflows on pull_requests. # https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true - permissions: contents: read - env: BUILD_CACHE_KEY: ${{ github.sha }} CACHED_BUILD_PATHS: | ${{ github.workspace }}/dist-serverless - jobs: - test: - name: flask, python ${{ matrix.python-version }}, ${{ matrix.os }} - runs-on: ${{ matrix.os }} + test-pinned: timeout-minutes: 30 - + name: flask pinned, python ${{ matrix.python-version }}, ${{ matrix.os }} + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: @@ -37,17 +30,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test flask uses: nick-fields/retry@v2 with: @@ -58,30 +48,24 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-flask" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - test-py27: - name: flask, python 2.7, ubuntu-20.04 + timeout-minutes: 30 + name: flask py27, python 2.7 runs-on: ubuntu-20.04 container: python:2.7 - timeout-minutes: 30 - steps: - uses: actions/checkout@v4 - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test flask uses: nick-fields/retry@v2 with: @@ -92,17 +76,18 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh --exclude-latest "py2.7-flask" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - + - uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: coverage.xml test-latest: + timeout-minutes: 30 name: flask latest, python ${{ matrix.python-version }}, ${{ matrix.os }} runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: fail-fast: false matrix: @@ -112,17 +97,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test flask uses: nick-fields/retry@v2 with: @@ -133,26 +115,23 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh "py${{ matrix.python-version }}-flask-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - check_required_tests: name: All flask tests passed or skipped - needs: [test, test-py27] + needs: [test-pinned, test-py27] # Always run this, even if a dependent job failed if: always() runs-on: ubuntu-20.04 steps: - name: Check for failures - if: contains(needs.test.result, 'failure') + if: contains(needs.test-pinned.result, 'failure') run: | echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1 - name: Check for 2.7 failures diff --git a/.github/workflows/test-integration-gcp.yml b/.github/workflows/test-integration-gcp.yml index 604fb9cf67..560089b5c3 100644 --- a/.github/workflows/test-integration-gcp.yml +++ b/.github/workflows/test-integration-gcp.yml @@ -1,33 +1,26 @@ name: Test gcp - on: push: branches: - master - release/** - pull_request: - # Cancel in progress workflows on pull_requests. # https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true - permissions: contents: read - env: BUILD_CACHE_KEY: ${{ github.sha }} CACHED_BUILD_PATHS: | ${{ github.workspace }}/dist-serverless - jobs: - test: - name: gcp, python ${{ matrix.python-version }}, ${{ matrix.os }} - runs-on: ${{ matrix.os }} + test-pinned: timeout-minutes: 30 - + name: gcp pinned, python ${{ matrix.python-version }}, ${{ matrix.os }} + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: @@ -37,17 +30,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test gcp uses: nick-fields/retry@v2 with: @@ -58,27 +48,22 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-gcp" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - - - check_required_tests: name: All gcp tests passed or skipped - needs: test + needs: test-pinned # Always run this, even if a dependent job failed if: always() runs-on: ubuntu-20.04 steps: - name: Check for failures - if: contains(needs.test.result, 'failure') + if: contains(needs.test-pinned.result, 'failure') run: | echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1 diff --git a/.github/workflows/test-integration-gevent.yml b/.github/workflows/test-integration-gevent.yml index 65617a5847..81edfe772e 100644 --- a/.github/workflows/test-integration-gevent.yml +++ b/.github/workflows/test-integration-gevent.yml @@ -1,33 +1,26 @@ name: Test gevent - on: push: branches: - master - release/** - pull_request: - # Cancel in progress workflows on pull_requests. # https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true - permissions: contents: read - env: BUILD_CACHE_KEY: ${{ github.sha }} CACHED_BUILD_PATHS: | ${{ github.workspace }}/dist-serverless - jobs: - test: - name: gevent, python ${{ matrix.python-version }}, ${{ matrix.os }} - runs-on: ${{ matrix.os }} + test-pinned: timeout-minutes: 30 - + name: gevent pinned, python ${{ matrix.python-version }}, ${{ matrix.os }} + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: @@ -37,17 +30,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test gevent uses: nick-fields/retry@v2 with: @@ -58,30 +48,24 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-gevent" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - test-py27: - name: gevent, python 2.7, ubuntu-20.04 + timeout-minutes: 30 + name: gevent py27, python 2.7 runs-on: ubuntu-20.04 container: python:2.7 - timeout-minutes: 30 - steps: - uses: actions/checkout@v4 - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test gevent uses: nick-fields/retry@v2 with: @@ -92,22 +76,23 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh --exclude-latest "py2.7-gevent" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - + - uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: coverage.xml check_required_tests: name: All gevent tests passed or skipped - needs: [test, test-py27] + needs: [test-pinned, test-py27] # Always run this, even if a dependent job failed if: always() runs-on: ubuntu-20.04 steps: - name: Check for failures - if: contains(needs.test.result, 'failure') + if: contains(needs.test-pinned.result, 'failure') run: | echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1 - name: Check for 2.7 failures diff --git a/.github/workflows/test-integration-gql.yml b/.github/workflows/test-integration-gql.yml index c0ac1c3071..7726d0cab9 100644 --- a/.github/workflows/test-integration-gql.yml +++ b/.github/workflows/test-integration-gql.yml @@ -1,33 +1,26 @@ name: Test gql - on: push: branches: - master - release/** - pull_request: - # Cancel in progress workflows on pull_requests. # https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true - permissions: contents: read - env: BUILD_CACHE_KEY: ${{ github.sha }} CACHED_BUILD_PATHS: | ${{ github.workspace }}/dist-serverless - jobs: - test: - name: gql, python ${{ matrix.python-version }}, ${{ matrix.os }} - runs-on: ${{ matrix.os }} + test-pinned: timeout-minutes: 30 - + name: gql pinned, python ${{ matrix.python-version }}, ${{ matrix.os }} + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: @@ -37,17 +30,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test gql uses: nick-fields/retry@v2 with: @@ -58,23 +48,18 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-gql" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - - test-latest: + timeout-minutes: 30 name: gql latest, python ${{ matrix.python-version }}, ${{ matrix.os }} runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: fail-fast: false matrix: @@ -84,17 +69,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test gql uses: nick-fields/retry@v2 with: @@ -105,25 +87,22 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh "py${{ matrix.python-version }}-gql-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - check_required_tests: name: All gql tests passed or skipped - needs: test + needs: test-pinned # Always run this, even if a dependent job failed if: always() runs-on: ubuntu-20.04 steps: - name: Check for failures - if: contains(needs.test.result, 'failure') + if: contains(needs.test-pinned.result, 'failure') run: | echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1 diff --git a/.github/workflows/test-integration-graphene.yml b/.github/workflows/test-integration-graphene.yml index fb44f2fec3..32d75edbdf 100644 --- a/.github/workflows/test-integration-graphene.yml +++ b/.github/workflows/test-integration-graphene.yml @@ -1,33 +1,26 @@ name: Test graphene - on: push: branches: - master - release/** - pull_request: - # Cancel in progress workflows on pull_requests. # https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true - permissions: contents: read - env: BUILD_CACHE_KEY: ${{ github.sha }} CACHED_BUILD_PATHS: | ${{ github.workspace }}/dist-serverless - jobs: - test: - name: graphene, python ${{ matrix.python-version }}, ${{ matrix.os }} - runs-on: ${{ matrix.os }} + test-pinned: timeout-minutes: 30 - + name: graphene pinned, python ${{ matrix.python-version }}, ${{ matrix.os }} + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: @@ -37,17 +30,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test graphene uses: nick-fields/retry@v2 with: @@ -58,23 +48,18 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-graphene" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - - test-latest: + timeout-minutes: 30 name: graphene latest, python ${{ matrix.python-version }}, ${{ matrix.os }} runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: fail-fast: false matrix: @@ -84,17 +69,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test graphene uses: nick-fields/retry@v2 with: @@ -105,25 +87,22 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh "py${{ matrix.python-version }}-graphene-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - check_required_tests: name: All graphene tests passed or skipped - needs: test + needs: test-pinned # Always run this, even if a dependent job failed if: always() runs-on: ubuntu-20.04 steps: - name: Check for failures - if: contains(needs.test.result, 'failure') + if: contains(needs.test-pinned.result, 'failure') run: | echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1 diff --git a/.github/workflows/test-integration-grpc.yml b/.github/workflows/test-integration-grpc.yml index ab6892fda2..30034591d7 100644 --- a/.github/workflows/test-integration-grpc.yml +++ b/.github/workflows/test-integration-grpc.yml @@ -1,33 +1,26 @@ name: Test grpc - on: push: branches: - master - release/** - pull_request: - # Cancel in progress workflows on pull_requests. # https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true - permissions: contents: read - env: BUILD_CACHE_KEY: ${{ github.sha }} CACHED_BUILD_PATHS: | ${{ github.workspace }}/dist-serverless - jobs: - test: - name: grpc, python ${{ matrix.python-version }}, ${{ matrix.os }} - runs-on: ${{ matrix.os }} + test-pinned: timeout-minutes: 30 - + name: grpc pinned, python ${{ matrix.python-version }}, ${{ matrix.os }} + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: @@ -37,17 +30,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test grpc uses: nick-fields/retry@v2 with: @@ -58,23 +48,18 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-grpc" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - - test-latest: + timeout-minutes: 30 name: grpc latest, python ${{ matrix.python-version }}, ${{ matrix.os }} runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: fail-fast: false matrix: @@ -84,17 +69,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test grpc uses: nick-fields/retry@v2 with: @@ -105,25 +87,22 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh "py${{ matrix.python-version }}-grpc-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - check_required_tests: name: All grpc tests passed or skipped - needs: test + needs: test-pinned # Always run this, even if a dependent job failed if: always() runs-on: ubuntu-20.04 steps: - name: Check for failures - if: contains(needs.test.result, 'failure') + if: contains(needs.test-pinned.result, 'failure') run: | echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1 diff --git a/.github/workflows/test-integration-httpx.yml b/.github/workflows/test-integration-httpx.yml index 52ab457709..835f24b3ab 100644 --- a/.github/workflows/test-integration-httpx.yml +++ b/.github/workflows/test-integration-httpx.yml @@ -1,33 +1,26 @@ name: Test httpx - on: push: branches: - master - release/** - pull_request: - # Cancel in progress workflows on pull_requests. # https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true - permissions: contents: read - env: BUILD_CACHE_KEY: ${{ github.sha }} CACHED_BUILD_PATHS: | ${{ github.workspace }}/dist-serverless - jobs: - test: - name: httpx, python ${{ matrix.python-version }}, ${{ matrix.os }} - runs-on: ${{ matrix.os }} + test-pinned: timeout-minutes: 30 - + name: httpx pinned, python ${{ matrix.python-version }}, ${{ matrix.os }} + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: @@ -37,17 +30,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test httpx uses: nick-fields/retry@v2 with: @@ -58,23 +48,18 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-httpx" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - - test-latest: + timeout-minutes: 30 name: httpx latest, python ${{ matrix.python-version }}, ${{ matrix.os }} runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: fail-fast: false matrix: @@ -84,17 +69,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test httpx uses: nick-fields/retry@v2 with: @@ -105,25 +87,22 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh "py${{ matrix.python-version }}-httpx-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - check_required_tests: name: All httpx tests passed or skipped - needs: test + needs: test-pinned # Always run this, even if a dependent job failed if: always() runs-on: ubuntu-20.04 steps: - name: Check for failures - if: contains(needs.test.result, 'failure') + if: contains(needs.test-pinned.result, 'failure') run: | echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1 diff --git a/.github/workflows/test-integration-huey.yml b/.github/workflows/test-integration-huey.yml index 63c5b223b5..1477111ecc 100644 --- a/.github/workflows/test-integration-huey.yml +++ b/.github/workflows/test-integration-huey.yml @@ -1,33 +1,26 @@ name: Test huey - on: push: branches: - master - release/** - pull_request: - # Cancel in progress workflows on pull_requests. # https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true - permissions: contents: read - env: BUILD_CACHE_KEY: ${{ github.sha }} CACHED_BUILD_PATHS: | ${{ github.workspace }}/dist-serverless - jobs: - test: - name: huey, python ${{ matrix.python-version }}, ${{ matrix.os }} - runs-on: ${{ matrix.os }} + test-pinned: timeout-minutes: 30 - + name: huey pinned, python ${{ matrix.python-version }}, ${{ matrix.os }} + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: @@ -37,17 +30,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test huey uses: nick-fields/retry@v2 with: @@ -58,30 +48,24 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-huey" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - test-py27: - name: huey, python 2.7, ubuntu-20.04 + timeout-minutes: 30 + name: huey py27, python 2.7 runs-on: ubuntu-20.04 container: python:2.7 - timeout-minutes: 30 - steps: - uses: actions/checkout@v4 - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test huey uses: nick-fields/retry@v2 with: @@ -92,17 +76,18 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh --exclude-latest "py2.7-huey" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - + - uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: coverage.xml test-latest: + timeout-minutes: 30 name: huey latest, python ${{ matrix.python-version }}, ${{ matrix.os }} runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: fail-fast: false matrix: @@ -112,17 +97,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test huey uses: nick-fields/retry@v2 with: @@ -133,26 +115,23 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh "py${{ matrix.python-version }}-huey-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - check_required_tests: name: All huey tests passed or skipped - needs: [test, test-py27] + needs: [test-pinned, test-py27] # Always run this, even if a dependent job failed if: always() runs-on: ubuntu-20.04 steps: - name: Check for failures - if: contains(needs.test.result, 'failure') + if: contains(needs.test-pinned.result, 'failure') run: | echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1 - name: Check for 2.7 failures diff --git a/.github/workflows/test-integration-loguru.yml b/.github/workflows/test-integration-loguru.yml index 0545c471b0..1916f69b5a 100644 --- a/.github/workflows/test-integration-loguru.yml +++ b/.github/workflows/test-integration-loguru.yml @@ -1,33 +1,26 @@ name: Test loguru - on: push: branches: - master - release/** - pull_request: - # Cancel in progress workflows on pull_requests. # https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true - permissions: contents: read - env: BUILD_CACHE_KEY: ${{ github.sha }} CACHED_BUILD_PATHS: | ${{ github.workspace }}/dist-serverless - jobs: - test: - name: loguru, python ${{ matrix.python-version }}, ${{ matrix.os }} - runs-on: ${{ matrix.os }} + test-pinned: timeout-minutes: 30 - + name: loguru pinned, python ${{ matrix.python-version }}, ${{ matrix.os }} + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: @@ -37,17 +30,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test loguru uses: nick-fields/retry@v2 with: @@ -58,23 +48,18 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-loguru" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - - test-latest: + timeout-minutes: 30 name: loguru latest, python ${{ matrix.python-version }}, ${{ matrix.os }} runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: fail-fast: false matrix: @@ -84,17 +69,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test loguru uses: nick-fields/retry@v2 with: @@ -105,25 +87,22 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh "py${{ matrix.python-version }}-loguru-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - check_required_tests: name: All loguru tests passed or skipped - needs: test + needs: test-pinned # Always run this, even if a dependent job failed if: always() runs-on: ubuntu-20.04 steps: - name: Check for failures - if: contains(needs.test.result, 'failure') + if: contains(needs.test-pinned.result, 'failure') run: | echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1 diff --git a/.github/workflows/test-integration-opentelemetry.yml b/.github/workflows/test-integration-opentelemetry.yml index f34fcfe93b..e90015f9df 100644 --- a/.github/workflows/test-integration-opentelemetry.yml +++ b/.github/workflows/test-integration-opentelemetry.yml @@ -1,33 +1,26 @@ name: Test opentelemetry - on: push: branches: - master - release/** - pull_request: - # Cancel in progress workflows on pull_requests. # https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true - permissions: contents: read - env: BUILD_CACHE_KEY: ${{ github.sha }} CACHED_BUILD_PATHS: | ${{ github.workspace }}/dist-serverless - jobs: - test: - name: opentelemetry, python ${{ matrix.python-version }}, ${{ matrix.os }} - runs-on: ${{ matrix.os }} + test-pinned: timeout-minutes: 30 - + name: opentelemetry pinned, python ${{ matrix.python-version }}, ${{ matrix.os }} + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: @@ -37,17 +30,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test opentelemetry uses: nick-fields/retry@v2 with: @@ -58,27 +48,22 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-opentelemetry" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - - - check_required_tests: name: All opentelemetry tests passed or skipped - needs: test + needs: test-pinned # Always run this, even if a dependent job failed if: always() runs-on: ubuntu-20.04 steps: - name: Check for failures - if: contains(needs.test.result, 'failure') + if: contains(needs.test-pinned.result, 'failure') run: | echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1 diff --git a/.github/workflows/test-integration-pure_eval.yml b/.github/workflows/test-integration-pure_eval.yml index 04e6ffd674..7b025fe403 100644 --- a/.github/workflows/test-integration-pure_eval.yml +++ b/.github/workflows/test-integration-pure_eval.yml @@ -1,33 +1,26 @@ name: Test pure_eval - on: push: branches: - master - release/** - pull_request: - # Cancel in progress workflows on pull_requests. # https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true - permissions: contents: read - env: BUILD_CACHE_KEY: ${{ github.sha }} CACHED_BUILD_PATHS: | ${{ github.workspace }}/dist-serverless - jobs: - test: - name: pure_eval, python ${{ matrix.python-version }}, ${{ matrix.os }} - runs-on: ${{ matrix.os }} + test-pinned: timeout-minutes: 30 - + name: pure_eval pinned, python ${{ matrix.python-version }}, ${{ matrix.os }} + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: @@ -37,17 +30,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test pure_eval uses: nick-fields/retry@v2 with: @@ -58,27 +48,22 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-pure_eval" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - - - check_required_tests: name: All pure_eval tests passed or skipped - needs: test + needs: test-pinned # Always run this, even if a dependent job failed if: always() runs-on: ubuntu-20.04 steps: - name: Check for failures - if: contains(needs.test.result, 'failure') + if: contains(needs.test-pinned.result, 'failure') run: | echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1 diff --git a/.github/workflows/test-integration-pymongo.yml b/.github/workflows/test-integration-pymongo.yml index b3f94b33a9..4de6c3adfc 100644 --- a/.github/workflows/test-integration-pymongo.yml +++ b/.github/workflows/test-integration-pymongo.yml @@ -1,33 +1,26 @@ name: Test pymongo - on: push: branches: - master - release/** - pull_request: - # Cancel in progress workflows on pull_requests. # https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true - permissions: contents: read - env: BUILD_CACHE_KEY: ${{ github.sha }} CACHED_BUILD_PATHS: | ${{ github.workspace }}/dist-serverless - jobs: - test: - name: pymongo, python ${{ matrix.python-version }}, ${{ matrix.os }} - runs-on: ${{ matrix.os }} + test-pinned: timeout-minutes: 30 - + name: pymongo pinned, python ${{ matrix.python-version }}, ${{ matrix.os }} + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: @@ -37,17 +30,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test pymongo uses: nick-fields/retry@v2 with: @@ -58,30 +48,24 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-pymongo" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - test-py27: - name: pymongo, python 2.7, ubuntu-20.04 + timeout-minutes: 30 + name: pymongo py27, python 2.7 runs-on: ubuntu-20.04 container: python:2.7 - timeout-minutes: 30 - steps: - uses: actions/checkout@v4 - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test pymongo uses: nick-fields/retry@v2 with: @@ -92,17 +76,18 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh --exclude-latest "py2.7-pymongo" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - + - uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: coverage.xml test-latest: + timeout-minutes: 30 name: pymongo latest, python ${{ matrix.python-version }}, ${{ matrix.os }} runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: fail-fast: false matrix: @@ -112,17 +97,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test pymongo uses: nick-fields/retry@v2 with: @@ -133,26 +115,23 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh "py${{ matrix.python-version }}-pymongo-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - check_required_tests: name: All pymongo tests passed or skipped - needs: [test, test-py27] + needs: [test-pinned, test-py27] # Always run this, even if a dependent job failed if: always() runs-on: ubuntu-20.04 steps: - name: Check for failures - if: contains(needs.test.result, 'failure') + if: contains(needs.test-pinned.result, 'failure') run: | echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1 - name: Check for 2.7 failures diff --git a/.github/workflows/test-integration-pyramid.yml b/.github/workflows/test-integration-pyramid.yml index 7a6065563c..efa204ca9b 100644 --- a/.github/workflows/test-integration-pyramid.yml +++ b/.github/workflows/test-integration-pyramid.yml @@ -1,33 +1,26 @@ name: Test pyramid - on: push: branches: - master - release/** - pull_request: - # Cancel in progress workflows on pull_requests. # https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true - permissions: contents: read - env: BUILD_CACHE_KEY: ${{ github.sha }} CACHED_BUILD_PATHS: | ${{ github.workspace }}/dist-serverless - jobs: - test: - name: pyramid, python ${{ matrix.python-version }}, ${{ matrix.os }} - runs-on: ${{ matrix.os }} + test-pinned: timeout-minutes: 30 - + name: pyramid pinned, python ${{ matrix.python-version }}, ${{ matrix.os }} + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: @@ -37,17 +30,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test pyramid uses: nick-fields/retry@v2 with: @@ -58,30 +48,24 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-pyramid" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - test-py27: - name: pyramid, python 2.7, ubuntu-20.04 + timeout-minutes: 30 + name: pyramid py27, python 2.7 runs-on: ubuntu-20.04 container: python:2.7 - timeout-minutes: 30 - steps: - uses: actions/checkout@v4 - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test pyramid uses: nick-fields/retry@v2 with: @@ -92,17 +76,18 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh --exclude-latest "py2.7-pyramid" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - + - uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: coverage.xml test-latest: + timeout-minutes: 30 name: pyramid latest, python ${{ matrix.python-version }}, ${{ matrix.os }} runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: fail-fast: false matrix: @@ -112,17 +97,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test pyramid uses: nick-fields/retry@v2 with: @@ -133,26 +115,23 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh "py${{ matrix.python-version }}-pyramid-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - check_required_tests: name: All pyramid tests passed or skipped - needs: [test, test-py27] + needs: [test-pinned, test-py27] # Always run this, even if a dependent job failed if: always() runs-on: ubuntu-20.04 steps: - name: Check for failures - if: contains(needs.test.result, 'failure') + if: contains(needs.test-pinned.result, 'failure') run: | echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1 - name: Check for 2.7 failures diff --git a/.github/workflows/test-integration-quart.yml b/.github/workflows/test-integration-quart.yml index 307c3cc60c..14a8dff00f 100644 --- a/.github/workflows/test-integration-quart.yml +++ b/.github/workflows/test-integration-quart.yml @@ -1,33 +1,26 @@ name: Test quart - on: push: branches: - master - release/** - pull_request: - # Cancel in progress workflows on pull_requests. # https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true - permissions: contents: read - env: BUILD_CACHE_KEY: ${{ github.sha }} CACHED_BUILD_PATHS: | ${{ github.workspace }}/dist-serverless - jobs: - test: - name: quart, python ${{ matrix.python-version }}, ${{ matrix.os }} - runs-on: ${{ matrix.os }} + test-pinned: timeout-minutes: 30 - + name: quart pinned, python ${{ matrix.python-version }}, ${{ matrix.os }} + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: @@ -37,17 +30,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test quart uses: nick-fields/retry@v2 with: @@ -58,23 +48,18 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-quart" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - - test-latest: + timeout-minutes: 30 name: quart latest, python ${{ matrix.python-version }}, ${{ matrix.os }} runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: fail-fast: false matrix: @@ -84,17 +69,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test quart uses: nick-fields/retry@v2 with: @@ -105,25 +87,22 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh "py${{ matrix.python-version }}-quart-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - check_required_tests: name: All quart tests passed or skipped - needs: test + needs: test-pinned # Always run this, even if a dependent job failed if: always() runs-on: ubuntu-20.04 steps: - name: Check for failures - if: contains(needs.test.result, 'failure') + if: contains(needs.test-pinned.result, 'failure') run: | echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1 diff --git a/.github/workflows/test-integration-redis.yml b/.github/workflows/test-integration-redis.yml index c1f1ec95e5..1579299fec 100644 --- a/.github/workflows/test-integration-redis.yml +++ b/.github/workflows/test-integration-redis.yml @@ -1,33 +1,26 @@ name: Test redis - on: push: branches: - master - release/** - pull_request: - # Cancel in progress workflows on pull_requests. # https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true - permissions: contents: read - env: BUILD_CACHE_KEY: ${{ github.sha }} CACHED_BUILD_PATHS: | ${{ github.workspace }}/dist-serverless - jobs: - test: - name: redis, python ${{ matrix.python-version }}, ${{ matrix.os }} - runs-on: ${{ matrix.os }} + test-pinned: timeout-minutes: 30 - + name: redis pinned, python ${{ matrix.python-version }}, ${{ matrix.os }} + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: @@ -37,17 +30,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test redis uses: nick-fields/retry@v2 with: @@ -58,30 +48,24 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-redis" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - test-py27: - name: redis, python 2.7, ubuntu-20.04 + timeout-minutes: 30 + name: redis py27, python 2.7 runs-on: ubuntu-20.04 container: python:2.7 - timeout-minutes: 30 - steps: - uses: actions/checkout@v4 - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test redis uses: nick-fields/retry@v2 with: @@ -92,17 +76,18 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh --exclude-latest "py2.7-redis" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - + - uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: coverage.xml test-latest: + timeout-minutes: 30 name: redis latest, python ${{ matrix.python-version }}, ${{ matrix.os }} runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: fail-fast: false matrix: @@ -112,17 +97,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test redis uses: nick-fields/retry@v2 with: @@ -133,26 +115,23 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh "py${{ matrix.python-version }}-redis-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - check_required_tests: name: All redis tests passed or skipped - needs: [test, test-py27] + needs: [test-pinned, test-py27] # Always run this, even if a dependent job failed if: always() runs-on: ubuntu-20.04 steps: - name: Check for failures - if: contains(needs.test.result, 'failure') + if: contains(needs.test-pinned.result, 'failure') run: | echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1 - name: Check for 2.7 failures diff --git a/.github/workflows/test-integration-rediscluster.yml b/.github/workflows/test-integration-rediscluster.yml index d33d3e4e1e..e235e277ad 100644 --- a/.github/workflows/test-integration-rediscluster.yml +++ b/.github/workflows/test-integration-rediscluster.yml @@ -1,33 +1,26 @@ name: Test rediscluster - on: push: branches: - master - release/** - pull_request: - # Cancel in progress workflows on pull_requests. # https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true - permissions: contents: read - env: BUILD_CACHE_KEY: ${{ github.sha }} CACHED_BUILD_PATHS: | ${{ github.workspace }}/dist-serverless - jobs: - test: - name: rediscluster, python ${{ matrix.python-version }}, ${{ matrix.os }} - runs-on: ${{ matrix.os }} + test-pinned: timeout-minutes: 30 - + name: rediscluster pinned, python ${{ matrix.python-version }}, ${{ matrix.os }} + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: @@ -37,17 +30,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test rediscluster uses: nick-fields/retry@v2 with: @@ -58,30 +48,24 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-rediscluster" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - test-py27: - name: rediscluster, python 2.7, ubuntu-20.04 + timeout-minutes: 30 + name: rediscluster py27, python 2.7 runs-on: ubuntu-20.04 container: python:2.7 - timeout-minutes: 30 - steps: - uses: actions/checkout@v4 - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test rediscluster uses: nick-fields/retry@v2 with: @@ -92,22 +76,23 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh --exclude-latest "py2.7-rediscluster" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - + - uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: coverage.xml check_required_tests: name: All rediscluster tests passed or skipped - needs: [test, test-py27] + needs: [test-pinned, test-py27] # Always run this, even if a dependent job failed if: always() runs-on: ubuntu-20.04 steps: - name: Check for failures - if: contains(needs.test.result, 'failure') + if: contains(needs.test-pinned.result, 'failure') run: | echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1 - name: Check for 2.7 failures diff --git a/.github/workflows/test-integration-requests.yml b/.github/workflows/test-integration-requests.yml index ada96618c2..dd08b2c669 100644 --- a/.github/workflows/test-integration-requests.yml +++ b/.github/workflows/test-integration-requests.yml @@ -1,33 +1,26 @@ name: Test requests - on: push: branches: - master - release/** - pull_request: - # Cancel in progress workflows on pull_requests. # https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true - permissions: contents: read - env: BUILD_CACHE_KEY: ${{ github.sha }} CACHED_BUILD_PATHS: | ${{ github.workspace }}/dist-serverless - jobs: - test: - name: requests, python ${{ matrix.python-version }}, ${{ matrix.os }} - runs-on: ${{ matrix.os }} + test-pinned: timeout-minutes: 30 - + name: requests pinned, python ${{ matrix.python-version }}, ${{ matrix.os }} + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: @@ -37,17 +30,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test requests uses: nick-fields/retry@v2 with: @@ -58,30 +48,24 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-requests" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - test-py27: - name: requests, python 2.7, ubuntu-20.04 + timeout-minutes: 30 + name: requests py27, python 2.7 runs-on: ubuntu-20.04 container: python:2.7 - timeout-minutes: 30 - steps: - uses: actions/checkout@v4 - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test requests uses: nick-fields/retry@v2 with: @@ -92,22 +76,23 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh --exclude-latest "py2.7-requests" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - + - uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: coverage.xml check_required_tests: name: All requests tests passed or skipped - needs: [test, test-py27] + needs: [test-pinned, test-py27] # Always run this, even if a dependent job failed if: always() runs-on: ubuntu-20.04 steps: - name: Check for failures - if: contains(needs.test.result, 'failure') + if: contains(needs.test-pinned.result, 'failure') run: | echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1 - name: Check for 2.7 failures diff --git a/.github/workflows/test-integration-rq.yml b/.github/workflows/test-integration-rq.yml index 9474ecaba1..32f24ce305 100644 --- a/.github/workflows/test-integration-rq.yml +++ b/.github/workflows/test-integration-rq.yml @@ -1,33 +1,26 @@ name: Test rq - on: push: branches: - master - release/** - pull_request: - # Cancel in progress workflows on pull_requests. # https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true - permissions: contents: read - env: BUILD_CACHE_KEY: ${{ github.sha }} CACHED_BUILD_PATHS: | ${{ github.workspace }}/dist-serverless - jobs: - test: - name: rq, python ${{ matrix.python-version }}, ${{ matrix.os }} - runs-on: ${{ matrix.os }} + test-pinned: timeout-minutes: 30 - + name: rq pinned, python ${{ matrix.python-version }}, ${{ matrix.os }} + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: @@ -37,17 +30,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test rq uses: nick-fields/retry@v2 with: @@ -58,30 +48,24 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-rq" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - test-py27: - name: rq, python 2.7, ubuntu-20.04 + timeout-minutes: 30 + name: rq py27, python 2.7 runs-on: ubuntu-20.04 container: python:2.7 - timeout-minutes: 30 - steps: - uses: actions/checkout@v4 - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test rq uses: nick-fields/retry@v2 with: @@ -92,17 +76,18 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh --exclude-latest "py2.7-rq" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - + - uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: coverage.xml test-latest: + timeout-minutes: 30 name: rq latest, python ${{ matrix.python-version }}, ${{ matrix.os }} runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: fail-fast: false matrix: @@ -112,17 +97,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test rq uses: nick-fields/retry@v2 with: @@ -133,26 +115,23 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh "py${{ matrix.python-version }}-rq-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - check_required_tests: name: All rq tests passed or skipped - needs: [test, test-py27] + needs: [test-pinned, test-py27] # Always run this, even if a dependent job failed if: always() runs-on: ubuntu-20.04 steps: - name: Check for failures - if: contains(needs.test.result, 'failure') + if: contains(needs.test-pinned.result, 'failure') run: | echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1 - name: Check for 2.7 failures diff --git a/.github/workflows/test-integration-sanic.yml b/.github/workflows/test-integration-sanic.yml index 32a6736c40..c359c3b4fa 100644 --- a/.github/workflows/test-integration-sanic.yml +++ b/.github/workflows/test-integration-sanic.yml @@ -1,33 +1,26 @@ name: Test sanic - on: push: branches: - master - release/** - pull_request: - # Cancel in progress workflows on pull_requests. # https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true - permissions: contents: read - env: BUILD_CACHE_KEY: ${{ github.sha }} CACHED_BUILD_PATHS: | ${{ github.workspace }}/dist-serverless - jobs: - test: - name: sanic, python ${{ matrix.python-version }}, ${{ matrix.os }} - runs-on: ${{ matrix.os }} + test-pinned: timeout-minutes: 30 - + name: sanic pinned, python ${{ matrix.python-version }}, ${{ matrix.os }} + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: @@ -37,17 +30,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test sanic uses: nick-fields/retry@v2 with: @@ -58,23 +48,18 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-sanic" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - - test-latest: + timeout-minutes: 30 name: sanic latest, python ${{ matrix.python-version }}, ${{ matrix.os }} runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: fail-fast: false matrix: @@ -84,17 +69,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test sanic uses: nick-fields/retry@v2 with: @@ -105,25 +87,22 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh "py${{ matrix.python-version }}-sanic-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - check_required_tests: name: All sanic tests passed or skipped - needs: test + needs: test-pinned # Always run this, even if a dependent job failed if: always() runs-on: ubuntu-20.04 steps: - name: Check for failures - if: contains(needs.test.result, 'failure') + if: contains(needs.test-pinned.result, 'failure') run: | echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1 diff --git a/.github/workflows/test-integration-sqlalchemy.yml b/.github/workflows/test-integration-sqlalchemy.yml index b8ba174045..ea94aaa977 100644 --- a/.github/workflows/test-integration-sqlalchemy.yml +++ b/.github/workflows/test-integration-sqlalchemy.yml @@ -1,33 +1,26 @@ name: Test sqlalchemy - on: push: branches: - master - release/** - pull_request: - # Cancel in progress workflows on pull_requests. # https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true - permissions: contents: read - env: BUILD_CACHE_KEY: ${{ github.sha }} CACHED_BUILD_PATHS: | ${{ github.workspace }}/dist-serverless - jobs: - test: - name: sqlalchemy, python ${{ matrix.python-version }}, ${{ matrix.os }} - runs-on: ${{ matrix.os }} + test-pinned: timeout-minutes: 30 - + name: sqlalchemy pinned, python ${{ matrix.python-version }}, ${{ matrix.os }} + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: @@ -37,17 +30,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test sqlalchemy uses: nick-fields/retry@v2 with: @@ -58,30 +48,24 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-sqlalchemy" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - test-py27: - name: sqlalchemy, python 2.7, ubuntu-20.04 + timeout-minutes: 30 + name: sqlalchemy py27, python 2.7 runs-on: ubuntu-20.04 container: python:2.7 - timeout-minutes: 30 - steps: - uses: actions/checkout@v4 - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test sqlalchemy uses: nick-fields/retry@v2 with: @@ -92,17 +76,18 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh --exclude-latest "py2.7-sqlalchemy" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - + - uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: coverage.xml test-latest: + timeout-minutes: 30 name: sqlalchemy latest, python ${{ matrix.python-version }}, ${{ matrix.os }} runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: fail-fast: false matrix: @@ -112,17 +97,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test sqlalchemy uses: nick-fields/retry@v2 with: @@ -133,26 +115,23 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh "py${{ matrix.python-version }}-sqlalchemy-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - check_required_tests: name: All sqlalchemy tests passed or skipped - needs: [test, test-py27] + needs: [test-pinned, test-py27] # Always run this, even if a dependent job failed if: always() runs-on: ubuntu-20.04 steps: - name: Check for failures - if: contains(needs.test.result, 'failure') + if: contains(needs.test-pinned.result, 'failure') run: | echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1 - name: Check for 2.7 failures diff --git a/.github/workflows/test-integration-starlette.yml b/.github/workflows/test-integration-starlette.yml index 5b0f1a01cc..e1de19e038 100644 --- a/.github/workflows/test-integration-starlette.yml +++ b/.github/workflows/test-integration-starlette.yml @@ -1,33 +1,26 @@ name: Test starlette - on: push: branches: - master - release/** - pull_request: - # Cancel in progress workflows on pull_requests. # https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true - permissions: contents: read - env: BUILD_CACHE_KEY: ${{ github.sha }} CACHED_BUILD_PATHS: | ${{ github.workspace }}/dist-serverless - jobs: - test: - name: starlette, python ${{ matrix.python-version }}, ${{ matrix.os }} - runs-on: ${{ matrix.os }} + test-pinned: timeout-minutes: 30 - + name: starlette pinned, python ${{ matrix.python-version }}, ${{ matrix.os }} + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: @@ -37,17 +30,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test starlette uses: nick-fields/retry@v2 with: @@ -58,23 +48,18 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-starlette" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - - test-latest: + timeout-minutes: 30 name: starlette latest, python ${{ matrix.python-version }}, ${{ matrix.os }} runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: fail-fast: false matrix: @@ -84,17 +69,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test starlette uses: nick-fields/retry@v2 with: @@ -105,25 +87,22 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh "py${{ matrix.python-version }}-starlette-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - check_required_tests: name: All starlette tests passed or skipped - needs: test + needs: test-pinned # Always run this, even if a dependent job failed if: always() runs-on: ubuntu-20.04 steps: - name: Check for failures - if: contains(needs.test.result, 'failure') + if: contains(needs.test-pinned.result, 'failure') run: | echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1 diff --git a/.github/workflows/test-integration-starlite.yml b/.github/workflows/test-integration-starlite.yml index 281d821b94..276693feeb 100644 --- a/.github/workflows/test-integration-starlite.yml +++ b/.github/workflows/test-integration-starlite.yml @@ -1,33 +1,26 @@ name: Test starlite - on: push: branches: - master - release/** - pull_request: - # Cancel in progress workflows on pull_requests. # https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true - permissions: contents: read - env: BUILD_CACHE_KEY: ${{ github.sha }} CACHED_BUILD_PATHS: | ${{ github.workspace }}/dist-serverless - jobs: - test: - name: starlite, python ${{ matrix.python-version }}, ${{ matrix.os }} - runs-on: ${{ matrix.os }} + test-pinned: timeout-minutes: 30 - + name: starlite pinned, python ${{ matrix.python-version }}, ${{ matrix.os }} + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: @@ -37,17 +30,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test starlite uses: nick-fields/retry@v2 with: @@ -58,27 +48,22 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-starlite" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - - - check_required_tests: name: All starlite tests passed or skipped - needs: test + needs: test-pinned # Always run this, even if a dependent job failed if: always() runs-on: ubuntu-20.04 steps: - name: Check for failures - if: contains(needs.test.result, 'failure') + if: contains(needs.test-pinned.result, 'failure') run: | echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1 diff --git a/.github/workflows/test-integration-strawberry.yml b/.github/workflows/test-integration-strawberry.yml index 5ce924bfa2..555ee2450a 100644 --- a/.github/workflows/test-integration-strawberry.yml +++ b/.github/workflows/test-integration-strawberry.yml @@ -1,33 +1,26 @@ name: Test strawberry - on: push: branches: - master - release/** - pull_request: - # Cancel in progress workflows on pull_requests. # https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true - permissions: contents: read - env: BUILD_CACHE_KEY: ${{ github.sha }} CACHED_BUILD_PATHS: | ${{ github.workspace }}/dist-serverless - jobs: - test: - name: strawberry, python ${{ matrix.python-version }}, ${{ matrix.os }} - runs-on: ${{ matrix.os }} + test-pinned: timeout-minutes: 30 - + name: strawberry pinned, python ${{ matrix.python-version }}, ${{ matrix.os }} + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: @@ -37,17 +30,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test strawberry uses: nick-fields/retry@v2 with: @@ -58,23 +48,18 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-strawberry" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - - test-latest: + timeout-minutes: 30 name: strawberry latest, python ${{ matrix.python-version }}, ${{ matrix.os }} runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: fail-fast: false matrix: @@ -84,17 +69,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test strawberry uses: nick-fields/retry@v2 with: @@ -105,25 +87,22 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh "py${{ matrix.python-version }}-strawberry-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - check_required_tests: name: All strawberry tests passed or skipped - needs: test + needs: test-pinned # Always run this, even if a dependent job failed if: always() runs-on: ubuntu-20.04 steps: - name: Check for failures - if: contains(needs.test.result, 'failure') + if: contains(needs.test-pinned.result, 'failure') run: | echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1 diff --git a/.github/workflows/test-integration-tornado.yml b/.github/workflows/test-integration-tornado.yml index f45af2b4db..cb8eca56c1 100644 --- a/.github/workflows/test-integration-tornado.yml +++ b/.github/workflows/test-integration-tornado.yml @@ -1,33 +1,26 @@ name: Test tornado - on: push: branches: - master - release/** - pull_request: - # Cancel in progress workflows on pull_requests. # https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true - permissions: contents: read - env: BUILD_CACHE_KEY: ${{ github.sha }} CACHED_BUILD_PATHS: | ${{ github.workspace }}/dist-serverless - jobs: - test: - name: tornado, python ${{ matrix.python-version }}, ${{ matrix.os }} - runs-on: ${{ matrix.os }} + test-pinned: timeout-minutes: 30 - + name: tornado pinned, python ${{ matrix.python-version }}, ${{ matrix.os }} + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: @@ -37,17 +30,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test tornado uses: nick-fields/retry@v2 with: @@ -58,23 +48,18 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-tornado" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - - test-latest: + timeout-minutes: 30 name: tornado latest, python ${{ matrix.python-version }}, ${{ matrix.os }} runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: fail-fast: false matrix: @@ -84,17 +69,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test tornado uses: nick-fields/retry@v2 with: @@ -105,25 +87,22 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh "py${{ matrix.python-version }}-tornado-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - check_required_tests: name: All tornado tests passed or skipped - needs: test + needs: test-pinned # Always run this, even if a dependent job failed if: always() runs-on: ubuntu-20.04 steps: - name: Check for failures - if: contains(needs.test.result, 'failure') + if: contains(needs.test-pinned.result, 'failure') run: | echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1 diff --git a/.github/workflows/test-integration-trytond.yml b/.github/workflows/test-integration-trytond.yml index 676f6e4872..11b94031b6 100644 --- a/.github/workflows/test-integration-trytond.yml +++ b/.github/workflows/test-integration-trytond.yml @@ -1,33 +1,26 @@ name: Test trytond - on: push: branches: - master - release/** - pull_request: - # Cancel in progress workflows on pull_requests. # https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true - permissions: contents: read - env: BUILD_CACHE_KEY: ${{ github.sha }} CACHED_BUILD_PATHS: | ${{ github.workspace }}/dist-serverless - jobs: - test: - name: trytond, python ${{ matrix.python-version }}, ${{ matrix.os }} - runs-on: ${{ matrix.os }} + test-pinned: timeout-minutes: 30 - + name: trytond pinned, python ${{ matrix.python-version }}, ${{ matrix.os }} + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: @@ -37,17 +30,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test trytond uses: nick-fields/retry@v2 with: @@ -58,23 +48,18 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-trytond" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - - test-latest: + timeout-minutes: 30 name: trytond latest, python ${{ matrix.python-version }}, ${{ matrix.os }} runs-on: ${{ matrix.os }} - timeout-minutes: 30 - strategy: fail-fast: false matrix: @@ -84,17 +69,14 @@ jobs: # ubuntu-20.04 is the last version that supported python3.6 # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 os: [ubuntu-20.04] - steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - - name: Setup Test Env run: | pip install coverage "tox>=3,<4" - - name: Test trytond uses: nick-fields/retry@v2 with: @@ -105,25 +87,22 @@ jobs: command: | set -x # print commands that are executed coverage erase - # Run tests ./scripts/runtox.sh "py${{ matrix.python-version }}-trytond-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && coverage combine .coverage* && coverage xml -i - - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: coverage.xml - check_required_tests: name: All trytond tests passed or skipped - needs: test + needs: test-pinned # Always run this, even if a dependent job failed if: always() runs-on: ubuntu-20.04 steps: - name: Check for failures - if: contains(needs.test.result, 'failure') + if: contains(needs.test-pinned.result, 'failure') run: | echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1 diff --git a/scripts/split-tox-gh-actions/ci-yaml-aws-credentials.txt b/scripts/split-tox-gh-actions/ci-yaml-aws-credentials.txt deleted file mode 100644 index fe4b4104e0..0000000000 --- a/scripts/split-tox-gh-actions/ci-yaml-aws-credentials.txt +++ /dev/null @@ -1,2 +0,0 @@ - SENTRY_PYTHON_TEST_AWS_ACCESS_KEY_ID: ${{ secrets.SENTRY_PYTHON_TEST_AWS_ACCESS_KEY_ID }} - SENTRY_PYTHON_TEST_AWS_SECRET_ACCESS_KEY: ${{ secrets.SENTRY_PYTHON_TEST_AWS_SECRET_ACCESS_KEY }} diff --git a/scripts/split-tox-gh-actions/ci-yaml-services.txt b/scripts/split-tox-gh-actions/ci-yaml-services.txt deleted file mode 100644 index 01bb9566b0..0000000000 --- a/scripts/split-tox-gh-actions/ci-yaml-services.txt +++ /dev/null @@ -1,19 +0,0 @@ - services: - postgres: - image: postgres - env: - POSTGRES_PASSWORD: sentry - # Set health checks to wait until postgres has started - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - # Maps tcp port 5432 on service container to the host - ports: - - 5432:5432 - env: - SENTRY_PYTHON_TEST_POSTGRES_USER: postgres - SENTRY_PYTHON_TEST_POSTGRES_PASSWORD: sentry - SENTRY_PYTHON_TEST_POSTGRES_NAME: ci_test - SENTRY_PYTHON_TEST_POSTGRES_HOST: {{ postgres_host }} diff --git a/scripts/split-tox-gh-actions/ci-yaml-setup-db.txt b/scripts/split-tox-gh-actions/ci-yaml-setup-db.txt deleted file mode 100644 index 2dc7ab5604..0000000000 --- a/scripts/split-tox-gh-actions/ci-yaml-setup-db.txt +++ /dev/null @@ -1,2 +0,0 @@ - psql postgresql://postgres:sentry@localhost:5432 -c "create database ${SENTRY_PYTHON_TEST_POSTGRES_NAME};" || true - psql postgresql://postgres:sentry@localhost:5432 -c "grant all privileges on database ${SENTRY_PYTHON_TEST_POSTGRES_NAME} to ${SENTRY_PYTHON_TEST_POSTGRES_USER};" || true diff --git a/scripts/split-tox-gh-actions/ci-yaml-test-latest-snippet.txt b/scripts/split-tox-gh-actions/ci-yaml-test-latest-snippet.txt deleted file mode 100644 index 7c7a8dfb60..0000000000 --- a/scripts/split-tox-gh-actions/ci-yaml-test-latest-snippet.txt +++ /dev/null @@ -1,39 +0,0 @@ - test-latest: - name: {{ framework }} latest, python ${{ matrix.python-version }}, ${{ matrix.os }} - runs-on: ${{ matrix.os }} - timeout-minutes: 30 -{{ strategy_matrix_latest }} -{{ services_latest }} - - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} -{{ additional_uses }} - - - name: Setup Test Env - run: | - pip install coverage "tox>=3,<4" - {{ setup_postgres }} - - - name: Test {{ framework }} - uses: nick-fields/retry@v2 - with: - timeout_minutes: 15 - max_attempts: 2 - retry_wait_seconds: 5 - shell: bash - command: | - set -x # print commands that are executed - coverage erase - - # Run tests - ./scripts/runtox.sh "py${{ matrix.python-version }}-{{ framework }}-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && - coverage combine .coverage* && - coverage xml -i - - - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - files: coverage.xml diff --git a/scripts/split-tox-gh-actions/ci-yaml-test-py27-snippet.txt b/scripts/split-tox-gh-actions/ci-yaml-test-py27-snippet.txt deleted file mode 100644 index 0964dc38a6..0000000000 --- a/scripts/split-tox-gh-actions/ci-yaml-test-py27-snippet.txt +++ /dev/null @@ -1,29 +0,0 @@ - test-py27: - name: {{ framework }}, python 2.7, ubuntu-20.04 - runs-on: ubuntu-20.04 - container: python:2.7 - timeout-minutes: 30 -{{ services }} - - steps: - - uses: actions/checkout@v4 - - - name: Setup Test Env - run: | - pip install coverage "tox>=3,<4" - - - name: Test {{ framework }} - uses: nick-fields/retry@v2 - with: - timeout_minutes: 15 - max_attempts: 2 - retry_wait_seconds: 5 - shell: bash - command: | - set -x # print commands that are executed - coverage erase - - # Run tests - ./scripts/runtox.sh --exclude-latest "py2.7-{{ framework }}" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && - coverage combine .coverage* && - coverage xml -i diff --git a/scripts/split-tox-gh-actions/ci-yaml-test-snippet.txt b/scripts/split-tox-gh-actions/ci-yaml-test-snippet.txt deleted file mode 100644 index 161b34f16b..0000000000 --- a/scripts/split-tox-gh-actions/ci-yaml-test-snippet.txt +++ /dev/null @@ -1,39 +0,0 @@ - test: - name: {{ framework }}, python ${{ matrix.python-version }}, ${{ matrix.os }} - runs-on: ${{ matrix.os }} - timeout-minutes: 30 -{{ strategy_matrix }} -{{ services }} - - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} -{{ additional_uses }} - - - name: Setup Test Env - run: | - pip install coverage "tox>=3,<4" - {{ setup_postgres }} - - - name: Test {{ framework }} - uses: nick-fields/retry@v2 - with: - timeout_minutes: 15 - max_attempts: 2 - retry_wait_seconds: 5 - shell: bash - command: | - set -x # print commands that are executed - coverage erase - - # Run tests - ./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-{{ framework }}" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && - coverage combine .coverage* && - coverage xml -i - - - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - files: coverage.xml diff --git a/scripts/split-tox-gh-actions/ci-yaml.txt b/scripts/split-tox-gh-actions/ci-yaml.txt deleted file mode 100644 index a5ba0ef725..0000000000 --- a/scripts/split-tox-gh-actions/ci-yaml.txt +++ /dev/null @@ -1,44 +0,0 @@ -name: Test {{ framework }} - -on: - push: - branches: - - master - - release/** - - pull_request: - -# Cancel in progress workflows on pull_requests. -# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -permissions: - contents: read - -env: -{{ aws_credentials }} - BUILD_CACHE_KEY: ${{ github.sha }} - CACHED_BUILD_PATHS: | - ${{ github.workspace }}/dist-serverless - -jobs: -{{ test }} - -{{ test_py27 }} - -{{ test_latest }} - - check_required_tests: - name: All {{ framework }} tests passed or skipped -{{ check_needs }} - # Always run this, even if a dependent job failed - if: always() - runs-on: ubuntu-20.04 - steps: - - name: Check for failures - if: contains(needs.test.result, 'failure') - run: | - echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1 -{{ check_py27 }} diff --git a/scripts/split-tox-gh-actions/split-tox-gh-actions.py b/scripts/split-tox-gh-actions/split-tox-gh-actions.py index eada70db54..4726b177cc 100755 --- a/scripts/split-tox-gh-actions/split-tox-gh-actions.py +++ b/scripts/split-tox-gh-actions/split-tox-gh-actions.py @@ -14,7 +14,6 @@ files have been changed by the scripts execution. This is used in CI to check if the yaml files represent the current tox.ini file. (And if not the CI run fails.) """ - import configparser import hashlib import sys @@ -22,16 +21,12 @@ from glob import glob from pathlib import Path +from jinja2 import Environment, FileSystemLoader + + OUT_DIR = Path(__file__).resolve().parent.parent.parent / ".github" / "workflows" TOX_FILE = Path(__file__).resolve().parent.parent.parent / "tox.ini" -TEMPLATE_DIR = Path(__file__).resolve().parent -TEMPLATE_FILE = TEMPLATE_DIR / "ci-yaml.txt" -TEMPLATE_FILE_SERVICES = TEMPLATE_DIR / "ci-yaml-services.txt" -TEMPLATE_FILE_SETUP_DB = TEMPLATE_DIR / "ci-yaml-setup-db.txt" -TEMPLATE_FILE_AWS_CREDENTIALS = TEMPLATE_DIR / "ci-yaml-aws-credentials.txt" -TEMPLATE_SNIPPET_TEST = TEMPLATE_DIR / "ci-yaml-test-snippet.txt" -TEMPLATE_SNIPPET_TEST_PY27 = TEMPLATE_DIR / "ci-yaml-test-py27-snippet.txt" -TEMPLATE_SNIPPET_TEST_LATEST = TEMPLATE_DIR / "ci-yaml-test-latest-snippet.txt" +TEMPLATE_DIR = Path(__file__).resolve().parent / "templates" FRAMEWORKS_NEEDING_POSTGRES = [ "django", @@ -46,202 +41,59 @@ "aws_lambda", ] -MATRIX_DEFINITION = """ - strategy: - fail-fast: false - matrix: - python-version: [{{ python-version }}] - # python3.6 reached EOL and is no longer being supported on - # new versions of hosted runners on Github Actions - # ubuntu-20.04 is the last version that supported python3.6 - # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 - os: [ubuntu-20.04] -""" - -ADDITIONAL_USES_CLICKHOUSE = """\ +ENV = Environment( + loader=FileSystemLoader(TEMPLATE_DIR), +) - - uses: getsentry/action-clickhouse-in-ci@v1 -""" -CHECK_NEEDS = """\ - needs: test -""" -CHECK_NEEDS_PY27 = """\ - needs: [test, test-py27] -""" - -CHECK_PY27 = """\ - - name: Check for 2.7 failures - if: contains(needs.test-py27.result, 'failure') - run: | - echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1 -""" +def main(fail_on_changes): + """Create one CI workflow for each framework defined in tox.ini.""" + if fail_on_changes: + old_hash = get_files_hash() + print("Parsing tox.ini...") + py_versions_pinned, py_versions_latest = parse_tox() -def write_yaml_file( - template, - current_framework, - python_versions, - python_versions_latest, -): - """Write the YAML configuration file for one framework to disk.""" - py_versions = sorted( - [py.replace("py", "") for py in python_versions], - key=lambda v: tuple(map(int, v.split("."))), - ) - py27_supported = "2.7" in py_versions - py_versions_latest = sorted( - [py.replace("py", "") for py in python_versions_latest], - key=lambda v: tuple(map(int, v.split("."))), - ) - - test_loc = template.index("{{ test }}\n") - f = open(TEMPLATE_SNIPPET_TEST, "r") - test_snippet = f.readlines() - template = template[:test_loc] + test_snippet + template[test_loc + 1 :] - f.close() - - test_py27_loc = template.index("{{ test_py27 }}\n") - if py27_supported: - f = open(TEMPLATE_SNIPPET_TEST_PY27, "r") - test_py27_snippet = f.readlines() - template = ( - template[:test_py27_loc] + test_py27_snippet + template[test_py27_loc + 1 :] + print("Rendering templates...") + for framework in py_versions_pinned: + contents = render_template( + framework, + py_versions_pinned[framework], + py_versions_latest[framework], ) - f.close() + filename = write_file(contents, framework) + print(f"Created {filename}") - py_versions.remove("2.7") - else: - template.pop(test_py27_loc) - - test_latest_loc = template.index("{{ test_latest }}\n") - if python_versions_latest: - f = open(TEMPLATE_SNIPPET_TEST_LATEST, "r") - test_latest_snippet = f.readlines() - template = ( - template[:test_latest_loc] - + test_latest_snippet - + template[test_latest_loc + 1 :] - ) - f.close() - else: - template.pop(test_latest_loc) - - out = "" - py27_test_part = False - for template_line in template: - if template_line.strip() == "{{ strategy_matrix }}": - m = MATRIX_DEFINITION - m = m.replace("{{ framework }}", current_framework).replace( - "{{ python-version }}", ",".join([f'"{v}"' for v in py_versions]) - ) - out += m + if fail_on_changes: + new_hash = get_files_hash() - elif template_line.strip() == "{{ strategy_matrix_latest }}": - m = MATRIX_DEFINITION - m = m.replace("{{ framework }}", current_framework).replace( - "{{ python-version }}", ",".join([f'"{v}"' for v in py_versions_latest]) + if old_hash != new_hash: + raise RuntimeError( + "The yaml configuration files have changed. This means that tox.ini has changed " + "but the changes have not been propagated to the GitHub actions config files. " + "Please run `python scripts/split-tox-gh-actions/split-tox-gh-actions.py` " + "locally and commit the changes of the yaml configuration files to continue. " ) - out += m - - elif template_line.strip() in ("{{ services }}", "{{ services_latest }}"): - if current_framework in FRAMEWORKS_NEEDING_POSTGRES: - f = open(TEMPLATE_FILE_SERVICES, "r") - lines = [ - line.replace( - "{{ postgres_host }}", - "postgres" - if py27_test_part and "_latest" not in template_line - else "localhost", - ) - for line in f.readlines() - ] - out += "".join(lines) - f.close() - - elif template_line.strip() == "{{ setup_postgres }}": - if current_framework in FRAMEWORKS_NEEDING_POSTGRES: - f = open(TEMPLATE_FILE_SETUP_DB, "r") - out += "".join(f.readlines()) - - elif template_line.strip() == "{{ aws_credentials }}": - if current_framework in FRAMEWORKS_NEEDING_AWS: - f = open(TEMPLATE_FILE_AWS_CREDENTIALS, "r") - out += "".join(f.readlines()) - - elif template_line.strip() == "{{ additional_uses }}": - if current_framework in FRAMEWORKS_NEEDING_CLICKHOUSE: - out += ADDITIONAL_USES_CLICKHOUSE - - elif template_line.strip() == "{{ check_needs }}": - if py27_supported: - out += CHECK_NEEDS_PY27 - else: - out += CHECK_NEEDS - - elif template_line.strip() == "{{ check_py27 }}": - if py27_supported: - out += CHECK_PY27 - - else: - if template_line.strip() == "test-py27:": - py27_test_part = True - - out += template_line.replace("{{ framework }}", current_framework) - - # write rendered template - if current_framework == "common": - outfile_name = OUT_DIR / f"test-{current_framework}.yml" - else: - outfile_name = OUT_DIR / f"test-integration-{current_framework}.yml" - - print(f"Writing {outfile_name}") - f = open(outfile_name, "w") - f.writelines(out) - f.close() - - -def get_yaml_files_hash(): - """Calculate a hash of all the yaml configuration files""" - - hasher = hashlib.md5() - path_pattern = (OUT_DIR / "test-integration-*.yml").as_posix() - for file in glob(path_pattern): - with open(file, "rb") as f: - buf = f.read() - hasher.update(buf) - - return hasher.hexdigest() + print("All done. Have a nice day!") -def main(fail_on_changes): - """Create one CI workflow for each framework defined in tox.ini""" - if fail_on_changes: - old_hash = get_yaml_files_hash() - - print("Read GitHub actions config file template") - f = open(TEMPLATE_FILE, "r") - template = f.readlines() - f.close() - print("Read tox.ini") +def parse_tox(): config = configparser.ConfigParser() config.read(TOX_FILE) - lines = [x for x in config["tox"]["envlist"].split("\n") if len(x) > 0] - - python_versions = defaultdict(set) - python_versions_latest = defaultdict(set) + lines = [ + line + for line in config["tox"]["envlist"].split("\n") + if line.strip() and not line.strip().startswith("#") + ] - print("Parse tox.ini envlist") + py_versions_pinned = defaultdict(set) + py_versions_latest = defaultdict(set) for line in lines: # normalize lines line = line.strip().lower() - # ignore comments - if line.startswith("#"): - continue - try: # parse tox environment definition try: @@ -255,37 +107,79 @@ def main(fail_on_changes): raw_python_versions.replace("{", "").replace("}", "").split(",") ) if "latest" in framework_versions: - python_versions_latest[framework] |= raw_python_versions + py_versions_latest[framework] |= raw_python_versions else: - python_versions[framework] |= raw_python_versions + py_versions_pinned[framework] |= raw_python_versions except ValueError: print(f"ERROR reading line {line}") - for framework in python_versions: - write_yaml_file( - template, - framework, - python_versions[framework], - python_versions_latest[framework], + py_versions_pinned = _normalize_py_versions(py_versions_pinned) + py_versions_latest = _normalize_py_versions(py_versions_latest) + + return py_versions_pinned, py_versions_latest + + +def _normalize_py_versions(py_versions): + normalized = defaultdict(set) + normalized |= { + framework: sorted( + [py.replace("py", "") for py in versions], + key=lambda v: tuple(map(int, v.split("."))), ) + for framework, versions in py_versions.items() + } + return normalized - if fail_on_changes: - new_hash = get_yaml_files_hash() - if old_hash != new_hash: - raise RuntimeError( - "The yaml configuration files have changed. This means that tox.ini has changed " - "but the changes have not been propagated to the GitHub actions config files. " - "Please run `python scripts/split-tox-gh-actions/split-tox-gh-actions.py` " - "locally and commit the changes of the yaml configuration files to continue. " - ) +def get_files_hash(): + """Calculate a hash of all the yaml configuration files""" + hasher = hashlib.md5() + path_pattern = (OUT_DIR / "test-integration-*.yml").as_posix() + for file in glob(path_pattern): + with open(file, "rb") as f: + buf = f.read() + hasher.update(buf) - print("All done. Have a nice day!") + return hasher.hexdigest() + + +def render_template(framework, py_versions_pinned, py_versions_latest): + template = ENV.get_template("base.jinja") + + context = { + "framework": framework, + "needs_aws_credentials": framework in FRAMEWORKS_NEEDING_AWS, + "needs_clickhouse": framework in FRAMEWORKS_NEEDING_CLICKHOUSE, + "needs_postgres": framework in FRAMEWORKS_NEEDING_POSTGRES, + "py_versions": { + # formatted for including in the matrix + "pinned": [f'"{v}"' for v in py_versions_pinned if v != "2.7"], + "py27": ['"2.7"'] if "2.7" in py_versions_pinned else [], + "latest": [f'"{v}"' for v in py_versions_latest], + }, + } + rendered = template.render(context) + rendered = postprocess_template(rendered) + return rendered + + +def postprocess_template(rendered): + return "\n".join([line for line in rendered.split("\n") if line.strip()]) + "\n" + + +def write_file(contents, framework): + if framework == "common": + outfile = OUT_DIR / f"test-{framework}.yml" + else: + outfile = OUT_DIR / f"test-integration-{framework}.yml" + + with open(outfile, "w") as file: + file.write(contents) + + return outfile if __name__ == "__main__": - fail_on_changes = ( - True if len(sys.argv) == 2 and sys.argv[1] == "--fail-on-changes" else False - ) + fail_on_changes = len(sys.argv) == 2 and sys.argv[1] == "--fail-on-changes" main(fail_on_changes) diff --git a/scripts/split-tox-gh-actions/templates/base.jinja b/scripts/split-tox-gh-actions/templates/base.jinja new file mode 100644 index 0000000000..e65b9cc470 --- /dev/null +++ b/scripts/split-tox-gh-actions/templates/base.jinja @@ -0,0 +1,50 @@ +name: Test {{ framework }} + +on: + push: + branches: + - master + - release/** + + pull_request: + +# Cancel in progress workflows on pull_requests. +# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value +concurrency: + group: {% raw %}${{ github.workflow }}-${{ github.head_ref || github.run_id }}{% endraw %} + cancel-in-progress: true + +permissions: + contents: read + +env: +{% if needs_aws_credentials %} +{% raw %} + SENTRY_PYTHON_TEST_AWS_ACCESS_KEY_ID: ${{ secrets.SENTRY_PYTHON_TEST_AWS_ACCESS_KEY_ID }} + SENTRY_PYTHON_TEST_AWS_SECRET_ACCESS_KEY: ${{ secrets.SENTRY_PYTHON_TEST_AWS_SECRET_ACCESS_KEY }} +{% endraw %} +{% endif %} + BUILD_CACHE_KEY: {% raw %}${{ github.sha }}{% endraw %} + CACHED_BUILD_PATHS: | + {% raw %}${{ github.workspace }}/dist-serverless{% endraw %} + +jobs: +{% if py_versions.pinned %} +{% with category="pinned", versions=py_versions.pinned %} +{% include "test.jinja" %} +{% endwith %} +{% endif %} + +{% if py_versions.py27 %} +{% with category="py27", versions=py_versions.py27 %} +{% include "test.jinja" %} +{% endwith %} +{% endif %} + +{% if py_versions.latest %} +{% with category="latest", versions=py_versions.latest %} +{% include "test.jinja" %} +{% endwith %} +{% endif %} + +{% include "check_required.jinja" %} diff --git a/scripts/split-tox-gh-actions/templates/check_required.jinja b/scripts/split-tox-gh-actions/templates/check_required.jinja new file mode 100644 index 0000000000..f79b5a9491 --- /dev/null +++ b/scripts/split-tox-gh-actions/templates/check_required.jinja @@ -0,0 +1,23 @@ + check_required_tests: + name: All {{ framework }} tests passed or skipped + {% if py_versions.pinned and py_versions.py27 %} + needs: [test-pinned, test-py27] + {% elif py_versions.pinned %} + needs: test-pinned + {% elif py_versions.py27 %} + needs: test-py27 + {% endif %} + # Always run this, even if a dependent job failed + if: always() + runs-on: ubuntu-20.04 + steps: + - name: Check for failures + if: contains(needs.test-pinned.result, 'failure') + run: | + echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1 + {% if py_versions.py27 %} + - name: Check for 2.7 failures + if: contains(needs.test-py27.result, 'failure') + run: | + echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1 + {% endif %} diff --git a/scripts/split-tox-gh-actions/templates/test.jinja b/scripts/split-tox-gh-actions/templates/test.jinja new file mode 100644 index 0000000000..481df3b723 --- /dev/null +++ b/scripts/split-tox-gh-actions/templates/test.jinja @@ -0,0 +1,91 @@ + test-{{ category }}: + timeout-minutes: 30 + {% if category == "py27" %} + name: {{ framework }} {{ category }}, python 2.7 + runs-on: ubuntu-20.04 + container: python:2.7 + {% else %} + name: {{ framework }} {{ category }}, {% raw %}python ${{ matrix.python-version }}, ${{ matrix.os }}{% endraw %} + runs-on: {% raw %}${{ matrix.os }}{% endraw %} + strategy: + fail-fast: false + matrix: + python-version: [{{ versions|join(",") }}] + # python3.6 reached EOL and is no longer being supported on + # new versions of hosted runners on Github Actions + # ubuntu-20.04 is the last version that supported python3.6 + # see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877 + os: [ubuntu-20.04] + {% endif %} + {% if needs_postgres %} + services: + postgres: + image: postgres + env: + POSTGRES_PASSWORD: sentry + # Set health checks to wait until postgres has started + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + # Maps tcp port 5432 on service container to the host + ports: + - 5432:5432 + env: + SENTRY_PYTHON_TEST_POSTGRES_USER: postgres + SENTRY_PYTHON_TEST_POSTGRES_PASSWORD: sentry + SENTRY_PYTHON_TEST_POSTGRES_NAME: ci_test + SENTRY_PYTHON_TEST_POSTGRES_HOST: {% if category == "py27" %}postgres{% else %}localhost{% endif %} + {% endif %} + + steps: + - uses: actions/checkout@v4 + {% if category != "py27" %} + - uses: actions/setup-python@v4 + with: + python-version: {% raw %}${{ matrix.python-version }}{% endraw %} + {% endif %} + {% if needs_clickhouse %} + - uses: getsentry/action-clickhouse-in-ci@v1 + {% endif %} + + - name: Setup Test Env + run: | + pip install coverage "tox>=3,<4" + {% if needs_postgres %} + {% if category == "py27" %} + psql postgresql://postgres:sentry@postgres:5432 -c "create database ${SENTRY_PYTHON_TEST_POSTGRES_NAME};" || true + psql postgresql://postgres:sentry@postgres:5432 -c "grant all privileges on database ${SENTRY_PYTHON_TEST_POSTGRES_NAME} to ${SENTRY_PYTHON_TEST_POSTGRES_USER};" || true + {% else %} + psql postgresql://postgres:sentry@localhost:5432 -c "create database ${SENTRY_PYTHON_TEST_POSTGRES_NAME};" || true + psql postgresql://postgres:sentry@localhost:5432 -c "grant all privileges on database ${SENTRY_PYTHON_TEST_POSTGRES_NAME} to ${SENTRY_PYTHON_TEST_POSTGRES_USER};" || true + {% endif %} + {% endif %} + + - name: Test {{ framework }} + uses: nick-fields/retry@v2 + with: + timeout_minutes: 15 + max_attempts: 2 + retry_wait_seconds: 5 + shell: bash + command: | + set -x # print commands that are executed + coverage erase + + # Run tests + {% if category == "py27" %} + ./scripts/runtox.sh --exclude-latest "py2.7-{{ framework }}" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && + {% elif category == "pinned" %} + ./scripts/runtox.sh --exclude-latest "{% raw %}py${{ matrix.python-version }}{% endraw %}-{{ framework }}" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && + {% elif category == "latest" %} + ./scripts/runtox.sh "{% raw %}py${{ matrix.python-version }}{% endraw %}-{{ framework }}-latest" --cov=tests --cov=sentry_sdk --cov-report= --cov-branch && + {% endif %} + coverage combine .coverage* && + coverage xml -i + + - uses: codecov/codecov-action@v3 + with: + token: {% raw %}${{ secrets.CODECOV_TOKEN }}{% endraw %} + files: coverage.xml