11name : Code QA Roo Code
22
33on :
4+ workflow_dispatch :
45 push :
56 branches : [main]
67 pull_request :
@@ -13,33 +14,65 @@ jobs:
1314 steps :
1415 - name : Checkout code
1516 uses : actions/checkout@v4
16-
1717 - name : Setup Node.js
1818 uses : actions/setup-node@v4
1919 with :
2020 node-version : ' 18'
2121 cache : ' npm'
22-
2322 - name : Install dependencies
2423 run : npm run install:all
25-
26- - name : Compile TypeScript
24+ - name : Compile
2725 run : npm run compile
26+ - name : Check types
27+ run : npm run check-types
28+ - name : Lint
29+ run : npm run lint
2830
2931 unit-test :
3032 runs-on : ubuntu-latest
3133 steps :
3234 - name : Checkout code
3335 uses : actions/checkout@v4
34-
3536 - name : Setup Node.js
3637 uses : actions/setup-node@v4
3738 with :
3839 node-version : ' 18'
3940 cache : ' npm'
40-
4141 - name : Install dependencies
4242 run : npm run install:all
43-
4443 - name : Run unit tests
45- run : npm test
44+ run : npm test
45+
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+
61+ integration-test :
62+ runs-on : ubuntu-latest
63+ needs : [check-openrouter-api-key]
64+ if : needs.check-openrouter-api-key.outputs.exists == 'true'
65+ steps :
66+ - name : Checkout code
67+ uses : actions/checkout@v4
68+ - name : Setup Node.js
69+ uses : actions/setup-node@v4
70+ with :
71+ node-version : ' 18'
72+ cache : ' npm'
73+ - name : Create env.integration file
74+ run : echo "OPENROUTER_API_KEY=${{ secrets.OPENROUTER_API_KEY }}" > .env.integration
75+ - name : Install dependencies
76+ run : npm run install:all
77+ - name : Run integration tests
78+ run : xvfb-run -a npm run test:integration
0 commit comments