Robotframework tests not running in github actions

Im trying to run a very simple robot framework test of launching a browser from github actions. I have installed chrome and chrome browser and gave necessary permissions. But tests are failing with error “WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally. (unknown error: DevToolsActivePort file doesn’t exist) (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)”

Package in github actions yaml file:
sudo apt-get update
pip install webdrivermanager
sudo webdrivermanager firefox chrome --linkpath /usr/bin
sudo chmod +x /usr/bin/chromedriver
sudo apt -y --force-yes install fonts-liberation libasound2 libatk-bridge2.0-0 libatk1.0-0 libatspi2.0-0 libcairo2 libcups2 libdrm2 libgbm1 libgtk-3-0 libnspr4 libnss3 libpango-1.0-0 libx11-6 libxcb1 libxcomposite1 libxdamage1 libxext6 libxfixes3 libxkbcommon0 libxrandr2 xdg-utils
sudo apt -y --force-yes install wget
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome-stable_current_amd64.deb
sudo apt install -f

Login keyword file to launch browser:

Launch URL
${chrome_options}=  Evaluate  sys.modules['selenium.webdriver'].ChromeOptions()  sys, selenium.webdriver
Call Method    ${chrome_options}    add_argument    --no-sandbox
Call Method    ${chrome_options}    add_argument    --disable-extensions
Call Method    ${chrome_options}    add_argument    --headless
Call Method    ${chrome_options}    add_argument    --disable-gpu
Create Webdriver    Chrome    chrome_options=${chrome_options}
Go To    ${URL}

Your error here is probably not in your Robotframework code but in your github actions setup. Could you share your github actions yml?

For example: robotframework-zoomba/run-tests.yml at master · Accruent/robotframework-zoomba · GitHub

run-tests-chrome:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version: [ 3.7, 3.8, 3.9, '3.10' ]
        include:
          - os: ubuntu-latest
            set_display: export DISPLAY=:99; Xvfb :99 -screen 0 1024x768x24 -ac -noreset & sleep 3
    steps:
      - uses: actions/checkout@v3
      - name: Set up Python ${{ matrix.python-version }}
        uses: actions/setup-python@v4.3.0
        with:
          python-version: ${{ matrix.python-version }}

      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          pip install .
          pip install mock
          sudo apt-get update
          sudo apt-get -y -q install xvfb scrot zip curl libxml2-dev libxslt1-dev
      - name: Run Chrome Robot Tests
        uses: nick-fields/retry@v2.8.2
        with:
          timeout_minutes: 45
          max_attempts: 10
          command: |
            ${{ matrix.set_display }}
            robot --randomize suites -e BrokenORWindowsOREdge --output reports/outputChrome.xml test
          new_command_on_retry: |
            ${{ matrix.set_display }}
            robot --rerunfailed "reports/outputChrome.xml" -e BrokenORWindowsOREdge --output reports/outputChrome.xml test