2020-04-22 10:35:13 +02:00
|
|
|
name: Integration Tests
|
2020-04-08 10:33:41 +02:00
|
|
|
|
|
|
|
on:
|
2020-04-22 10:35:13 +02:00
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
- it/**
|
2020-07-23 11:43:59 +02:00
|
|
|
workflow_dispatch:
|
2020-04-08 10:33:41 +02:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
|
|
|
consumer-tests:
|
|
|
|
name: Consumer Tests
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- uses: actions/setup-java@v1
|
|
|
|
with:
|
|
|
|
java-version: '11'
|
|
|
|
- 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"
|
2020-04-22 16:41:43 +02:00
|
|
|
- name: get branch name
|
|
|
|
id: branchname
|
|
|
|
run: echo "::set-output name=branchname::$(echo ${GITHUB_REF#refs/heads/})"
|
2020-04-08 10:33:41 +02:00
|
|
|
- name: run consumer tests
|
|
|
|
run: cd consumer-test && groovy consumerTestController.groovy
|
|
|
|
env:
|
2020-04-22 10:35:13 +02:00
|
|
|
REPOSITORY_UNDER_TEST: ${{ github.repository }}
|
2020-04-22 16:41:43 +02:00
|
|
|
BRANCH_NAME: ${{ steps.branchname.outputs.branchname }}
|
2020-04-08 10:33:41 +02:00
|
|
|
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 }}
|
|
|
|
|
|
|
|
go-integration-tests:
|
|
|
|
name: Go Integration Tests
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: get commit id
|
|
|
|
id: commitId
|
|
|
|
run: echo "::set-output name=commitId::$(git log --format=%H -n 1)"
|
|
|
|
- name: update status
|
|
|
|
run: |
|
|
|
|
curl --location --request POST 'https://api.github.com/repos/SAP/jenkins-library/statuses/${{ steps.commitId.outputs.commitId }}' -H 'Content-Type: application/json' --data '{"state": "pending", "context": "Go / integration-tests", "target_url": "https://github.com/SAP/jenkins-library/actions/runs/${{ github.run_id }}"}' -H 'Authorization: token ${{secrets.INTEGRATION_TEST_VOTING_TOKEN}}'
|
|
|
|
- uses: actions/setup-go@v1
|
|
|
|
with:
|
2022-03-07 18:15:36 +02:00
|
|
|
go-version: '1.17.x'
|
2020-04-08 10:33:41 +02:00
|
|
|
- name: build
|
|
|
|
env:
|
|
|
|
CGO_ENABLED: 0
|
2021-04-22 12:55:35 +02:00
|
|
|
# with `-tags release` we ensure that shared test utilities won't end up in the binary
|
2020-04-08 10:33:41 +02:00
|
|
|
run: go build -o piper -tags release
|
|
|
|
- name: test
|
|
|
|
env:
|
|
|
|
PIPER_INTEGRATION_GITHUB_TOKEN: ${{secrets.PIPER_INTEGRATION_GITHUB_TOKEN}}
|
2021-02-24 13:58:48 +02:00
|
|
|
PIPER_INTEGRATION_SONAR_TOKEN: ${{secrets.PIPER_INTEGRATION_SONAR_TOKEN}}
|
2020-05-28 18:28:38 +02:00
|
|
|
run: go test -tags=integration -timeout 20m ./integration/...
|
2020-04-08 10:33:41 +02:00
|
|
|
- name: update status
|
|
|
|
if: success()
|
|
|
|
run: |
|
|
|
|
curl --location --request POST 'https://api.github.com/repos/SAP/jenkins-library/statuses/${{ steps.commitId.outputs.commitId }}' -H 'Content-Type: application/json' --data '{"state": "success", "context": "Go / integration-tests", "target_url": "https://github.com/SAP/jenkins-library/actions/runs/${{ github.run_id }}"}' -H 'Authorization: token ${{secrets.INTEGRATION_TEST_VOTING_TOKEN}}'
|
|
|
|
- name: update status
|
|
|
|
if: cancelled() || failure()
|
|
|
|
run: |
|
|
|
|
curl --location --request POST 'https://api.github.com/repos/SAP/jenkins-library/statuses/${{ steps.commitId.outputs.commitId }}' -H 'Content-Type: application/json' --data '{"state": "failure", "context": "Go / integration-tests", "target_url": "https://github.com/SAP/jenkins-library/actions/runs/${{ github.run_id }}"}' -H 'Authorization: token ${{secrets.INTEGRATION_TEST_VOTING_TOKEN}}'
|