snapshot with grid coordinates #290
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Test | |
| on: | |
| push: | |
| branches: [ main, develop ] | |
| pull_request: | |
| branches: [ main, develop ] | |
| jobs: | |
| test: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| node-version: ['20'] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| - name: Install dependencies | |
| run: | | |
| npm ci | |
| - name: Install Playwright Browsers | |
| run: | | |
| npx playwright install chromium | |
| npx playwright install-deps chromium || true | |
| - name: Lint with ESLint | |
| run: | | |
| npm run lint | |
| - name: Type check | |
| run: | | |
| npm run type-check | |
| - name: Format check | |
| run: | | |
| npm run format-check | |
| - name: Build package | |
| run: | | |
| npm run build | |
| - name: Build and sync extension | |
| if: runner.os != 'Windows' | |
| shell: bash | |
| run: | | |
| if [ -d "../sentience-chrome" ]; then | |
| echo "Building sentience-chrome extension..." | |
| cd ../sentience-chrome | |
| ./build.sh | |
| echo "Verifying extension build..." | |
| if [ ! -f "dist/manifest.json" ]; then | |
| echo "❌ Error: Extension build failed - manifest.json not found in dist/" | |
| exit 1 | |
| fi | |
| echo "Copying extension files to sdk-ts/src/extension..." | |
| cd ../sdk-ts | |
| mkdir -p src/extension/pkg | |
| # Copy required files | |
| cp ../sentience-chrome/dist/manifest.json src/extension/ | |
| cp ../sentience-chrome/dist/*.js src/extension/ 2>/dev/null || true | |
| cp -r ../sentience-chrome/pkg/* src/extension/pkg/ 2>/dev/null || true | |
| # Verify extension files are present | |
| echo "Verifying extension files..." | |
| REQUIRED_FILES=( | |
| "src/extension/manifest.json" | |
| "src/extension/injected_api.js" | |
| "src/extension/pkg/sentience_core.js" | |
| "src/extension/pkg/sentience_core_bg.wasm" | |
| ) | |
| MISSING_FILES=() | |
| for file in "${REQUIRED_FILES[@]}"; do | |
| if [ ! -f "$file" ]; then | |
| MISSING_FILES+=("$file") | |
| fi | |
| done | |
| if [ ${#MISSING_FILES[@]} -ne 0 ]; then | |
| echo "❌ Error: Missing required extension files:" | |
| printf ' - %s\n' "${MISSING_FILES[@]}" | |
| exit 1 | |
| fi | |
| echo "✅ Extension built and synced successfully" | |
| echo "📦 Extension files:" | |
| find src/extension -type f | head -10 | |
| else | |
| echo "❌ Error: Extension directory not found at ../sentience-chrome" | |
| echo "Tests requiring extension will fail." | |
| exit 1 | |
| fi | |
| - name: Run tests | |
| run: | | |
| npm test | |
| env: | |
| CI: true | |