On Demand Test Run - DEV - ubuntu-latest #196
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: On Demand Test Run | |
on: | |
workflow_dispatch: | |
inputs: | |
test_suite: | |
description: 'Select the test suite to run' | |
required: true | |
default: 'e2e/*' | |
os: | |
type: choice | |
description: Choose OS to run on | |
default: ubuntu-latest | |
options: | |
- ubuntu-latest | |
- windows-latest | |
- macos-latest | |
environment: | |
type: environment | |
description: Choose environment to run on | |
default: 'DEV' | |
run-name: On Demand Test Run - ${{ github.event.inputs.environment }} - ${{ github.event.inputs.os }} | |
jobs: | |
run-tests: | |
runs-on: ${{ github.event.inputs.os }} | |
environment: ${{ github.event.inputs.environment }} | |
env: | |
ALLURE_ENDPOINT: 'https://inworld.testops.cloud/' | |
ALLURE_PROJECT_ID: '35' | |
ALLURE_JOB_RUN_ID: '' | |
ALLURE_RESULTS: 'build/allure-results' | |
AUTH_IDENTITY_PROVIDER: ${{ vars.AUTH_IDENTITY_PROVIDER }} | |
AUTH_SERVICE_ACCOUNT: ${{ vars.AUTH_SERVICE_ACCOUNT }} | |
ENV: ${{ github.event.inputs.environment }} | |
OS: ${{ github.event.inputs.os }} | |
NODE_SDK_INWORLD_ENGINE_HOST: ${{ vars.NODE_SDK_INWORLD_ENGINE_HOST }} | |
permissions: | |
contents: 'read' | |
id-token: 'write' | |
steps: | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18.x' | |
- name: Checkout source code | |
uses: actions/checkout@v3 | |
- id: "auth" | |
name: "Authenticate to Google Cloud" | |
uses: "google-github-actions/auth@v2" | |
with: | |
token_format: "access_token" | |
workload_identity_provider: "${{ env.AUTH_IDENTITY_PROVIDER }}" | |
service_account: "${{ env.AUTH_SERVICE_ACCOUNT }}" | |
- id: "secrets" | |
uses: 'google-github-actions/get-secretmanager-secrets@v2' | |
with: | |
secrets: |- | |
STUDIO_INTEGRATIONS_API_KEY:${{env.GOOGLE_CLOUD_PROJECT}}/nodejs-sdk-integration-studio-key | |
STUDIO_INTEGRATIONS_API_SECRET:${{env.GOOGLE_CLOUD_PROJECT}}/nodejs-sdk-integration-studio-secret | |
ALLURE_TOKEN:${{env.GOOGLE_CLOUD_PROJECT}}/allure-token | |
- name: Install Packages | |
run: yarn install | |
- name: Install inworld/nodejs-sdk | |
run: yarn add @inworld/nodejs-sdk | |
- name: Setup Allure TestOps | |
if: always() | |
uses: allure-framework/[email protected] | |
with: | |
allure-endpoint: ${{ env.ALLURE_ENDPOINT }} | |
allure-token: '${{ steps.secrets.outputs.ALLURE_TOKEN }}' | |
allure-project-id: ${{ env.ALLURE_PROJECT_ID }} | |
continue-on-error: true | |
- name: Run Tests | |
env: | |
STUDIO_INTEGRATIONS_API_KEY: '${{ steps.secrets.outputs.STUDIO_INTEGRATIONS_API_KEY }}' | |
STUDIO_INTEGRATIONS_API_SECRET: '${{ steps.secrets.outputs.STUDIO_INTEGRATIONS_API_SECRET }}' | |
run: yarn jest "${{ github.event.inputs.test_suite }}" | |
- name: Upload Allure Results | |
env: | |
ALLURE_TOKEN: '${{ steps.secrets.outputs.ALLURE_TOKEN }}' | |
if: always() | |
run: allurectl upload ${{ env.ALLURE_RESULTS }} |