|
1 | 1 | name: Code QA Roo Code |
2 | 2 |
|
3 | 3 | on: |
4 | | - workflow_dispatch: |
5 | | - push: |
6 | | - branches: [main] |
7 | | - pull_request: |
8 | | - types: [opened, reopened, ready_for_review, synchronize] |
9 | | - branches: [main] |
| 4 | + workflow_dispatch: |
| 5 | + push: |
| 6 | + branches: [main] |
| 7 | + pull_request: |
| 8 | + types: [opened, reopened, ready_for_review, synchronize] |
| 9 | + branches: [main] |
10 | 10 |
|
11 | 11 | jobs: |
12 | | - check-translations: |
13 | | - runs-on: ubuntu-latest |
14 | | - steps: |
15 | | - - name: Checkout code |
16 | | - uses: actions/checkout@v4 |
17 | | - - name: Setup Node.js and pnpm |
18 | | - uses: ./.github/actions/setup-node-pnpm |
19 | | - - name: Verify all translations are complete |
20 | | - run: node scripts/find-missing-translations.js |
| 12 | + check-translations: |
| 13 | + runs-on: ubuntu-latest |
| 14 | + steps: |
| 15 | + - name: Checkout code |
| 16 | + uses: actions/checkout@v4 |
| 17 | + - name: Setup Node.js and pnpm |
| 18 | + uses: ./.github/actions/setup-node-pnpm |
| 19 | + - name: Verify all translations are complete |
| 20 | + run: node scripts/find-missing-translations.js |
21 | 21 |
|
22 | | - knip: |
23 | | - runs-on: ubuntu-latest |
24 | | - steps: |
25 | | - - name: Checkout code |
26 | | - uses: actions/checkout@v4 |
27 | | - - name: Setup Node.js and pnpm |
28 | | - uses: ./.github/actions/setup-node-pnpm |
29 | | - - name: Run knip checks |
30 | | - run: pnpm knip |
| 22 | + knip: |
| 23 | + runs-on: ubuntu-latest |
| 24 | + steps: |
| 25 | + - name: Checkout code |
| 26 | + uses: actions/checkout@v4 |
| 27 | + - name: Setup Node.js and pnpm |
| 28 | + uses: ./.github/actions/setup-node-pnpm |
| 29 | + - name: Run knip checks |
| 30 | + run: pnpm knip |
31 | 31 |
|
32 | | - compile: |
33 | | - runs-on: ubuntu-latest |
34 | | - steps: |
35 | | - - name: Checkout code |
36 | | - uses: actions/checkout@v4 |
37 | | - - name: Setup Node.js and pnpm |
38 | | - uses: ./.github/actions/setup-node-pnpm |
39 | | - - name: Lint |
40 | | - run: pnpm lint |
41 | | - - name: Check types |
42 | | - run: pnpm check-types |
| 32 | + compile: |
| 33 | + runs-on: ubuntu-latest |
| 34 | + steps: |
| 35 | + - name: Checkout code |
| 36 | + uses: actions/checkout@v4 |
| 37 | + - name: Setup Node.js and pnpm |
| 38 | + uses: ./.github/actions/setup-node-pnpm |
| 39 | + - name: Lint |
| 40 | + run: pnpm lint |
| 41 | + - name: Check types |
| 42 | + run: pnpm check-types |
43 | 43 |
|
44 | | - platform-unit-test: |
45 | | - runs-on: ${{ matrix.os }} |
46 | | - strategy: |
47 | | - matrix: |
48 | | - os: [ubuntu-latest, windows-latest] |
49 | | - steps: |
50 | | - - name: Checkout code |
51 | | - uses: actions/checkout@v4 |
52 | | - - name: Setup Node.js and pnpm |
53 | | - uses: ./.github/actions/setup-node-pnpm |
54 | | - - name: Run unit tests |
55 | | - run: pnpm test |
| 44 | + platform-unit-test: |
| 45 | + runs-on: ${{ matrix.os }} |
| 46 | + strategy: |
| 47 | + matrix: |
| 48 | + os: [ubuntu-latest, windows-latest] |
| 49 | + steps: |
| 50 | + - name: Checkout code |
| 51 | + uses: actions/checkout@v4 |
| 52 | + - name: Setup Node.js and pnpm |
| 53 | + uses: ./.github/actions/setup-node-pnpm |
| 54 | + - name: Run unit tests |
| 55 | + run: pnpm test |
56 | 56 |
|
57 | | - check-openrouter-api-key: |
58 | | - runs-on: ubuntu-latest |
59 | | - outputs: |
60 | | - exists: ${{ steps.openrouter-api-key-check.outputs.defined }} |
61 | | - steps: |
62 | | - - name: Check if OpenRouter API key exists |
63 | | - id: openrouter-api-key-check |
64 | | - shell: bash |
65 | | - run: | |
66 | | - if [ "${{ secrets.OPENROUTER_API_KEY }}" != '' ]; then |
67 | | - echo "defined=true" >> $GITHUB_OUTPUT; |
68 | | - else |
69 | | - echo "defined=false" >> $GITHUB_OUTPUT; |
70 | | - fi |
| 57 | + check-openrouter-api-key: |
| 58 | + runs-on: ubuntu-latest |
| 59 | + outputs: |
| 60 | + exists: ${{ steps.openrouter-api-key-check.outputs.defined }} |
| 61 | + steps: |
| 62 | + - name: Check if OpenRouter API key exists |
| 63 | + id: openrouter-api-key-check |
| 64 | + shell: bash |
| 65 | + run: | |
| 66 | + if [ "${{ secrets.OPENROUTER_API_KEY }}" != '' ]; then |
| 67 | + echo "defined=true" >> $GITHUB_OUTPUT; |
| 68 | + else |
| 69 | + echo "defined=false" >> $GITHUB_OUTPUT; |
| 70 | + fi |
71 | 71 |
|
72 | | - integration-test: |
73 | | - runs-on: ubuntu-latest |
74 | | - needs: [check-openrouter-api-key] |
75 | | - if: needs.check-openrouter-api-key.outputs.exists == 'true' |
76 | | - steps: |
77 | | - - name: Checkout code |
78 | | - uses: actions/checkout@v4 |
79 | | - - name: Setup Node.js and pnpm |
80 | | - uses: ./.github/actions/setup-node-pnpm |
81 | | - - name: Create .env.local file |
82 | | - working-directory: apps/vscode-e2e |
83 | | - run: echo "OPENROUTER_API_KEY=${{ secrets.OPENROUTER_API_KEY }}" > .env.local |
84 | | - - name: Run integration tests |
85 | | - working-directory: apps/vscode-e2e |
86 | | - run: xvfb-run -a pnpm test:ci |
| 72 | + integration-test: |
| 73 | + runs-on: ubuntu-latest |
| 74 | + needs: [check-openrouter-api-key] |
| 75 | + if: needs.check-openrouter-api-key.outputs.exists == 'true' |
| 76 | + steps: |
| 77 | + - name: Checkout code |
| 78 | + uses: actions/checkout@v4 |
| 79 | + - name: Setup Node.js and pnpm |
| 80 | + uses: ./.github/actions/setup-node-pnpm |
| 81 | + - name: Create .env.local file |
| 82 | + working-directory: apps/vscode-e2e |
| 83 | + run: echo "OPENROUTER_API_KEY=${{ secrets.OPENROUTER_API_KEY }}" > .env.local |
| 84 | + - name: Run integration tests |
| 85 | + working-directory: apps/vscode-e2e |
| 86 | + run: xvfb-run -a pnpm test:ci |
| 87 | + |
| 88 | + notify-slack-on-failure: |
| 89 | + runs-on: ubuntu-latest |
| 90 | + needs: [check-translations, knip, compile, platform-unit-test, integration-test] |
| 91 | + if: ${{ always() && github.event_name == 'push' && github.ref == 'refs/heads/main' && contains(needs.*.result, 'failure') }} |
| 92 | + steps: |
| 93 | + - name: Checkout code |
| 94 | + uses: actions/checkout@v4 |
| 95 | + |
| 96 | + - name: Send Slack notification on failure |
| 97 | + uses: ./.github/actions/slack-notify |
| 98 | + with: |
| 99 | + webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }} |
| 100 | + channel: "#ci" |
| 101 | + workflow-name: "Code QA" |
| 102 | + failed-jobs: ${{ toJSON(needs) }} |
0 commit comments