-
Notifications
You must be signed in to change notification settings - Fork 74
104 lines (85 loc) · 4.07 KB
/
Copy pathe2e.yml
File metadata and controls
104 lines (85 loc) · 4.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: E2E Tests (driven by Testplane)
on:
pull_request:
branches: [master]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
testplane-e2e:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
env:
DOCKER_IMAGE_NAME: html-reporter-browsers
steps:
- uses: actions/checkout@v4
- name: Use Node.js 24
uses: actions/setup-node@v4
with:
node-version: 24
cache: "npm"
- name: Install dependencies
run: npm ci
- name: Build the package
run: npm run build
- name: "Prepare e2e tests: Cache browser docker image"
uses: actions/cache@v3
with:
path: ~/.docker/cache
key: docker-browser-image-testplane
- name: "Prepare e2e tests: Pull browser docker image"
run: |
mkdir -p ~/.docker/cache
if [ -f ~/.docker/cache/image.tar ]; then
docker load -i ~/.docker/cache/image.tar
else
docker pull yinfra/html-reporter-browsers
docker save yinfra/html-reporter-browsers -o ~/.docker/cache/image.tar
fi
- name: "Prepare e2e tests: Run browser docker image"
run: docker run -d --name ${{ env.DOCKER_IMAGE_NAME }} -it --rm --network=host $(which colima >/dev/null || echo --add-host=host.docker.internal:0.0.0.0) yinfra/html-reporter-browsers
# - name: 'Prepare e2e tests: Setup env'
# run: |
# REPORT_PREFIX=testplane-reports
# REPORT_DATE=$(date '+%Y-%m-%d')
# echo "DEST_REPORTS_DIR=$REPORT_PREFIX/$REPORT_DATE/${{ github.run_id }}/${{ github.run_attempt }}" >> $GITHUB_ENV
- name: "e2e: Run Testplane"
id: "testplane"
continue-on-error: true
run: npm run test-e2e-testplane
- name: "e2e: Stop browser docker image"
run: |
docker kill ${{ env.DOCKER_IMAGE_NAME }} || true
docker rm ${{ env.DOCKER_IMAGE_NAME }} || true
- name: Deploy Testplane html-reporter reports
uses: jakejarvis/s3-sync-action@v0.5.1
with:
args: --acl public-read --follow-symlinks
env:
AWS_S3_BUCKET: gh-testplane-ci
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_S3_ENDPOINT: https://s3.yandexcloud.net/
SOURCE_DIR: "test/e2e/report"
DEST_DIR: "testplane-ci/e2e-reports/${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}/"
- name: Construct PR comment
run: |
link="https://storage.yandexcloud.net/gh-testplane-ci/testplane-ci/e2e-reports/${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}/index.html"
if [ "${{ steps.testplane.outcome }}" != "success" ]; then
comment="### ❌ Testplane E2E run failed<br><br>[Report](${link})"
echo "PR_COMMENT=${comment}" >> $GITHUB_ENV
else
comment="### ✅ Testplane E2E run succeed<br><br>[Report](${link})"
echo "PR_COMMENT=${comment}" >> $GITHUB_ENV
fi
- name: Leave comment to PR with link to Testplane HTML reports
if: github.event.pull_request
uses: thollander/actions-comment-pull-request@v3
with:
message: ${{ env.PR_COMMENT }}
comment-tag: testplane_results
- name: Fail the job if any Testplane job is failed
if: ${{ steps.testplane.outcome != 'success' }}
run: exit 1