Skip to content

Commit

Permalink
Create run-api-test.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
cozyloon authored Sep 6, 2023
1 parent 43141ea commit 6b9f9ba
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/run-api-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: run api automated tests

on:
pull_request:
branches: [ main ]
workflow_dispatch:
inputs:
test-tags-to-include:
description: 'smoke or regression'
required: false
default: 'regression'
type: choice
options:
- 'smoke'
- 'regression'
environment:
description: 'qa or dev'
required: false
default: 'qa'
type: choice
options:
- 'qa'
- 'dev'

jobs:
api-tests:
runs-on: ubuntu-latest
timeout-minutes: 15

steps:
- name: checkout
uses: actions/checkout@v3

- name: Set up JDK 11
timeout-minutes: 30
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: maven

- name: execute-api-tests-workflow-dispatch
if: ${{ github.event_name == 'workflow_dispatch' }}
run: |
mvn clean test -Dsuite=testng.xml -Dgroups="${{ inputs.test-tags-to-include }}" -Denvironment=${{ inputs.environment }}
- name: execute-api-tests-pull-request
if: ${{ github.event_name == 'pull_request' }}
run: |
mvn clean test -Dsuite=testng.xml -Dgroups=regression -Denvironment=qa
- uses: vimtor/action-zip@v1
timeout-minutes: 30
if: always()
with:
files: ./target/allure-results/
dest: ./allure-results.zip

- uses: actions/upload-artifact@v3
timeout-minutes: 30
if: always()
with:
name: allure-results
path: ./allure-results.zip

0 comments on commit 6b9f9ba

Please sign in to comment.