Skip to content

Commit

Permalink
ci: handle env variables
Browse files Browse the repository at this point in the history
  • Loading branch information
mananrangkuti committed Jun 28, 2024
1 parent bb9ac80 commit 113f7f5
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 14 deletions.
28 changes: 14 additions & 14 deletions sdet/automation-test/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,21 +143,21 @@ runs:
shell: bash
run: ${{ inputs.custom_command_packages }}

- name: setup environment
env:
TEST_TYPE: ${{ inputs.profile }}
BASE_URL_STG: ${{ inputs.base_url_stg }}
QA_SERVICE_URL: ${{ inputs.qa_service_url }}
WONG_SERVICE_URL: ${{ inputs.wong_service_url }}
SLACK_WEBHOOK_URL: ${{ inputs.slack_webhook_url }}
SLACK_WEBHOOK_DEBUG_URL: ${{ inputs.slack_webhook_debug_url }}
TESTRAIL_URL: ${{ inputs.testrail_url }}
TESTRAIL_USERNAME: ${{ inputs.testrail_username }}
TESTRAIL_PASSWORD: ${{ inputs.testrail_password }}
- name: setup environment variables test automation
uses: kitabisa/composite-actions/sdet/tools/env@v2
with:
profile: ${{ inputs.profile }}
qa_service_url: ${{ inputs.qa_service_url }}
wong_service_url: ${{ inputs.wong_service_url }}
slack_webhook_url: ${{ inputs.slack_webhook_url }}
slack_webhook_debug_url: ${{ inputs.slack_webhook_debug_url }}
testrail_url: ${{ inputs.testrail_url }}
testrail_username: ${{ inputs.testrail_username }}
testrail_password: ${{ inputs.testrail_password }}

- name: create test run on testrails
shell: bash
if: "${{ inputs.platform = 'api' }}"
if: "${{ inputs.platform == 'api' }}"
run: ${{ inputs.custom_command_create_test_run }}

- name: run automation test
Expand All @@ -167,7 +167,7 @@ runs:

- name: Install rsync
shell: bash
if: "${{ inputs.platform = 'api' }}"
if: "${{ inputs.platform == 'api' }}"
run: ${{ inputs.custom_command_setup_rsync }}

- name: deploy reports to github pages
Expand All @@ -181,7 +181,7 @@ runs:

- name: insert result to testrails
shell: bash
if: "${{ inputs.platform = 'api' }}"
if: "${{ inputs.platform == 'api' }}"
run: ${{ inputs.custom_command_insert_testrails }}

- name: send report to slack
Expand Down
60 changes: 60 additions & 0 deletions sdet/tools/env/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: "manage env"
description: "manage environment variables for test automation"

inputs:
profile:
required: true
description: "test profile"
type: string

qa_service_url:
required: true
description: "qa service url"
type: string

wong_service_url:
required: true
description: "wong service url"
type: string

slack_webhook_url:
required: true
description: "slack webhook url"
type: string

slack_webhook_debug_url:
required: true
description: "slack webhook debug url"
type: string

testrail_url:
required: true
description: "testrail url"
type: string

testrail_username:
required: true
description: "testrail username"
type: string

testrail_password:
required: true
description: "testrail password"
type: string

runs:
using: "composite"
steps:
- name: setup env variables
shell: bash
run: cp .env.example .env
env:
TEST_TYPE: ${{ inputs.profile }}
QA_SERVICE_URL: ${{ inputs.qa_service_url }}
WONG_SERVICE_URL: ${{ inputs.wong_service_url }}
SLACK_WEBHOOK_URL: ${{ inputs.slack_webhook_url }}
SLACK_WEBHOOK_DEBUG_URL: ${{ inputs.slack_webhook_debug_url }}
TESTRAIL_URL: ${{ inputs.testrail_url }}
TESTRAIL_USERNAME: ${{ inputs.testrail_username }}
TESTRAIL_PASSWORD: ${{ inputs.testrail_password }}

0 comments on commit 113f7f5

Please sign in to comment.