Skip to content

Commit d59f400

Browse files
committed
feat: refactor GitHub Actions workflow and add environment configuration
1 parent 6a49ce6 commit d59f400

File tree

3 files changed

+15
-37
lines changed

3 files changed

+15
-37
lines changed

.github/workflows/.env

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
WOPEE_PROJECT_URL={wopeeProjectUrl}
2+
WOPEE_PROJECT_UUID={wopeeProjectUuid}
3+
WOPEE_API_URL={wopeeApiUrl}

.github/workflows/tests.yml

Lines changed: 10 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,17 @@
11
name: Run Robot Framework tests
2-
run-name: "Run Robot Framework tests: ${{ inputs.selected-test }}"
2+
run-name: ${{ github.event.client_payload.runName }}
33

44
on:
5+
repository_dispatch:
6+
types: [run, code]
57
workflow_dispatch:
6-
inputs:
7-
selected-test:
8-
description: 'Select which tests to run'
9-
type: choice
10-
options:
11-
- test
12-
- test.selenium
13-
- test.browser
14-
- test.selenium.listener
15-
- test.browser.listener
16-
required: true
17-
default: test
188

199
jobs:
20-
test:
21-
runs-on: self-hosted
10+
test:
11+
name: ${{ github.event.action}}
12+
runs-on: self-hosted
13+
steps:
14+
- uses: Wopee-io/run-robotframework@v1
15+
env:
16+
WOPEE_API_KEY: ${{ secrets.WOPEE_API_KEY }}
2217

23-
steps:
24-
- uses: actions/checkout@v4
25-
26-
- name: Run tests
27-
env:
28-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29-
WOPEE_API_KEY: ${{ secrets.WOPEE_API_KEY }}
30-
WOPEE_API_URL: ${{ vars.WOPEE_API_URL || 'https://api.wopee.io' }}
31-
WOPEE_PROJECT_UUID: ${{ vars.WOPEE_PROJECT_UUID }}
32-
WOPEE_PROJECT_URL: ${{ vars.WOPEE_PROJECT_URL || 'https://dronjo.wopee.io' }}
33-
# WOPEE_SCREENSHOT_VALIDATION_ENABLED: "true"
34-
# WOPEE_BRANCH_NAME: master
35-
# WOPEE_CI_BUILD_ID: build-123
36-
# WOPEE_CUSTOM_TAGS: custom-tag
37-
# WOPEE_ENABLE_SOFT_ASSERT: "true"
38-
# WOPEE_PIXEL_TO_PIXEL_DIFF_TOLERANCE: "0.1"
39-
run: |
40-
python3 -m venv --system-site-packages .venv && \
41-
source .venv/bin/activate && \
42-
pip install -r requirements.txt && \
43-
[ ! -e ".env" ] && cp .env.example .env || echo ".env file already exists"
44-
make ${{ inputs.selected-test }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ venv/
139139
ENV/
140140
env.bak/
141141
venv.bak/
142+
!.github/workflows/.env
143+
!.env.example
142144

143145
# Spyder project settings
144146
.spyderproject

0 commit comments

Comments
 (0)