Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

code_refactor #40

Merged
merged 2 commits into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 7 additions & 26 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'MeshMap-Snapshot'
description: 'Walks in application and takes a shot of your infrastructure using Meshery Extension MeshMap'
name: "MeshMap-Snapshot"
description: "Walks in application and takes a shot of your infrastructure using Meshery Extension MeshMap"
author: Layer5
inputs:
designID:
Expand Down Expand Up @@ -64,7 +64,7 @@ runs:
cluster_name: "kind-cluster"
- run: echo ${{ steps.ping-playground.outputs.IS_PLAYGROUND_RUNNING }}
shell: bash
- run:
- run:
working-directory: action/cypress-action/
if: ${{ !steps.ping-playground.outputs.IS_PLAYGROUND_RUNNING }}
shell: bash
Expand Down Expand Up @@ -96,35 +96,16 @@ runs:
- run: echo $APPLICATION_ID && echo ${{env.APPLICATION_ID}}
shell: bash
- name: Cypress run
uses: cypress-io/github-action@v4
with:
working-directory: action/cypress-action
spec: cypress/e2e/e2e/**/*
browser: chrome
# record: true
env:
GITHUB_TOKEN: ${{ inputs.githubToken }}
CYPRESS_token: ${{ inputs.providerToken }}
CYPRESS_releasetag: ${{env.tag}}
CYPRESS_applicationId: ${{ env.APPLICATION_ID }}
# CYPRESS_RECORD_KEY: ${{ inputs.cypressRecordKey }}
uses: action/cypress-job #reference to cypress workflow
- run: ls
shell: bash
- run: tree action/cypress-action/cypress/ -L 2me
shell: bash
- name: Upload Cypress artifacts
if: always()
uses: actions/upload-artifact@v3
with:
name: cypress-ss
path: action/cypress-action/cypress/videos
uses: cypress-ss
- name: Upload Cypress artifacts
if: always()
uses: actions/upload-artifact@v3
with:
name: cypress-ss
path: action/cypress-action/cypress/screenshots
- run: echo "SCREENSHOT_NAME=$(ls)" >> $GITHUB_ENV # Assumption: There is only one screenshot in the download directory
uses: cypress-artifacts
- run: echo "SCREENSHOT_NAME=$(ls)" >> $GITHUB_ENV # Assumption: There is only one screenshot in the download directory
working-directory: action/cypress-action/cypress/downloads
shell: bash
- run: mv "$SCREENSHOT_NAME" screenshot.png
Expand Down
11 changes: 11 additions & 0 deletions cypress-artifacts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: cypress-artifacts

on:
pull_request_target:
types: [opened, synchronize, reopened]
jobs:
cypress-artifacts:
runs-on: ubuntu-latest

steps:

24 changes: 24 additions & 0 deletions cypress-ss.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Cypress-ss

on:
pull_request_target:
types: [opened, synchronize, reopened]

jobs:
cypress-ss:
runs-on: ubuntu-latest

steps:
- name: Upload Cypress artifacts
if: always()
uses: actions/upload-artifact@v3
with:
name: cypress-ss
path: action/cypress-action/cypress/videos

- name: Upload Cypress artifacts
if: always()
uses: actions/upload-artifact@v3
with:
name: cypress-ss
path: action/cypress-action/cypress/screenshots
28 changes: 28 additions & 0 deletions cypress.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Cypress Run Workflow

on:
pull_request_target:
types: [opened, synchronize, reopened]
jobs:
cypress-job:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Cypress run
uses: cypress-io/github-action@v4
with:
working-directory: action/cypress-action
spec: cypress/e2e/e2e/**/*
browser: chrome
# record: true
env:
GITHUB_TOKEN: ${{ inputs.githubToken }}
CYPRESS_token: ${{ inputs.providerToken }}
CYPRESS_releasetag: ${{env.tag}}
CYPRESS_applicationId: ${{ env.APPLICATION_ID }}
# CYPRESS_RECORD_KEY: ${{ inputs.cypressRecordKey }}


12 changes: 12 additions & 0 deletions token-provider.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

PROVIDER_TOKEN=${{inputs.providerToken}} node node-file-upload/index.js > __fileResponse.txt
outputstr=$(head -n 1 __fileResponse.txt)
required_string="https"
echo $outputstr

if [[ "$outputstr" == "$required_string"* ]]; then
echo "RESOURCE_URL=$outputstr" >> $GITHUB_ENV
else
echo "RESOURCE_URL=false" >> $GITHUB_ENV
fi
Loading