diff --git a/.github/workflows/pipeline.yaml b/.github/workflows/pipeline.yaml index 80b57fa3..6ab2ddd2 100644 --- a/.github/workflows/pipeline.yaml +++ b/.github/workflows/pipeline.yaml @@ -62,7 +62,7 @@ jobs: uses: ./.github/workflows/test.yaml with: python-version: ${{ matrix.python-version }} - environment: public + environment: null use-llms: false secrets: inherit # pragma: allowlist secret @@ -73,6 +73,8 @@ jobs: environment: testing use-llms: true secrets: inherit # pragma: allowlist secret + needs: + - test-without-llms test-macos-latest: if: github.event.pull_request.draft == false diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index a0fc7937..bb9eb400 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -5,7 +5,8 @@ on: inputs: environment: description: 'Environment to run the tests in' - required: true + required: false + default: null type: string python-version: description: 'Python version to run the tests in' @@ -47,15 +48,33 @@ jobs: DATABASE_URL: postgresql://admin:password@localhost:5432/fastagency PY_DATABASE_URL: postgresql://admin:password@localhost:5433/pyfastagency NATS_URL: nats://localhost:4222 - AZURE_API_VERSION: ${{ vars.AZURE_API_VERSION }} - AZURE_API_ENDPOINT: ${{ vars.AZURE_API_ENDPOINT }} - AZURE_GPT35_MODEL: ${{ vars.AZURE_GPT35_MODEL }} - AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }} - TOGETHER_API_KEY: ${{ secrets.TOGETHER_API_KEY }} - OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} - ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} steps: + - name: Set up environment variables + run: | + # check if an environment var or secret is defined and set env var to its value + if [ -n "${{ vars.AZURE_API_VERSION }}" ]; then + echo "AZURE_API_VERSION=${{ vars.AZURE_API_VERSION }}" >> $GITHUB_ENV + fi + if [ -n "${{ vars.AZURE_API_ENDPOINT }}" ]; then + echo "AZURE_API_ENDPOINT=${{ vars.AZURE_API_ENDPOINT }}" >> $GITHUB_ENV + fi + if [ -n "${{ vars.AZURE_GPT35_MODEL }}" ]; then + echo "AZURE_GPT35_MODEL=${{ vars.AZURE_GPT35_MODEL }}" >> $GITHUB_ENV + fi + if [ -n "${{ secrets.AZURE_OPENAI_API_KEY }}" ]; then + echo "AZURE_OPENAI_API_KEY=${{ secrets.AZURE_OPENAI_API_KEY }}" >> $GITHUB_ENV + fi + if [ -n "${{ secrets.TOGETHER_API_KEY }}" ]; then + echo "TOGETHER_API_KEY=${{ secrets.TOGETHER_API_KEY }}" >> $GITHUB_ENV + fi + if [ -n "${{ secrets.OPENAI_API_KEY }}" ]; then + echo "OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }}" >> $GITHUB_ENV + fi + if [ -n "${{ secrets.ANTHROPIC_API_KEY }}" ]; then + echo "ANTHROPIC_API_KEY=${{ secrets.ANTHROPIC_API_KEY }}" >> $GITHUB_ENV + fi + - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 diff --git a/.secrets.baseline b/.secrets.baseline index 6ef826e2..d1c08700 100644 --- a/.secrets.baseline +++ b/.secrets.baseline @@ -118,7 +118,7 @@ "filename": ".github/workflows/test.yaml", "hashed_secret": "5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8", "is_verified": false, - "line_number": 32, + "line_number": 33, "is_secret": false }, { @@ -126,7 +126,7 @@ "filename": ".github/workflows/test.yaml", "hashed_secret": "5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8", "is_verified": false, - "line_number": 47, + "line_number": 48, "is_secret": false } ], @@ -141,5 +141,5 @@ } ] }, - "generated_at": "2024-07-01T12:57:48Z" + "generated_at": "2024-07-02T05:22:08Z" } diff --git a/scripts/test.sh b/scripts/test.sh index 69cfd4de..3e7602f7 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -2,4 +2,4 @@ # coverage run -m pytest -x --ff "$@" || \ # coverage run -m pytest -x --ff "$@" || \ -coverage run -m pytest -x --ff "$@" +coverage run -m pytest --ff "$@"