GeezerVison is showing github.com — test(ci): publish unit reports in actions (#20547) · Pablo-GNU/opencode@c72642d
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: .github/workflows/test.yml +30-4Lines changed: 30 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -15,6 +15,7 @@ concurrency: | 15 | 15 |
| 16 | 16 | permissions: | 17 | 17 | contents: read | | 18 | + checks: write | 18 | 19 |
| 19 | 20 | jobs: | 20 | 21 | unit: | @@ -45,14 +46,39 @@ jobs: | 45 | 46 | | 46 | 47 | git config --global user.name "opencode" | 47 | 48 |
| | 49 | + - name: Cache Turbo | | 50 | + uses: actions/cache@v4 | | 51 | + with: | | 52 | + path: node_modules/.cache/turbo | | 53 | + key: turbo-${{ runner.os }}-${{ hashFiles('turbo.json', '**/package.json') }}-${{ github.sha }} | | 54 | + restore-keys: | | | 55 | + turbo-${{ runner.os }}-${{ hashFiles('turbo.json', '**/package.json') }}- | | 56 | + turbo-${{ runner.os }}- | | 57 | +
| 48 | 58 | - name: Run unit tests | 49 | | - run: bun turbo test | | 59 | + run: bun turbo test:ci | 50 | 60 | env: | 51 | | - # Bun 1.3.11 intermittently crashes on Windows during test teardown | 52 | | - # inside the native @parcel/watcher binding. Unit CI does not rely on | 53 | | - # the live watcher backend there, so disable it for that platform. | 54 | 61 | OPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER: ${{ runner.os == 'Windows' && 'true' || 'false' }} | 55 | 62 |
| | 63 | + - name: Publish unit reports | | 64 | + if: always() | | 65 | + uses: mikepenz/action-junit-report@v6 | | 66 | + with: | | 67 | + report_paths: packages/*/.artifacts/unit/junit.xml | | 68 | + check_name: "unit results (${{ matrix.settings.name }})" | | 69 | + detailed_summary: true | | 70 | + include_time_in_summary: true | | 71 | + fail_on_failure: false | | 72 | + | | 73 | + - name: Upload unit artifacts | | 74 | + if: always() | | 75 | + uses: actions/upload-artifact@v4 | | 76 | + with: | | 77 | + name: unit-${{ matrix.settings.name }}-${{ github.run_attempt }} | | 78 | + if-no-files-found: ignore | | 79 | + retention-days: 7 | | 80 | + path: packages/*/.artifacts/unit/junit.xml | | 81 | + | 56 | 82 | e2e: | 57 | 83 | name: e2e (${{ matrix.settings.name }}) | 58 | 84 | strategy: | |
Collapse file Copy file name to clipboardExpand all lines: packages/app/package.json +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 15 | 15 | "build": "vite build", | 16 | 16 | "serve": "vite preview", | 17 | 17 | "test": "bun run test:unit", | | 18 | + "test:ci": "bun test --preload ./happydom.ts ./src --reporter=junit --reporter-outfile=.artifacts/unit/junit.xml", | 18 | 19 | "test:unit": "bun test --preload ./happydom.ts ./src", | 19 | 20 | "test:unit:watch": "bun test --watch --preload ./happydom.ts ./src", | 20 | 21 | "test:e2e": "playwright test", | |
Collapse file Copy file name to clipboardExpand all lines: packages/opencode/package.json +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 9 | 9 | "prepare": "effect-language-service patch || true", | 10 | 10 | "typecheck": "tsgo --noEmit", | 11 | 11 | "test": "bun test --timeout 30000", | | 12 | + "test:ci": "bun test --timeout 30000 --reporter=junit --reporter-outfile=.artifacts/unit/junit.xml", | 12 | 13 | "build": "bun run script/build.ts", | 13 | 14 | "upgrade-opentui": "bun run script/upgrade-opentui.ts", | 14 | 15 | "dev": "bun run --conditions=browser ./src/index.ts", | |
Collapse file Copy file name to clipboardExpand all lines: turbo.json +10Lines changed: 10 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 13 | 13 | "outputs": [], | 14 | 14 | "passThroughEnv": ["*"] | 15 | 15 | }, | | 16 | + "opencode#test:ci": { | | 17 | + "dependsOn": ["^build"], | | 18 | + "outputs": [".artifacts/unit/junit.xml"], | | 19 | + "passThroughEnv": ["*"] | | 20 | + }, | 16 | 21 | "@opencode-ai/app#test": { | 17 | 22 | "dependsOn": ["^build"], | 18 | 23 | "outputs": [] | | 24 | + }, | | 25 | + "@opencode-ai/app#test:ci": { | | 26 | + "dependsOn": ["^build"], | | 27 | + "outputs": [".artifacts/unit/junit.xml"], | | 28 | + "passThroughEnv": ["*"] | 19 | 29 | } | 20 | 30 | } | 21 | 31 | } |
|