Files
BitwiseCmd/.github/workflows/pr-ci.yml
2025-11-05 15:37:06 -05:00

69 lines
2.0 KiB
YAML

name: PR CI
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
e2e-tests:
runs-on: ubuntu-latest
timeout-minutes: 5
env:
BITWISECMD_TESTS_TOKEN: ${{ secrets.BITWISECMD_TESTS_TOKEN }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18
- name: Install dependencies
run: npm install --no-audit --no-fund
- name: Build application
run: npx react-scripts build
env:
CI: true
- name: Start static web server
run: |
npx --yes http-server ./build -p 3030 --silent </dev/null > server.log 2>&1 &
echo $! > server.pid
npx --yes wait-on --timeout=120000 http-get://127.0.0.1:3030
- name: Ensure BitwiseCmdTests access token is configured
if: ${{ env.BITWISECMD_TESTS_TOKEN == '' }}
run: |
echo "::error::Add a personal access token with repo scope as the BITWISECMD_TESTS_TOKEN repository secret so the CI job can clone BitwiseCmdTests."
exit 1
- name: Checkout BitwiseCmdTests repository
if: ${{ env.BITWISECMD_TESTS_TOKEN != '' }}
uses: actions/checkout@v4
with:
repository: ${{ github.repository_owner }}/BitwiseCmdTests
path: BitwiseCmdTests
token: ${{ env.BITWISECMD_TESTS_TOKEN }}
- name: Install BitwiseCmdTests dependencies
working-directory: BitwiseCmdTests
run: npm install --no-audit --no-fund
- name: Run webdriver tests
working-directory: BitwiseCmdTests
env:
BASE_URL: http://localhost:3030
CHROME_ARGS: --headless=new --disable-gpu --no-sandbox --disable-dev-shm-usage --window-size=1280,720
run: |
xvfb-run --auto-servernum -- npm run test-build
- name: Stop static web server
if: always()
run: |
if [ -f server.pid ]; then
kill $(cat server.pid) || true
fi