Skip to content

Commit c05e145

Browse files
committed
maybe commit the stuff
1 parent d5f01a9 commit c05e145

11 files changed

+1940
-0
lines changed
Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
# Do not edit this file. This file is generated automatically by executing
2+
# python scripts/split-tox-gh-actions/split-tox-gh-actions.py
3+
name: Test AI
4+
on:
5+
push:
6+
branches:
7+
- master
8+
- release/**
9+
- sentry-sdk-2.0
10+
pull_request:
11+
# Cancel in progress workflows on pull_requests.
12+
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
15+
cancel-in-progress: true
16+
permissions:
17+
contents: read
18+
env:
19+
BUILD_CACHE_KEY: ${{ github.sha }}
20+
CACHED_BUILD_PATHS: |
21+
${{ github.workspace }}/dist-serverless
22+
jobs:
23+
test-ai-latest:
24+
name: AI (latest)
25+
timeout-minutes: 30
26+
runs-on: ${{ matrix.os }}
27+
strategy:
28+
fail-fast: false
29+
matrix:
30+
python-version: ["3.7","3.9","3.11","3.12","3.13"]
31+
# python3.6 reached EOL and is no longer being supported on
32+
# new versions of hosted runners on Github Actions
33+
# ubuntu-20.04 is the last version that supported python3.6
34+
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
35+
os: [ubuntu-20.04]
36+
steps:
37+
- uses: actions/[email protected]
38+
- uses: actions/setup-python@v5
39+
with:
40+
python-version: ${{ matrix.python-version }}
41+
allow-prereleases: true
42+
- name: Setup Test Env
43+
run: |
44+
pip install "coverage[toml]" tox
45+
- name: Erase coverage
46+
run: |
47+
coverage erase
48+
- name: Test anthropic latest
49+
run: |
50+
set -x # print commands that are executed
51+
./scripts/runtox.sh "py${{ matrix.python-version }}-anthropic-latest"
52+
- name: Test cohere latest
53+
run: |
54+
set -x # print commands that are executed
55+
./scripts/runtox.sh "py${{ matrix.python-version }}-cohere-latest"
56+
- name: Test langchain latest
57+
run: |
58+
set -x # print commands that are executed
59+
./scripts/runtox.sh "py${{ matrix.python-version }}-langchain-latest"
60+
- name: Test openai latest
61+
run: |
62+
set -x # print commands that are executed
63+
./scripts/runtox.sh "py${{ matrix.python-version }}-openai-latest"
64+
- name: Test huggingface_hub latest
65+
run: |
66+
set -x # print commands that are executed
67+
./scripts/runtox.sh "py${{ matrix.python-version }}-huggingface_hub-latest"
68+
- name: Generate coverage XML (Python 3.6)
69+
if: ${{ !cancelled() && matrix.python-version == '3.6' }}
70+
run: |
71+
export COVERAGE_RCFILE=.coveragerc36
72+
coverage combine .coverage-sentry-*
73+
coverage xml --ignore-errors
74+
- name: Generate coverage XML
75+
if: ${{ !cancelled() && matrix.python-version != '3.6' }}
76+
run: |
77+
coverage combine .coverage-sentry-*
78+
coverage xml
79+
- name: Upload coverage to Codecov
80+
if: ${{ !cancelled() }}
81+
uses: codecov/[email protected]
82+
with:
83+
token: ${{ secrets.CODECOV_TOKEN }}
84+
files: coverage.xml
85+
# make sure no plugins alter our coverage reports
86+
plugin: noop
87+
verbose: true
88+
- name: Upload test results to Codecov
89+
if: ${{ !cancelled() }}
90+
uses: codecov/test-results-action@v1
91+
with:
92+
token: ${{ secrets.CODECOV_TOKEN }}
93+
files: .junitxml
94+
verbose: true
95+
test-ai-pinned:
96+
name: AI (pinned)
97+
timeout-minutes: 30
98+
runs-on: ${{ matrix.os }}
99+
strategy:
100+
fail-fast: false
101+
matrix:
102+
python-version: ["3.7","3.9","3.11","3.12","3.13"]
103+
# python3.6 reached EOL and is no longer being supported on
104+
# new versions of hosted runners on Github Actions
105+
# ubuntu-20.04 is the last version that supported python3.6
106+
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
107+
os: [ubuntu-20.04]
108+
steps:
109+
- uses: actions/[email protected]
110+
- uses: actions/setup-python@v5
111+
with:
112+
python-version: ${{ matrix.python-version }}
113+
allow-prereleases: true
114+
- name: Setup Test Env
115+
run: |
116+
pip install "coverage[toml]" tox
117+
- name: Erase coverage
118+
run: |
119+
coverage erase
120+
- name: Test anthropic pinned
121+
run: |
122+
set -x # print commands that are executed
123+
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-anthropic"
124+
- name: Test cohere pinned
125+
run: |
126+
set -x # print commands that are executed
127+
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-cohere"
128+
- name: Test langchain pinned
129+
run: |
130+
set -x # print commands that are executed
131+
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-langchain"
132+
- name: Test openai pinned
133+
run: |
134+
set -x # print commands that are executed
135+
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-openai"
136+
- name: Test huggingface_hub pinned
137+
run: |
138+
set -x # print commands that are executed
139+
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-huggingface_hub"
140+
- name: Generate coverage XML (Python 3.6)
141+
if: ${{ !cancelled() && matrix.python-version == '3.6' }}
142+
run: |
143+
export COVERAGE_RCFILE=.coveragerc36
144+
coverage combine .coverage-sentry-*
145+
coverage xml --ignore-errors
146+
- name: Generate coverage XML
147+
if: ${{ !cancelled() && matrix.python-version != '3.6' }}
148+
run: |
149+
coverage combine .coverage-sentry-*
150+
coverage xml
151+
- name: Upload coverage to Codecov
152+
if: ${{ !cancelled() }}
153+
uses: codecov/[email protected]
154+
with:
155+
token: ${{ secrets.CODECOV_TOKEN }}
156+
files: coverage.xml
157+
# make sure no plugins alter our coverage reports
158+
plugin: noop
159+
verbose: true
160+
- name: Upload test results to Codecov
161+
if: ${{ !cancelled() }}
162+
uses: codecov/test-results-action@v1
163+
with:
164+
token: ${{ secrets.CODECOV_TOKEN }}
165+
files: .junitxml
166+
verbose: true
167+
check_required_tests:
168+
name: All pinned AI tests passed
169+
needs: test-ai-pinned
170+
# Always run this, even if a dependent job failed
171+
if: always()
172+
runs-on: ubuntu-20.04
173+
steps:
174+
- name: Check for failures
175+
if: contains(needs.test-ai-pinned.result, 'failure') || contains(needs.test-ai-pinned.result, 'skipped')
176+
run: |
177+
echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
# Do not edit this file. This file is generated automatically by executing
2+
# python scripts/split-tox-gh-actions/split-tox-gh-actions.py
3+
name: Test AWS
4+
on:
5+
push:
6+
branches:
7+
- master
8+
- release/**
9+
- sentry-sdk-2.0
10+
# XXX: We are using `pull_request_target` instead of `pull_request` because we want
11+
# this to run on forks with access to the secrets necessary to run the test suite.
12+
# Prefer to use `pull_request` when possible.
13+
pull_request_target:
14+
types: [labeled, opened, reopened, synchronize]
15+
# Cancel in progress workflows on pull_requests.
16+
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
19+
cancel-in-progress: true
20+
permissions:
21+
contents: read
22+
# `write` is needed to remove the `Trigger: tests using secrets` label
23+
pull-requests: write
24+
env:
25+
SENTRY_PYTHON_TEST_AWS_ACCESS_KEY_ID: ${{ secrets.SENTRY_PYTHON_TEST_AWS_ACCESS_KEY_ID }}
26+
SENTRY_PYTHON_TEST_AWS_SECRET_ACCESS_KEY: ${{ secrets.SENTRY_PYTHON_TEST_AWS_SECRET_ACCESS_KEY }}
27+
BUILD_CACHE_KEY: ${{ github.sha }}
28+
CACHED_BUILD_PATHS: |
29+
${{ github.workspace }}/dist-serverless
30+
jobs:
31+
check-permissions:
32+
name: permissions check
33+
runs-on: ubuntu-20.04
34+
steps:
35+
- uses: actions/[email protected]
36+
with:
37+
persist-credentials: false
38+
- name: Check permissions on PR
39+
if: github.event_name == 'pull_request_target'
40+
run: |
41+
python3 -uS .github/workflows/scripts/trigger_tests_on_label.py \
42+
--repo-id ${{ github.event.repository.id }} \
43+
--pr ${{ github.event.number }} \
44+
--event ${{ github.event.action }} \
45+
--username "$ARG_USERNAME" \
46+
--label-names "$ARG_LABEL_NAMES"
47+
env:
48+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49+
# these can contain special characters
50+
ARG_USERNAME: ${{ github.event.pull_request.user.login }}
51+
ARG_LABEL_NAMES: ${{ toJSON(github.event.pull_request.labels.*.name) }}
52+
- name: Check permissions on repo branch
53+
if: github.event_name == 'push'
54+
run: true
55+
test-aws-pinned:
56+
name: AWS (pinned)
57+
timeout-minutes: 30
58+
runs-on: ${{ matrix.os }}
59+
strategy:
60+
fail-fast: false
61+
matrix:
62+
python-version: ["3.9"]
63+
# python3.6 reached EOL and is no longer being supported on
64+
# new versions of hosted runners on Github Actions
65+
# ubuntu-20.04 is the last version that supported python3.6
66+
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
67+
os: [ubuntu-20.04]
68+
needs: check-permissions
69+
steps:
70+
- uses: actions/[email protected]
71+
with:
72+
ref: ${{ github.event.pull_request.head.sha || github.ref }}
73+
- uses: actions/setup-python@v5
74+
with:
75+
python-version: ${{ matrix.python-version }}
76+
allow-prereleases: true
77+
- name: Setup Test Env
78+
run: |
79+
pip install "coverage[toml]" tox
80+
- name: Erase coverage
81+
run: |
82+
coverage erase
83+
- name: Test aws_lambda pinned
84+
run: |
85+
set -x # print commands that are executed
86+
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-aws_lambda"
87+
- name: Generate coverage XML (Python 3.6)
88+
if: ${{ !cancelled() && matrix.python-version == '3.6' }}
89+
run: |
90+
export COVERAGE_RCFILE=.coveragerc36
91+
coverage combine .coverage-sentry-*
92+
coverage xml --ignore-errors
93+
- name: Generate coverage XML
94+
if: ${{ !cancelled() && matrix.python-version != '3.6' }}
95+
run: |
96+
coverage combine .coverage-sentry-*
97+
coverage xml
98+
- name: Upload coverage to Codecov
99+
if: ${{ !cancelled() }}
100+
uses: codecov/[email protected]
101+
with:
102+
token: ${{ secrets.CODECOV_TOKEN }}
103+
files: coverage.xml
104+
# make sure no plugins alter our coverage reports
105+
plugin: noop
106+
verbose: true
107+
- name: Upload test results to Codecov
108+
if: ${{ !cancelled() }}
109+
uses: codecov/test-results-action@v1
110+
with:
111+
token: ${{ secrets.CODECOV_TOKEN }}
112+
files: .junitxml
113+
verbose: true
114+
check_required_tests:
115+
name: All pinned AWS tests passed
116+
needs: test-aws-pinned
117+
# Always run this, even if a dependent job failed
118+
if: always()
119+
runs-on: ubuntu-20.04
120+
steps:
121+
- name: Check for failures
122+
if: contains(needs.test-aws-pinned.result, 'failure') || contains(needs.test-aws-pinned.result, 'skipped')
123+
run: |
124+
echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1

0 commit comments

Comments
 (0)