Skip to content

PARI Pipeline - Workflow #14

PARI Pipeline - Workflow

PARI Pipeline - Workflow #14

Workflow file for this run

name: PARI Pipeline - Workflow
on:
workflow_dispatch:
inputs:
environment:
description: 'Environment where tests will be run'
required: true
type: string
testSuite:
description: 'Choose the test suite to run'
required: false
type: string
javaBranchName:
description: 'Provide the branch name to clone (default: develop)'
required: false
default: develop
type: string
defaults:
run:
shell: bash
permissions:
id-token: write
contents: read
jobs:
inputs:
runs-on: ubuntu-22.04
environment: ${{ inputs.environment }}
steps:
- name: Print Inputs
id: print_inputs
run: |
echo "- environment: \`${{ inputs.environment }}\`" >> $GITHUB_STEP_SUMMARY
echo "- branch name: \`${{ inputs.javaBranchName }}\`" >> $GITHUB_STEP_SUMMARY
echo "- testSuite: \`${{ inputs.testSuite }}\`" >> $GITHUB_STEP_SUMMARY
run_test:
name: Run Cucumber Test Suite
runs-on: ubuntu-22.04
environment: ${{ inputs.environment }}
env:
ENVIRONMENT: ${{ inputs.environment }}
ST_VERBOSE_MODE: ${{ vars.ST_VERBOSE_MODE }}
steps:
- name: Set up Maven
uses: s4u/setup-maven-action@6d44c18d67d9e1549907b8815efa5e4dada1801b # v1.12.0
with:
java-version: 17
maven-version: 3.9.8
- name: Clone the pn-b2b-client repo
id: clone_pn-b2b-client
uses: actions/checkout@v2
with:
ref: ${{ inputs.javaBranchName }} # Branch name to clone
fetch-depth: 1 # Clone only the last commit
- name: Run QA tests
id: run_qa_tests
shell: bash
run: |
set -uo pipefail
echo "Running tests..."
echo "ENVIRONMENT is: ${ENVIRONMENT}"
if [[ "${ENVIRONMENT}" == *dev* ]]; then
SPRING_PROFILE="-Dspring.profiles.active=dev"
else
SPRING_PROFILE="-Dspring.profiles.active=uat"
fi
echo "Using Spring profile: ${SPRING_PROFILE}"
echo "Running tests..."
cd ./pari && mvn $SPRING_PROFILE -Dtest=it.pagopa.pari.cucumber.${{ inputs.testSuite }} clean verify
- name: Upload Cucumber Report
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: cucumber-report
path: pari/target/cucumber-report.html
retention-days: 10