mirror of
https://github.com/SAP/jenkins-library.git
synced 2024-12-12 10:55:20 +02:00
9b1aebfd13
* chore(deps): update actions/setup-java action to v3 * Apply suggestions from code review --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Christopher Fenner <26137398+CCFenner@users.noreply.github.com>
73 lines
2.6 KiB
YAML
73 lines
2.6 KiB
YAML
name: Consumer tests (Pull Request)
|
|
|
|
on:
|
|
issue_comment:
|
|
types:
|
|
- created
|
|
- edited
|
|
|
|
jobs:
|
|
consumer_tests:
|
|
name: Consumer tests
|
|
if: |
|
|
(
|
|
github.event.comment.body == '/it' ||
|
|
github.event.comment.body == '/it-consumer'
|
|
) && (
|
|
github.event.comment.author_association == 'COLLABORATOR' ||
|
|
github.event.comment.author_association == 'OWNER' ||
|
|
github.event.comment.author_association == 'MEMBER'
|
|
)
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 20
|
|
steps:
|
|
- uses: styfle/cancel-workflow-action@0.10.0
|
|
- name: Get pull request URL
|
|
id: pull_request
|
|
run: |
|
|
echo "pull_request=$(curl ${{ github.event.comment.issue_url }} |
|
|
jq '.pull_request.url' |
|
|
sed 's/\"//g')" >> "$GITHUB_OUTPUT"
|
|
- name: Get repository
|
|
id: repository
|
|
run: |
|
|
echo "repository=$(curl ${{ steps.pull_request.outputs.pull_request }} |
|
|
jq '.head.repo.full_name' |
|
|
sed 's/\"//g')" >> "$GITHUB_OUTPUT"
|
|
- name: Get branch name
|
|
id: branch_name
|
|
run: |
|
|
echo "branch_name=$(curl ${{ steps.pull_request.outputs.pull_request }} |
|
|
jq '.head.ref' |
|
|
sed 's/\"//g')" >> "$GITHUB_OUTPUT"
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
repository: ${{ steps.repository.outputs.repository }}
|
|
ref: ${{ steps.branch_name.outputs.branch_name }}
|
|
- uses: actions/setup-java@v3
|
|
with:
|
|
java-version: 11
|
|
distribution: zulu
|
|
- name: Install Groovy
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install groovy -y
|
|
- name: Setup Git
|
|
run: |
|
|
git config --global user.email "piper-testing-bot@example.com"
|
|
git config --global user.name "piper-testing-bot"
|
|
- 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: |
|
|
cd ./consumer-test
|
|
groovy consumerTestController.groovy
|