functional-test.yml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. name: Functional Tests
  2. on: [pull_request]
  3. concurrency:
  4. group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
  5. cancel-in-progress: true
  6. jobs:
  7. test:
  8. strategy:
  9. fail-fast: false
  10. matrix:
  11. test_targets:
  12. - HOST_OS: 'macos-15'
  13. XCODE_VERSION: '16.4'
  14. IOS_VERSION: '18.4'
  15. IOS_MODEL: iPhone 16 Plus
  16. - HOST_OS: 'macos-14'
  17. XCODE_VERSION: '15.4'
  18. IOS_VERSION: '17.5'
  19. IOS_MODEL: iPhone 15 Plus
  20. # https://github.com/actions/runner-images/blob/main/images/macos/macos-14-Readme.md
  21. runs-on: ${{matrix.test_targets.HOST_OS}}
  22. steps:
  23. - uses: actions/checkout@v3
  24. - uses: actions/setup-node@v3
  25. with:
  26. node-version: lts/*
  27. - uses: maxim-lobanov/setup-xcode@v1
  28. with:
  29. xcode-version: ${{matrix.test_targets.XCODE_VERSION}}
  30. - run: |
  31. npm install
  32. mkdir -p ./Resources/WebDriverAgent.bundle
  33. name: Install dev dependencies
  34. - name: Prepare iOS simulator
  35. env:
  36. DEVICE_NAME: ${{matrix.test_targets.IOS_MODEL}}
  37. PLATFORM_VERSION: ${{matrix.test_targets.IOS_VERSION}}
  38. run: |
  39. open -Fn "$(xcode-select -p)/Applications/Simulator.app"
  40. udid=$(xcrun simctl list devices available -j | \
  41. node -p "Object.entries(JSON.parse(fs.readFileSync(0)).devices).filter((x) => x[0].includes('$PLATFORM_VERSION'.replace('.', '-'))).reduce((acc, x) => [...acc, ...x[1]], []).find(({name}) => name === '$DEVICE_NAME').udid")
  42. xcrun simctl bootstatus $udid -b
  43. xcrun simctl shutdown $udid
  44. - run: npm run e2e-test
  45. name: Run functional tests
  46. env:
  47. CI: true
  48. _FORCE_LOGS: 1
  49. _LOG_TIMESTAMP: 1
  50. DEVICE_NAME: ${{matrix.test_targets.IOS_MODEL}}
  51. PLATFORM_VERSION: ${{matrix.test_targets.IOS_VERSION}}