mirror of
https://github.com/BorysLevytskyi/BitwiseCmd.git
synced 2026-01-06 03:52:39 +01:00
Create manual workflow to run tests on the production version of BitwiseCmd (#60)
* Simplify BitwiseCmdTests action responsibilities * Fix build script to avoid hanging server * Run unit tests in PR workflow
This commit is contained in:
17
.github/workflows/manual-bitwisecmdtests.yml
vendored
Normal file
17
.github/workflows/manual-bitwisecmdtests.yml
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
name: Manual BitwiseCmdTests
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
run-bitwisecmdtests:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- name: Run BitwiseCmdTests
|
||||
uses: ./.github/actions/bitwisecmdtests
|
||||
with:
|
||||
test-command: test-prod
|
||||
upload-artifact: 'true'
|
||||
artifact-name: bitwisecmdtests-results
|
||||
bitwisecmd-tests-token: ${{ secrets.BITWISECMD_TESTS_TOKEN }}
|
||||
40
.github/workflows/pr-ci.yml
vendored
40
.github/workflows/pr-ci.yml
vendored
@@ -8,9 +8,6 @@ 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
|
||||
@@ -24,9 +21,14 @@ jobs:
|
||||
run: npm install --no-audit --no-fund
|
||||
|
||||
- name: Build application
|
||||
run: npx react-scripts build
|
||||
env:
|
||||
CI: true
|
||||
run: npm run build
|
||||
|
||||
- name: Run unit tests
|
||||
env:
|
||||
CI: true
|
||||
run: npm test -- --watch=false
|
||||
|
||||
- name: Start static web server
|
||||
run: |
|
||||
@@ -34,31 +36,12 @@ jobs:
|
||||
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
|
||||
- name: Run BitwiseCmdTests
|
||||
uses: ./.github/actions/bitwisecmdtests
|
||||
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
|
||||
test-command: test-build
|
||||
base-url: http://127.0.0.1:3030
|
||||
bitwisecmd-tests-token: ${{ secrets.BITWISECMD_TESTS_TOKEN }}
|
||||
|
||||
- name: Stop static web server
|
||||
if: always()
|
||||
@@ -66,3 +49,4 @@ jobs:
|
||||
if [ -f server.pid ]; then
|
||||
kill $(cat server.pid) || true
|
||||
fi
|
||||
rm -f server.pid
|
||||
|
||||
Reference in New Issue
Block a user