Skip to content

Commit

Permalink
Pass secrets to separate workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ViStefan committed Dec 2, 2024
1 parent ef52523 commit 0761acc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/integration_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:
pre-test:
# default smoke test against python-3.10 on ubuntu-latest
uses: ./.github/workflows/integration_test_workflow.yml
secrets:
openai-api-key: ${{ secrets.OPENAI_API_KEY }}

integration-test:
needs: pre-test
Expand All @@ -27,3 +29,5 @@ jobs:
with:
os: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
secrets:
openai-api-key: ${{ secrets.OPENAI_API_KEY }}
4 changes: 3 additions & 1 deletion .github/workflows/integration_test_minimal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@ jobs:
with:
os: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
minimal-only: true
minimal-only: true
secrets:
openai-api-key: ${{ secrets.OPENAI_API_KEY }}
8 changes: 6 additions & 2 deletions .github/workflows/integration_test_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ on:
minimal-only:
default: false
type: boolean
secrets:
openai-api-key:
required: true


jobs:
test:
Expand Down Expand Up @@ -63,14 +67,14 @@ jobs:

- name: Run minimal integration tests
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
OPENAI_API_KEY: ${{ secrets.openai-api-key }}
TIKTOKEN_CACHE_DIR: tests/itest_cache/tiktoken_cache
if: ${{ inputs.minimal-only }}
run: poetry run python tests/run_integration_tests.py --minimal-only --os ${{ runner.os }}

- name: Run integration tests
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
OPENAI_API_KEY: ${{ secrets.openai-api-key }}
TIKTOKEN_CACHE_DIR: tests/itest_cache/tiktoken_cache
if: ${{ !inputs.minimal-only }}
run: poetry run python tests/run_integration_tests.py --os ${{ runner.os }}

0 comments on commit 0761acc

Please sign in to comment.