Skip to content

Commit

Permalink
try running ui tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mkurnikov committed Apr 7, 2024
1 parent b6a1215 commit ea34a97
Showing 1 changed file with 81 additions and 0 deletions.
81 changes: 81 additions & 0 deletions .github/workflows/run_ui_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Run UI Tests
on: workflow_dispatch

jobs:
run-ui-tests:
name: run tests for ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
runIde: |
export DISPLAY=:99.0
Xvfb -ac :99 -screen 0 1920x1080x24 &
sleep 10
mkdir -p ui-tests/build/reports
./gradlew :ui-tests:runIdeForUiTests > ui-tests/build/reports/idea.log &
runTests: |
export DISPLAY=:99.0
./gradlew :ui-tests:test
url: http://127.0.0.1:8082
reportName: ui-tests-fails-report-linux
# - os: macOS-latest
# runIde: ./gradlew :ui-tests:runIdeForUiTests &
# runTests: ./gradlew :ui-tests:test
# url: http://127.0.0.1:8082
# reportName: ui-test-fails-report-mac
# - os: windows-latest
# runIde: start gradlew.bat :ui-tests:runIdeForUiTests
# runTests: ./gradlew :ui-tests:test
# url: http://localhost:8082
# reportName: ui-test-fails-report-windows

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4.1.1

- name: Setup Java
uses: actions/setup-java@v3.13.0
with:
distribution: zulu
java-version: 17

- name: Setup FFmpeg
uses: FedericoCarboni/setup-ffmpeg@v2
with:
# Not strictly necessary, but it may prevent rate limit
# errors especially on GitHub-hosted macos machines.
token: ${{ secrets.GITHUB_TOKEN }}

- name: Clean
run: ./gradlew :ui-tests:clean

- name: Run Idea
run: ${{ matrix.runIde }}

- name: Wait for Idea started
uses: jtalk/url-health-check-action@v3
with:
url: ${{ matrix.url }}
max-attempts: 15
retry-delay: 30s

- name: Run tests
run: ${{ matrix.runTests }}

- name: Move video
if: ${{ failure() }}
run: mv ui-tests/video ui-tests/build/reports

- name: Copy logs
if: ${{ failure() }}
run: mv ui-tests/build/idea-sandbox/system/log/ ui-tests/build/reports

- name: Save fails report
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.reportName }}
path: |
ui-tests/build/reports

0 comments on commit ea34a97

Please sign in to comment.