-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (43 loc) · 1.51 KB
/
main.yml
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
name: Run automation scripts
on:
pull_request:
types:
- closed
branches:
- main
jobs:
runs-on: ubuntu-latest
steps:
- run: |
echo The PR was merged
- name: Run generated Cypress Automation scripts
run: |
pwd
ls
# Ensure the directory exists before navigating to it
test -d /tmp/cypress-umesh && cd /tmp/cypress-umesh || echo "/tmp/cypress-umesh directory does not exist"
ls -lrta /tmp/cypress-umesh
npm run test
- name: Generate report for cypress-
if: ${{ ! cancelled() }}
run: |
cd /tmp/cypress-umesh
npm run generate-merge-report
- name: Install aws-cli
id: install-aws
if: ${{ ! cancelled() }}
run: |
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install --update
- name: Upload cypress report folder to S3
if: always()
run: |
pwd
ls -l /tmp/cypress-umesh/mochawesome-report
timestamp=$(date +"%Y-%m-%d-%H-%M-%S")
aws s3 cp --recursive /tmp/cypress-umesh/mochawesome-report s3://testbucket-for-triggering/reports/${timestamp}/
env:
AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY_ID}}
AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}}
AWS_DEFAULT_REGION: 'ap-south-1'