Skip to content

Fix elapsed time for completed conversations #540

Fix elapsed time for completed conversations

Fix elapsed time for completed conversations #540

Workflow file for this run

name: iPolloWork Tests
on:
pull_request:
branches:
- main
- dev
push:
branches:
- main
- dev
permissions:
contents: read
jobs:
ipollowork-tests:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, macos-15]
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Setup toolchain
uses: ./.github/actions/setup-toolchain
- name: Install OpenCode CLI
shell: bash
env:
GITHUB_TOKEN: ${{ github.token }}
OPENCODE_GITHUB_REPO: ${{ vars.OPENCODE_GITHUB_REPO || 'anomalyco/opencode' }}
run: |
set -euo pipefail
repo="${OPENCODE_GITHUB_REPO:-anomalyco/opencode}"
version="$(node -e "const fs=require('fs'); const parsed=JSON.parse(fs.readFileSync('constants.json','utf8')); process.stdout.write(String(parsed.opencodeVersion||'').trim().replace(/^v/,''));")"
version="$(echo "$version" | tr -d '\r\n' | sed 's/^v//')"
if [ -z "$version" ]; then
echo "Unable to resolve OpenCode version from constants.json." >&2
exit 1
fi
arch="$(uname -m)"
case "${RUNNER_OS}" in
Linux)
if [ "$arch" = "aarch64" ] || [ "$arch" = "arm64" ]; then
opencode_asset="opencode-linux-arm64.tar.gz"
else
opencode_asset="opencode-linux-x64-baseline.tar.gz"
fi
;;
macOS)
if [ "$arch" = "arm64" ]; then
opencode_asset="opencode-darwin-arm64.zip"
else
opencode_asset="opencode-darwin-x64-baseline.zip"
fi
;;
*)
echo "Unsupported OS: ${RUNNER_OS}" >&2
exit 1
;;
esac
url="https://github.com/${repo}/releases/download/v${version}/${opencode_asset}"
tmp_dir="$RUNNER_TEMP/opencode"
extract_dir="$tmp_dir/extracted"
rm -rf "$tmp_dir"
mkdir -p "$extract_dir"
curl_headers=()
if [ -n "${GITHUB_TOKEN:-}" ]; then
curl_headers+=( -H "Authorization: Bearer ${GITHUB_TOKEN}" )
fi
curl -fsSL --retry 5 --retry-all-errors --retry-delay 2 "${curl_headers[@]}" -o "$tmp_dir/$opencode_asset" "$url"
if [[ "$opencode_asset" == *.tar.gz ]]; then
tar -xzf "$tmp_dir/$opencode_asset" -C "$extract_dir"
else
unzip -q "$tmp_dir/$opencode_asset" -d "$extract_dir"
fi
if [ -f "$extract_dir/opencode" ]; then
bin_path="$extract_dir/opencode"
elif [ -f "$extract_dir/opencode.exe" ]; then
bin_path="$extract_dir/opencode.exe"
else
echo "OpenCode binary not found in archive" >&2
ls -la "$extract_dir"
exit 1
fi
install_dir="$HOME/.opencode/bin"
mkdir -p "$install_dir"
cp "$bin_path" "$install_dir/opencode"
chmod 755 "$install_dir/opencode"
echo "$install_dir" >> "$GITHUB_PATH"
- name: Verify OpenCode
run: opencode --version
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Prepare complete bundled plugins
run: pnpm plugins:package --desktop
- name: Build runtime contracts
run: pnpm --filter ipollowork-server build
- name: Compile native macOS computer-use runtime
if: runner.os == 'macOS'
run: pnpm --filter @ipollowork/handsfree check
- name: Validate source and release contracts
run: |
node scripts/i18n-audit.mjs --ci
node --test scripts/release/package-client.test.mjs
- name: Provide bundled video codecs to tests
shell: bash
run: |
node --input-type=module <<'NODE'
import { createRequire } from 'node:module';
import { appendFileSync } from 'node:fs';
import { dirname } from 'node:path';
const require = createRequire(new URL('./apps/desktop/package.json', `file://${process.cwd()}/`));
const ffmpeg = require('@ffmpeg-installer/ffmpeg').path;
const ffprobe = require('@ffprobe-installer/ffprobe').path;
appendFileSync(process.env.GITHUB_ENV, `HYPERFRAMES_FFMPEG_PATH=${ffmpeg}\nHYPERFRAMES_FFPROBE_PATH=${ffprobe}\n`);
appendFileSync(process.env.GITHUB_PATH, `${dirname(ffmpeg)}\n${dirname(ffprobe)}\n`);
NODE
- name: Run the shared source checks and test suites
shell: bash
run: |
if [[ "${RUNNER_OS}" == "Linux" ]]; then
sandbox="$(node -e "const path=require('node:path');const electron=require('./apps/desktop/node_modules/electron');process.stdout.write(path.join(path.dirname(electron),'chrome-sandbox'))")"
sudo chown root:root "$sandbox"
sudo chmod 4755 "$sandbox"
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends openbox
xvfb-run -a bash -c '
openbox &
window_manager=$!
trap "kill $window_manager" EXIT
pnpm check
'
else
pnpm check
fi
- name: Run e2e tests
run: pnpm --filter @ipollowork/app test:e2e
business-components:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Setup Node
uses: actions/setup-node@v7
with:
node-version: 22.22.1
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: 1.3.14
- name: Install HyperFrames dependencies
working-directory: vendor/hyperframes
run: bun install --frozen-lockfile
- name: Build and validate all 35 business components
env:
CHROME_PATH: /usr/bin/google-chrome
run: node examples/stage-diagrams/build.mjs
- name: Upload the five current component packs and AI adapter
uses: actions/upload-artifact@v6
with:
name: stage-diagrams-4.0.0
path: examples/stage-diagrams/dist/hyperframes/
if-no-files-found: error