2022-08-19 17:42:03 +03:00
name : UI Tests
2022-04-28 09:31:29 +03:00
on :
2022-08-19 17:42:03 +03:00
workflow_dispatch :
2023-05-17 18:15:43 +02:00
inputs :
test_name :
description : 'If a test name is provided, only that test will be run. Otherwise, all tests will be run. Use the format "ClassName/testName" to run a single test.'
required : false
2022-08-19 17:42:03 +03:00
schedule :
2023-07-13 16:10:41 +01:00
- cron : '0 0,12 * * 1-5'
2022-08-19 17:42:03 +03:00
2022-04-28 09:31:29 +03:00
jobs :
tests :
name : Tests
2024-09-30 11:13:14 +01:00
runs-on : perf-only
2022-04-28 09:31:29 +03:00
concurrency :
2024-03-25 17:34:11 +02:00
# Only allow a single run of this workflow on each branch, automatically cancelling older runs.
group : ${{ format('ui-tests-{0}', github.ref) }}
2022-04-28 09:31:29 +03:00
cancel-in-progress : true
steps :
2024-03-25 17:34:11 +02:00
- uses : nschloe/action-cached-lfs-checkout@v1
2024-05-17 21:23:02 +00:00
- uses : actions/cache@v4
2022-04-28 09:31:29 +03:00
with :
path : vendor/bundle
key : ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys : |
${{ runner.os }}-gems-
2023-02-13 14:53:01 +02:00
- name : Setup environment
2023-05-17 18:15:43 +02:00
run : source ci_scripts/ci_common.sh && setup_github_actions_environment
2023-05-09 07:43:44 +03:00
2022-05-05 09:28:28 +03:00
- name : Run tests
2023-05-17 18:15:43 +02:00
run : |
if [[ -z "${{ github.event.inputs.test_name }}" ]]; then
bundle exec fastlane ui_tests
else
bundle exec fastlane ui_tests test_name:${{ github.event.inputs.test_name }}
fi
2024-02-28 18:01:20 +00:00
- name : Zip results # for faster upload
if : failure()
working-directory : fastlane/test_output
run : zip -r UITests.xcresult.zip UITests.xcresult
2022-08-11 15:02:47 +03:00
- name : Archive artifacts
2024-05-20 10:17:57 +00:00
uses : actions/upload-artifact@v4
2024-02-28 18:01:20 +00:00
if : failure()
2022-08-11 15:02:47 +03:00
with :
2024-02-28 18:01:20 +00:00
name : Results
path : fastlane/test_output/UITests.xcresult.zip
2022-08-11 15:02:47 +03:00
retention-days : 7
if-no-files-found : ignore
2022-05-05 09:28:28 +03:00
2024-02-28 18:01:20 +00:00
- name : Collect coverage
run : xcresultparser -q -o cobertura -t ElementX -p $(pwd) fastlane/test_output/UITests.xcresult > fastlane/test_output/ui-cobertura.xml
2022-05-09 10:03:23 +03:00
- name : Upload coverage to Codecov
2024-09-10 11:29:45 +03:00
uses : codecov/codecov-action@v3
2022-10-14 16:21:31 +03:00
with :
2024-04-22 14:59:51 +02:00
fail_ci_if_error : true
token : ${{ secrets.CODECOV_TOKEN }}
2023-05-17 18:15:43 +02:00
flags : uitests
2024-09-27 17:49:14 +03:00
version : v0.7.3
2024-09-12 07:09:15 +01:00
- name : Collect test results
if : ${{ !cancelled() }}
run : xcresultparser -q -o junit -p $(pwd) fastlane/test_output/UITests.xcresult > fastlane/test_output/ui-junit.xml
- name : Upload test results to Codecov
if : ${{ !cancelled() }}
uses : codecov/test-results-action@v1
2024-09-18 14:29:20 +03:00
continue-on-error : true
2024-09-12 07:09:15 +01:00
with :
2024-09-18 14:29:20 +03:00
fail_ci_if_error : false
2024-09-12 07:09:15 +01:00
token : ${{ secrets.CODECOV_TOKEN }}
flags : uitests