test fixes again #16
This file contains 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: Extension Test | |
on: | |
push: | |
branches: [ feature/integrationTestCI ] | |
pull_request: | |
branches: [ feature/integrationTestCI ] | |
workflow_dispatch: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
env: | |
DISPLAY: :99 | |
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Create .test_env file | |
run: | | |
echo "OPENROUTER_API_KEY=${{ secrets.OPENROUTER_API_KEY }}" > .test_env | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18' | |
- name: Install system dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y xvfb dbus dbus-x11 at-spi2-core libsecret-1-0 | |
sudo dbus-uuidgen --ensure | |
sudo service dbus start | |
- name: Start X11 and D-Bus | |
run: | | |
/usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & | |
sleep 3 | |
dbus-launch --auto-syntax > /tmp/dbus.env | |
source /tmp/dbus.env | |
- name: Install dependencies | |
run: npm run install:all | |
- name: Verify environment | |
run: | | |
echo "Checking display server..." | |
ps aux | grep Xvfb | |
echo "Checking dbus..." | |
dbus-send --session --dest=org.freedesktop.DBus --type=method_call --print-reply /org/freedesktop/DBus org.freedesktop.DBus.ListNames | |
echo "Checking environment variables..." | |
if [ -z "$OPENROUTER_API_KEY" ]; then | |
echo "OPENROUTER_API_KEY is not set" | |
exit 1 | |
fi | |
- name: Compile TypeScript | |
run: npm run compile | |
- name: Run tests | |
env: | |
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }} | |
run: | | |
source /tmp/dbus.env | |
xvfb-run -a --server-args="-screen 0 1024x768x24" npm run test:extension |