mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-20 12:21:13 -05:00
Merge pull request #703 from RooVetGit/cte/conditionally-disable-integration-tests
Don't run the `integration-test` job if there's no API key
This commit is contained in:
30
.github/workflows/code-qa.yml
vendored
30
.github/workflows/code-qa.yml
vendored
@@ -43,11 +43,25 @@ jobs:
|
|||||||
- name: Run unit tests
|
- name: Run unit tests
|
||||||
run: npm test
|
run: npm test
|
||||||
|
|
||||||
|
check-openrouter-api-key:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
exists: ${{ steps.openrouter-api-key-check.outputs.defined }}
|
||||||
|
steps:
|
||||||
|
- name: Check if OpenRouter API key exists
|
||||||
|
id: openrouter-api-key-check
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
if [ "${{ secrets.OPENROUTER_API_KEY }}" != '' ]; then
|
||||||
|
echo "defined=true" >> $GITHUB_OUTPUT;
|
||||||
|
else
|
||||||
|
echo "defined=false" >> $GITHUB_OUTPUT;
|
||||||
|
fi
|
||||||
|
|
||||||
integration-test:
|
integration-test:
|
||||||
strategy:
|
runs-on: ubuntu-latest
|
||||||
matrix:
|
needs: [check-openrouter-api-key]
|
||||||
os: [ubuntu-latest] # macos-latest, windows-latest
|
if: needs.check-openrouter-api-key.outputs.exists == 'true'
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -58,11 +72,7 @@ jobs:
|
|||||||
cache: 'npm'
|
cache: 'npm'
|
||||||
- name: Create env.integration file
|
- name: Create env.integration file
|
||||||
run: echo "OPENROUTER_API_KEY=${{ secrets.OPENROUTER_API_KEY }}" > .env.integration
|
run: echo "OPENROUTER_API_KEY=${{ secrets.OPENROUTER_API_KEY }}" > .env.integration
|
||||||
- name: Check env.integration file
|
|
||||||
run: cat .env.integration
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm run install:all
|
run: npm run install:all
|
||||||
- run: xvfb-run -a npm run test:integration
|
- name: Run integration tests
|
||||||
if: runner.os == 'Linux'
|
run: xvfb-run -a npm run test:integration
|
||||||
- run: npm run test:integration
|
|
||||||
if: runner.os != 'Linux'
|
|
||||||
|
|||||||
Reference in New Issue
Block a user