Skip to content

Commit

Permalink
ci: only run one test job per provider with all extras, to save on costs
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikBjare committed Aug 22, 2024
1 parent 3ddaeae commit 6ceb9d5
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ env:

jobs:
build:
name: Test ${{ matrix.os }} with `${{ matrix.extras }}` on ${{ matrix.provider }}
name: Test ${{ matrix.os }} with `${{ matrix.extras }}` on ${{ matrix.model }}
runs-on: ${{ matrix.os }}
env:
RELEASE: false
Expand All @@ -21,13 +21,8 @@ jobs:
matrix:
os: [ubuntu-latest]
python_version: ['3.10']
extras: ['-E server', '-E browser', '-E all']
provider: ['openai']
include:
- os: ubuntu-latest
python_version: '3.10'
extras: '-E all'
provider: 'anthropic'
extras: ['-E all']
model: ['openai', 'anthropic']
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -37,15 +32,11 @@ jobs:
- name: Install poetry
run: |
pipx install poetry
echo "${{ matrix.extras }}" > .extras-cache
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python_version }}
cache: 'poetry'
cache-dependency-path: |
poetry.lock
.extras-cache

- name: Install dependencies
run: |
Expand All @@ -61,7 +52,7 @@ jobs:
uses: nick-fields/retry@v2
env:
TERM: xterm
MODEL: ${{ matrix.provider }}
MODEL: ${{ matrix.model }}
with:
timeout_minutes: 5
max_attempts: 1 # favor pytest retries (mark with flaky)
Expand All @@ -71,11 +62,11 @@ jobs:
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
env:
MODEL: ${{ matrix.provider }}
MODEL: ${{ matrix.model }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
env_vars: MODEL
flags: ${{ matrix.provider }}
flags: ${{ matrix.model }}

- name: Upload test results to Codecov
if: ${{ !cancelled() }}
Expand Down

0 comments on commit 6ceb9d5

Please sign in to comment.