2022-09-20 08:24:04 +02:00
|
|
|
name: Consumer tests (Pull Request)
|
|
|
|
|
|
|
|
on:
|
|
|
|
issue_comment:
|
|
|
|
types:
|
|
|
|
- created
|
|
|
|
- edited
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
consumer_tests:
|
|
|
|
name: Consumer tests
|
|
|
|
if: |
|
|
|
|
(
|
2022-09-20 18:29:21 +02:00
|
|
|
github.event.comment.body == '/it' ||
|
|
|
|
github.event.comment.body == '/it-consumer'
|
|
|
|
) && (
|
2022-09-20 08:24:04 +02:00
|
|
|
github.event.comment.author_association == 'COLLABORATOR' ||
|
|
|
|
github.event.comment.author_association == 'OWNER' ||
|
|
|
|
github.event.comment.author_association == 'MEMBER'
|
|
|
|
)
|
2022-09-20 18:29:21 +02:00
|
|
|
runs-on: ubuntu-latest
|
2022-09-22 19:12:13 +02:00
|
|
|
timeout-minutes: 20
|
2022-09-20 08:24:04 +02:00
|
|
|
steps:
|
2022-09-22 12:14:53 +02:00
|
|
|
- uses: styfle/cancel-workflow-action@0.10.0
|
2022-09-21 09:08:15 +02:00
|
|
|
- name: Get pull request URL
|
|
|
|
id: pull_request
|
|
|
|
run: |
|
2023-02-03 11:21:24 +02:00
|
|
|
echo "pull_request=$(curl ${{ github.event.comment.issue_url }} |
|
2022-09-21 09:08:15 +02:00
|
|
|
jq '.pull_request.url' |
|
2023-02-03 11:21:24 +02:00
|
|
|
sed 's/\"//g')" >> "$GITHUB_OUTPUT"
|
2022-09-22 12:14:53 +02:00
|
|
|
- name: Get repository
|
|
|
|
id: repository
|
|
|
|
run: |
|
2023-02-03 11:21:24 +02:00
|
|
|
echo "repository=$(curl ${{ steps.pull_request.outputs.pull_request }} |
|
2022-09-22 12:14:53 +02:00
|
|
|
jq '.head.repo.full_name' |
|
2023-02-03 11:21:24 +02:00
|
|
|
sed 's/\"//g')" >> "$GITHUB_OUTPUT"
|
2022-09-21 09:08:15 +02:00
|
|
|
- name: Get branch name
|
|
|
|
id: branch_name
|
|
|
|
run: |
|
2023-02-03 11:21:24 +02:00
|
|
|
echo "branch_name=$(curl ${{ steps.pull_request.outputs.pull_request }} |
|
2022-09-21 09:08:15 +02:00
|
|
|
jq '.head.ref' |
|
2023-02-03 11:21:24 +02:00
|
|
|
sed 's/\"//g')" >> "$GITHUB_OUTPUT"
|
2022-09-20 18:29:21 +02:00
|
|
|
- uses: actions/checkout@v3
|
2022-09-21 09:08:15 +02:00
|
|
|
with:
|
2022-09-22 12:14:53 +02:00
|
|
|
repository: ${{ steps.repository.outputs.repository }}
|
2022-09-21 09:08:15 +02:00
|
|
|
ref: ${{ steps.branch_name.outputs.branch_name }}
|
2022-09-20 08:24:04 +02:00
|
|
|
- uses: actions/setup-java@v1
|
|
|
|
with:
|
|
|
|
java-version: 11
|
|
|
|
- name: Install Groovy
|
|
|
|
run: |
|
2022-09-20 18:29:21 +02:00
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install groovy -y
|
2022-09-20 08:24:04 +02:00
|
|
|
- name: Setup Git
|
|
|
|
run: |
|
2022-09-20 18:29:21 +02:00
|
|
|
git config --global user.email "piper-testing-bot@example.com"
|
|
|
|
git config --global user.name "piper-testing-bot"
|
2022-09-20 08:24:04 +02:00
|
|
|
- name: Run tests
|
|
|
|
env:
|
|
|
|
REPOSITORY_UNDER_TEST: ${{ github.repository }}
|
|
|
|
BRANCH_NAME: ${{ github.ref_name }}
|
|
|
|
BUILD_WEB_URL: https://github.com/SAP/jenkins-library/actions/runs/${{ github.run_id }}
|
|
|
|
INTEGRATION_TEST_VOTING_TOKEN: ${{ secrets.INTEGRATION_TEST_VOTING_TOKEN }}
|
|
|
|
CX_INFRA_IT_CF_USERNAME: ${{ secrets.CX_INFRA_IT_CF_USERNAME }}
|
|
|
|
CX_INFRA_IT_CF_PASSWORD: ${{ secrets.CX_INFRA_IT_CF_PASSWORD }}
|
|
|
|
NEO_DEPLOY_USERNAME: ${{ secrets.NEO_DEPLOY_USERNAME }}
|
|
|
|
NEO_DEPLOY_PASSWORD: ${{ secrets.NEO_DEPLOY_PASSWORD }}
|
|
|
|
CX_INFRA_IT_TMS_UPLOAD: ${{ secrets.CX_INFRA_IT_TMS_UPLOAD }}
|
|
|
|
run: |
|
2022-09-20 18:29:21 +02:00
|
|
|
cd ./consumer-test
|
|
|
|
groovy consumerTestController.groovy
|