File tree Expand file tree Collapse file tree 1 file changed +20
-12
lines changed
Expand file tree Collapse file tree 1 file changed +20
-12
lines changed Original file line number Diff line number Diff 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
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
You can’t perform that action at this time.
0 commit comments