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

ci: handle env variables #102

Merged
merged 2 commits into from
Jul 1, 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
44 changes: 12 additions & 32 deletions sdet/automation-test/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,6 @@ inputs:
required: true
description: "gh token"

base_url_stg:
required: false
description: "base url stg"
default: ""
type: string

qa_service_url:
required: false
description: "qa service url"
default: ""
type: string

wong_service_url:
required: false
description: "wong service url"
default: ""
type: string

slack_webhook_url:
required: false
description: "slack webhook url"
Expand Down Expand Up @@ -143,21 +125,19 @@ 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 }}
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 +147,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 +161,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
48 changes: 48 additions & 0 deletions sdet/tools/env/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: "manage env"
description: "manage environment variables for test automation"

inputs:
profile:
required: true
description: "test profile"
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 }}
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 }}