mirror of
https://github.com/anomalyco/opencode.git
synced 2026-04-02 03:54:41 +00:00
Compare commits
4 Commits
effect-sha
...
kit/ci-uni
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ccdc34b3b4 | ||
|
|
9054f6a262 | ||
|
|
7df330a37a | ||
|
|
7af6573e07 |
61
.github/workflows/test.yml
vendored
61
.github/workflows/test.yml
vendored
@@ -15,10 +15,11 @@ concurrency:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
checks: write
|
||||
|
||||
jobs:
|
||||
unit:
|
||||
name: unit (${{ matrix.settings.name }})
|
||||
name: unit (${{ matrix.settings.name }}, ${{ matrix.pkg.name }})
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
@@ -27,6 +28,15 @@ jobs:
|
||||
host: blacksmith-4vcpu-ubuntu-2404
|
||||
- name: windows
|
||||
host: blacksmith-4vcpu-windows-2025
|
||||
pkg:
|
||||
- id: opencode
|
||||
name: opencode
|
||||
dir: packages/opencode
|
||||
filter: opencode
|
||||
- id: app
|
||||
name: app
|
||||
dir: packages/app
|
||||
filter: "@opencode-ai/app"
|
||||
runs-on: ${{ matrix.settings.host }}
|
||||
defaults:
|
||||
run:
|
||||
@@ -45,8 +55,55 @@ jobs:
|
||||
git config --global user.email "bot@opencode.ai"
|
||||
git config --global user.name "opencode"
|
||||
|
||||
- name: Cache Turbo
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: node_modules/.cache/turbo
|
||||
key: turbo-${{ runner.os }}-${{ hashFiles('turbo.json', '**/package.json') }}-${{ github.sha }}
|
||||
restore-keys: |
|
||||
turbo-${{ runner.os }}-${{ hashFiles('turbo.json', '**/package.json') }}-
|
||||
turbo-${{ runner.os }}-
|
||||
|
||||
- name: Run unit tests
|
||||
run: bun turbo test
|
||||
run: |
|
||||
[[ "$RUNNER_OS" != "Windows" ]] && set -o pipefail || true
|
||||
mkdir -p ".artifacts/unit/${{ matrix.pkg.id }}" "${{ matrix.pkg.dir }}/.artifacts/unit"
|
||||
bunx turbo run test:ci --filter="${{ matrix.pkg.filter }}" --log-order=grouped --output-logs=full \
|
||||
2>&1 | tee ".artifacts/unit/${{ matrix.pkg.id }}/turbo.log"
|
||||
|
||||
- name: Check unit report
|
||||
if: always()
|
||||
id: report
|
||||
run: |
|
||||
if [ -f "${{ matrix.pkg.dir }}/.artifacts/unit/junit.xml" ]; then
|
||||
echo "found=true" >> "$GITHUB_OUTPUT"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "found=false" >> "$GITHUB_OUTPUT"
|
||||
echo "### Unit report unavailable" >> "$GITHUB_STEP_SUMMARY"
|
||||
echo "Turbo did not produce JUnit output for ${{ matrix.pkg.name }} on ${{ matrix.settings.name }}." >> "$GITHUB_STEP_SUMMARY"
|
||||
|
||||
- name: Publish unit report
|
||||
if: always() && steps.report.outputs.found == 'true'
|
||||
uses: mikepenz/action-junit-report@v6
|
||||
with:
|
||||
report_paths: ${{ matrix.pkg.dir }}/.artifacts/unit/junit.xml
|
||||
check_name: "unit (${{ matrix.settings.name }}, ${{ matrix.pkg.name }})"
|
||||
detailed_summary: true
|
||||
include_time_in_summary: true
|
||||
fail_on_failure: false
|
||||
|
||||
- name: Upload unit artifacts
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: unit-${{ matrix.settings.name }}-${{ matrix.pkg.id }}-${{ github.run_attempt }}
|
||||
if-no-files-found: ignore
|
||||
retention-days: 7
|
||||
path: |
|
||||
.artifacts/unit/${{ matrix.pkg.id }}/turbo.log
|
||||
${{ matrix.pkg.dir }}/.artifacts/unit/junit.xml
|
||||
|
||||
e2e:
|
||||
name: e2e (${{ matrix.settings.name }})
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
"build": "vite build",
|
||||
"serve": "vite preview",
|
||||
"test": "bun run test:unit",
|
||||
"test:ci": "bun test --preload ./happydom.ts ./src --reporter=default --reporter=junit --reporter-outfile=.artifacts/unit/junit.xml",
|
||||
"test:unit": "bun test --preload ./happydom.ts ./src",
|
||||
"test:unit:watch": "bun test --watch --preload ./happydom.ts ./src",
|
||||
"test:e2e": "playwright test",
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
"prepare": "effect-language-service patch || true",
|
||||
"typecheck": "tsgo --noEmit",
|
||||
"test": "bun test --timeout 30000",
|
||||
"test:ci": "bun test --timeout 30000 --reporter=default --reporter=junit --reporter-outfile=.artifacts/unit/junit.xml",
|
||||
"build": "bun run script/build.ts",
|
||||
"upgrade-opentui": "bun run script/upgrade-opentui.ts",
|
||||
"dev": "bun run --conditions=browser ./src/index.ts",
|
||||
|
||||
10
turbo.json
10
turbo.json
@@ -13,9 +13,19 @@
|
||||
"outputs": [],
|
||||
"passThroughEnv": ["*"]
|
||||
},
|
||||
"opencode#test:ci": {
|
||||
"dependsOn": ["^build"],
|
||||
"outputs": [".artifacts/unit/junit.xml"],
|
||||
"passThroughEnv": ["*"]
|
||||
},
|
||||
"@opencode-ai/app#test": {
|
||||
"dependsOn": ["^build"],
|
||||
"outputs": []
|
||||
},
|
||||
"@opencode-ai/app#test:ci": {
|
||||
"dependsOn": ["^build"],
|
||||
"outputs": [".artifacts/unit/junit.xml"],
|
||||
"passThroughEnv": ["*"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user