K6 browser test in Github actions using self hosted runner

Hello Grafana k6 community,
I am trying to run a k6 browser script in Github actions usining a self hosted runner (a fedora pod on openshift platform) but with out success. Has anyone tried doing the same and can share some tips please!

Below is my workflow file:
jobs:
k6-browser-perf-test-run:
runs-on: ct-runners
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Chrome
uses: browser-actions/setup-chrome@v1
with:
chrome-version: 120
install-chromedriver: true
install-dependencies: true
- name: install k6, Go and xk6 browser extension
run: |
sudo dnf -y install
sudo dnf -y install k6
wget
tar -C /usr/local -xzvf go1.22.4.linux-amd64.tar.gz
export PATH=$PATH:/usr/local/go/bin:/home/runner/go/bin/
go version
go install go.k6.io/xk6/cmd/xk6@latest
xk6 build --with GitHub - grafana/xk6-browser: k6 extension that adds support for browser automation and end-to-end web testing via the Chrome Devtools Protocol

  - name: Run k6 browser perf test
  Option1  run: K6_BROWSER_HEADLESS=false k6 run PerformanceTest/k6/k6_examples/pimo_browse.js
Option2    run: |
     ./k6 run --no-sandbox PerformanceTest/k6/k6_examples/pimo_browse.js

Errors:
with Option1:
time=“2024-07-02T12:58:36Z” level=error msg="error building browser on IterStart: launching browser: Running as root without --no-sandbox is not supported.
Error: Process completed with exit code 108.

with Option2: time=“2024-07-02T13:04:08Z” level=error msg=“unknown flag: --no-sandbox”

Error: Process completed with exit code 255.

Hi @prasantakumarpadhi,

You can get inspired by how we do that by looking at our Github actions on our repo, here.