2023-10-31 19:28:51 +00:00
|
|
|
name: 'UI report'
|
|
|
|
description: 'Prepare and upload HTML report of UI test results'
|
|
|
|
inputs:
|
2023-12-08 15:50:56 +00:00
|
|
|
model:
|
|
|
|
description: 'Internal model name'
|
2023-10-31 19:28:51 +00:00
|
|
|
required: true
|
2024-03-22 15:26:47 +00:00
|
|
|
lang:
|
|
|
|
description: 'Firmware language code'
|
|
|
|
required: true
|
2024-03-14 21:09:04 +00:00
|
|
|
status:
|
|
|
|
description: 'Either "success" or "failure"'
|
|
|
|
required: false
|
|
|
|
default: "failure"
|
2023-10-31 19:28:51 +00:00
|
|
|
runs:
|
|
|
|
using: composite
|
|
|
|
steps:
|
2023-12-08 15:50:56 +00:00
|
|
|
- name: Set AWS credentials
|
|
|
|
uses: aws-actions/configure-aws-credentials@v4
|
|
|
|
with:
|
|
|
|
role-to-assume: arn:aws:iam::538326561891:role/gh_actions_deploy_dev_firmware_data
|
|
|
|
aws-region: eu-west-1
|
|
|
|
- run: |
|
2024-03-22 15:26:47 +00:00
|
|
|
MODELJOB=${{ inputs.model }}-${{ inputs.lang }}-${{ github.job }}
|
2023-12-08 15:50:56 +00:00
|
|
|
OUTDIR=${{ github.run_id }}/$MODELJOB
|
|
|
|
mkdir -p $OUTDIR
|
|
|
|
nix-shell --run "poetry run python ci/prepare_ui_artifacts.py || true"
|
|
|
|
mv tests/ui_tests/reports/test/* $OUTDIR || true
|
|
|
|
mv tests/ui_tests/fixtures.*.json $OUTDIR || true
|
|
|
|
mv tests/trezor.log $OUTDIR || true
|
|
|
|
diff -u tests/ui_tests/fixtures.json tests/ui_tests/fixtures.suggestion.json || true
|
|
|
|
tar -cf screens_$MODELJOB.tar tests/ui_tests/screens || true
|
2024-03-14 21:09:04 +00:00
|
|
|
|
|
|
|
if [ "${{ inputs.status }}" = "success" ]; then
|
|
|
|
cp .github/actions/ui-report/success.png $OUTDIR/status.png
|
|
|
|
else
|
|
|
|
cp .github/actions/ui-report/failure.png $OUTDIR/status.png
|
|
|
|
fi
|
2023-10-31 19:28:51 +00:00
|
|
|
shell: sh
|
2023-12-08 15:50:56 +00:00
|
|
|
- name: Upload report
|
|
|
|
run: |
|
2024-05-09 13:27:57 +00:00
|
|
|
aws s3 sync --no-progress ${{ github.run_id }} s3://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}
|
2024-03-22 15:26:47 +00:00
|
|
|
echo "[UI test report](https://data.trezor.io/dev/firmware/ui_report/${{ github.run_id }}/${{ inputs.model }}-${{ inputs.lang }}-${{ github.job }}/index.html)" >> $GITHUB_STEP_SUMMARY
|
2023-10-31 19:28:51 +00:00
|
|
|
shell: sh
|
2023-12-08 15:50:56 +00:00
|
|
|
- name: Upload test screen recording
|
|
|
|
run: |
|
2024-05-09 13:27:57 +00:00
|
|
|
aws s3 sync --no-progress ci/ui_test_records s3://data.trezor.io/dev/firmware/ui_tests
|
2023-12-08 15:50:56 +00:00
|
|
|
# TODO: generate directory listing / autoindex
|
2023-10-31 19:28:51 +00:00
|
|
|
shell: sh
|
2024-02-15 09:25:33 +00:00
|
|
|
- uses: actions/upload-artifact@v4
|
2023-10-31 19:28:51 +00:00
|
|
|
with:
|
2024-02-15 09:25:33 +00:00
|
|
|
name: ui-records-${{ github.job }}-${{ strategy.job-index }}
|
2023-10-31 19:28:51 +00:00
|
|
|
path: |
|
2024-03-22 15:26:47 +00:00
|
|
|
# used by core_ui_main
|
|
|
|
screens_${{ inputs.model }}-${{ inputs.lang }}-${{ github.job }}.tar
|
2023-12-08 15:50:56 +00:00
|
|
|
retention-days: 1 # not useful after workflow finishes
|