Skip to content

Commit de7f67f

Browse files
committed
One more attempt
1 parent 17fb94c commit de7f67f

File tree

1 file changed

+20
-12
lines changed

1 file changed

+20
-12
lines changed

.github/workflows/code-qa.yml

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,25 @@ jobs:
4343
- name: Run unit tests
4444
run: npm test
4545

46+
check-openrouter-api-key:
47+
runs-on: ubuntu-latest
48+
outputs:
49+
exists: ${{ steps.openrouter-api-key-check.outputs.defined }}
50+
steps:
51+
- name: Check if OPENROUTER_API_KEY exists
52+
id: openrouter-api-key-check
53+
shell: bash
54+
run: |
55+
if [ "${{ secrets.OPENROUTER_API_KEY }}" != '' ]; then
56+
echo "defined=true" >> $GITHUB_OUTPUT;
57+
else
58+
echo "defined=false" >> $GITHUB_OUTPUT;
59+
fi
60+
4661
integration-test:
47-
# https://stackoverflow.com/questions/72925899/github-actions-detect-if-secret-exists
48-
env:
49-
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
50-
if: ${{ env.OPENROUTER_API_KEY != '' }}
51-
strategy:
52-
matrix:
53-
os: [ubuntu-latest] # macos-latest, windows-latest
54-
runs-on: ${{ matrix.os }}
62+
runs-on: ubuntu-latest
63+
needs: [check-openrouter-api-key]
64+
if: needs.check-openrouter-api-key.outputs.exists == 'true'
5565
steps:
5666
- name: Checkout code
5767
uses: actions/checkout@v4
@@ -64,7 +74,5 @@ jobs:
6474
run: echo "OPENROUTER_API_KEY=${{ secrets.OPENROUTER_API_KEY }}" > .env.integration
6575
- name: Install dependencies
6676
run: npm run install:all
67-
- run: xvfb-run -a npm run test:integration
68-
if: runner.os == 'Linux'
69-
- run: npm run test:integration
70-
if: runner.os != 'Linux'
77+
- name: Run integration tests
78+
run: xvfb-run -a npm run test:integration

0 commit comments

Comments
 (0)