diff --git a/.github/actions/pending_check/action.yaml b/.github/actions/pending_check/action.yaml deleted file mode 100644 index 84c2106b6c..0000000000 --- a/.github/actions/pending_check/action.yaml +++ /dev/null @@ -1,146 +0,0 @@ -name: 'Pending-Check' -description: 'Creates a github-actions check-run for a workflow' -inputs: - pending_check: - required: true - description: Action to execute - [ create, verify ] - check_filter: - description: jq match filter for job names - required: true - default: ".*acceptance tests" - # Note: All jobs to verify need their names to to end consistently - # (ie. "XYZ acceptance tests") in order to utilise correct filtering of checks. - # use '.*' to filter all jobs in the workflow. - -runs: - using: 'composite' - steps: - - name: Creating the check - shell: bash - env: - ACT_RUN: 'if [ "${ACT}" ] && [ "${ACT_OVERRIDE:-"false"}" == "false" ]; then echo "NOTICE: step is running via ACT - skipping"; exit 0; fi;' - PR_SHA: "${{github.event.pull_request.head.sha}}" - GH_RUN_ID: "${{ github.run_id }}" - GITHUB_TOKEN: "${{ github.token }}" - GITHUB_REPOSITORY: "${{ github.repository }}" - WORKFLOW_NAME: "${{ github.workflow }}" - PENDING_CHECK: "${{ inputs.pending_check }}" - CHECK_FILTER: "${{ inputs.check_filter }}" - run: | - # Checking run under ACT with override option - eval "${ACT_RUN}" - set -euo pipefail - - checkruns_url="https://api.github.com/repos/${{ env.GITHUB_REPOSITORY }}/check-runs" - checkruns_commit_url="https://api.github.com/repos/${{ env.GITHUB_REPOSITORY }}/commits/${{ env.PR_SHA }}/check-runs" - curlopts=(-f --retry 5 -H 'Accept: application/vnd.github+json' -H 'Authorization: token ${{ env.GITHUB_TOKEN }}') - - - function main { - if [ "${PENDING_CHECK}" == "create" ]; then - check_create - elif [ "$PENDING_CHECK" == "verify" ]; then - check_verify - else - echo "ERROR: invalid action ${PENDING_CHECK} for pending check. Allowed: create or verify" - exit 1 - fi - } - - #--------------------------------------------------------------------------------------------------------------------------------------------------------------------- - function check_create { - echo '::group::Creating new check' - curl -v "${curlopts[@]}" -POST "${checkruns_url}" \ - -d ' - { - "name": "${{env.check_name}}", - "head_sha": "${{env.PR_SHA}}", - "status": "in_progress", - "external_id": "${{env.GH_RUN_ID}}", - "output": { - "title": "${{ env.WORKFLOW_NAME }} running", - "summary": "pending check for commit ${{env.PR_SHA}}", - "text": "Awaiting check result..." - } - } - ' \ - -o new_check.json - - id=$(jq -r '.id' new_check.json) - - if [ -z "${id}" ]; then - echo "ERROR: Failed to create the required check job" - echo "Result of curl:" - cat new_check.json - exit 1 - fi - echo "::endgroup::" - - echo "Id is: ${id}" - } - - #--------------------------------------------------------------------------------------------------------------------------------------------------------------------- - function check_verify { - - #------ - function send_conclusion() { - - echo "Verifying: ${checkruns_url}/${id}" - - curl -s "${curlopts[@]}" -X PATCH "${checkruns_url}/${id}" \ - -d @- << END; - { "name": "${{ env.check_name }}", "conclusion": "$1" } - END - } - #------ - - echo "::group::Getting the latest checks results" - echo "Getting the last result" - curl -s "${curlopts[@]}" "${checkruns_commit_url}" | jq '[.check_runs[] | select(.name=="${{ env.check_name }}")]' > results.json - jq '.|last' results.json > latest_result.json - - id=$( jq '.id' latest_result.json ) - number_of_checks=$(jq '. | length' results.json) - - echo "== Latest ${{env.check_name}} check result ==" - echo - cat latest_result.json - echo "::endgroup::" - - echo "::group::Check Info" - echo "Latest check id:${id}" - echo "Number of checks for commit ${{ env.PR_SHA }} ${number_of_checks}" - echo "::endgroup::" - - if [ ${number_of_checks} -eq 0 ]; then - echo "ERROR: no checks were found this commit!" - exit 1 - fi - - echo "::group::Retrieving status of jobs (checks_filter: ${{ inputs.check_filter }})" - curl "${curlopts[@]}" "${checkruns_commit_url}" \ - | jq '.check_runs[] | select(.conclusion == "failure") | select(.name? | match("${{ inputs.check_filter }}")) | " - \(.name): \(.html_url)"' > bad_jobs.txt - ls -la bad_jobs.txt - echo "::endgroup::" - - if [ -s bad_jobs.txt ]; then - echo "==========================" - echo "List of failed checks:" - cat bad_jobs.txt - echo "==========================" - - echo "::group::Sending failure conclusion to the workflow check" - send_conclusion "failure" - echo "::endgroup::" - exit 1 - else - echo "::group::Sending success conclusion to the workflow check" - send_conclusion "success" - echo "::endgroup::" - fi - } - #--------------------------------------------------------------------------------------------------------------------------------------------------------------------- - - - # ++ start ++ - main \ No newline at end of file diff --git a/.github/actions/acceptance_setup/action.yaml b/.github/actions/setup_acceptance/action.yaml similarity index 100% rename from .github/actions/acceptance_setup/action.yaml rename to .github/actions/setup_acceptance/action.yaml diff --git a/.github/actions/acceptance_setup/install_cli.sh b/.github/actions/setup_acceptance/install_cli.sh similarity index 100% rename from .github/actions/acceptance_setup/install_cli.sh rename to .github/actions/setup_acceptance/install_cli.sh diff --git a/.github/docs/workflow_architecture.svg b/.github/docs/workflow_architecture.svg deleted file mode 100644 index 7949f5dc0a..0000000000 --- a/.github/docs/workflow_architecture.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - -
accetpance_tests_broker
accetpance_tests_broker
accetpance_tests_build-in
accetpance_tests_build-in
acceptance_completion_check
renamed from "completed_run"
acceptance_completion_check...
 acceptance_test_broker
 acceptance_test_broker
timeline
timeline
 "acceptance_setup" 
renamed from acceptance_tests_common
  • setup_go
  • setup_java
  • setup_ruby
  • Cli Cache
  • Install deployments CLI
  • clone BBL repo
"acceptance_setup"...
acceptance_pending_check
acceptance_pending_check
deploy_autoscaler
deploy_autoscaler
acceptance_test_api
acceptance_test_api
acceptance_test_app
acceptance_test_app
deployment_cleanup
deployment_cleanup
report_result
report_result
job
job
action
action
no code change
no code change
workflow
workflow
Text is not SVG - cannot display
\ No newline at end of file diff --git a/.github/workflows/acceptance_tests_broker.yaml b/.github/workflows/acceptance_tests_broker.yaml new file mode 100644 index 0000000000..363898c17b --- /dev/null +++ b/.github/workflows/acceptance_tests_broker.yaml @@ -0,0 +1,95 @@ +name: Acceptance Tests (Broker) +on: + pull_request: + types: [ opened, labeled, synchronize ] +env: + MAVEN_VERSION: 3.6.3 + MAVEN_SHA: c35a1803a6e70a126e80b2b3ae33eed961f83ed74d18fcd16909b2d44d7dada3203f1ffe726c17ef8dcca2dcaa9fca676987befeadc9b9f759967a8cb77181c0 + BUILDIN_MODE: false + SERVICE_OFFERING_ENABLED: true + PR_NUMBER: "${{ github.event.pull_request.number }}" + DEPLOYMENT_NAME: "autoscaler-${{ github.event.pull_request.number }}" + SERVICE_BROKER_NAME: "autoscaler-${{ github.event.pull_request.number }}servicebroker" + SERVICE_NAME: "autoscaler-${{ github.event.pull_request.number }}" + BBL_STATE_PATH: "${{ github.workspace }}/bbl/bbl-state" + NAME_PREFIX: "autoscaler-${{ github.event.pull_request.number }}-TESTS" + GINKGO_OPTS: "--fail-fast" + NODES: 3 + AUTOSCALER_DIR: "${{ github.workspace }}/app-autoscaler-release" + CI_DIR: "${{ github.workspace }}/app-autoscaler-release/ci" + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + deploy_autoscaler: + # Determine if we require jobs for Acceptance Tests in this workflow by checking relevant events and labels. + # Verifcation job runs always. + if: | + ( ( github.event.action == 'opened' || github.event.action == 'synchronize' ) + && ( contains(github.event.pull_request.labels.*.name, 'allow-acceptance-tests') || contains(github.event.pull_request.labels.*.name, 'dependencies') ) + ) || + ( ( github.event.action == 'labeled' ) + && ( github.event.label.name == 'allow-acceptance-tests' || github.event.label.name == 'dependencies' ) + ) + name: Deploy autoscaler + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + path: app-autoscaler-release + - uses: ./app-autoscaler-release/.github/actions/setup_acceptance + with: + ssh-key: ${{ secrets.BBL_SSH_KEY }} + - name: Deploy autoscaler + run: | + cd ${{ env.AUTOSCALER_DIR }} + make deployment + + acceptance_tests: + needs: [ deploy_autoscaler ] + strategy: + matrix: + suite: [ API, APP, BROKER ] + runs-on: ubuntu-latest + name: ${{ matrix.suite }} test + steps: + - uses: actions/checkout@v3 + with: + path: app-autoscaler-release + - uses: ./app-autoscaler-release/.github/actions/setup_acceptance + with: + ssh-key: ${{ secrets.BBL_SSH_KEY }} + - name: run acceptance test - ${{ matrix.suite }} + run: | + cd ${{ env.AUTOSCALER_DIR }} + # SUITES needs to be lowercase for ginkgo + mysuite="${{matrix.suite}}" + echo make acceptance-tests SUITES="${mysuite,,}" + + acceptance_tests_verify: + needs: [ deploy_autoscaler, acceptance_tests ] + if: ${{ always() }} + name: Acceptance Tests Result (Buildin) + runs-on: ubuntu-latest + steps: + - uses: technote-space/workflow-conclusion-action@v3 + - name: Conclude workflow run + run: if [ ${WORKFLOW_CONCLUSION} != 'success' ]; then exit 1; fi + + deployment_cleanup: + needs: [ acceptance_tests ] + name: Deployment cleanup + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + path: app-autoscaler-release + - uses: ./app-autoscaler-release/.github/actions/setup_acceptance + with: + ssh-key: ${{ secrets.BBL_SSH_KEY }} + - run: | + cd ${{ env.AUTOSCALER_DIR }} + make deployment-cleanup + diff --git a/.github/workflows/disabled/acceptance_tests_broker_close.yaml b/.github/workflows/acceptance_tests_broker_close.yaml similarity index 94% rename from .github/workflows/disabled/acceptance_tests_broker_close.yaml rename to .github/workflows/acceptance_tests_broker_close.yaml index dc45d96415..a7e5531c46 100644 --- a/.github/workflows/disabled/acceptance_tests_broker_close.yaml +++ b/.github/workflows/acceptance_tests_broker_close.yaml @@ -26,7 +26,7 @@ jobs: with: path: app-autoscaler-release ref: main - - uses: ./app-autoscaler-release/.github/actions/acceptance_tests_common + - uses: ./app-autoscaler-release/.github/actions/setup_acceptance with: ssh-key: ${{ secrets.BBL_SSH_KEY }} diff --git a/.github/workflows/acceptance_tests_buildin.yaml b/.github/workflows/acceptance_tests_buildin.yaml index 006f810e76..4a58253a07 100644 --- a/.github/workflows/acceptance_tests_buildin.yaml +++ b/.github/workflows/acceptance_tests_buildin.yaml @@ -10,7 +10,6 @@ env: MAVEN_SHA: c35a1803a6e70a126e80b2b3ae33eed961f83ed74d18fcd16909b2d44d7dada3203f1ffe726c17ef8dcca2dcaa9fca676987befeadc9b9f759967a8cb77181c0 BUILDIN_MODE: true SERVICE_OFFERING_ENABLED: false - check_name: "acceptance-check-buildin" PR_NUMBER: "${{ github.event.pull_request.number }}" DEPLOYMENT_NAME: "autoscaler-${{ github.event.pull_request.number }}" SERVICE_BROKER_NAME: "autoscaler-${{ github.event.pull_request.number }}servicebroker" @@ -28,8 +27,8 @@ concurrency: jobs: deploy_autoscaler: - # Determine if we require to run Acceptance Tests jobs in this workflow by checking relevant events and labels. - # Finalisation job runs always since we use branch protection rule for acceptance tests. + # Determine if we require jobs for Acceptance Tests in this workflow by checking relevant events and labels. + # Verifcation job runs always. if: | ( ( github.event.action == 'opened' || github.event.action == 'synchronize' ) && ( contains(github.event.pull_request.labels.*.name, 'allow-acceptance-tests') || contains(github.event.pull_request.labels.*.name, 'dependencies') ) @@ -43,13 +42,11 @@ jobs: - uses: actions/checkout@v3 with: path: app-autoscaler-release - # TODO: unhashme - # - uses: ./app-autoscaler-release/.github/actions/acceptance_setup - # with: - # ssh-key: ${{ secrets.BBL_SSH_KEY }} + - uses: ./app-autoscaler-release/.github/actions/setup_acceptance + with: + ssh-key: ${{ secrets.BBL_SSH_KEY }} - name: Deploy autoscaler run: | - echo ">> WIP: exiting early"; exit 1 cd ${{ env.AUTOSCALER_DIR }} make deployment @@ -59,25 +56,22 @@ jobs: matrix: suite: [ API, APP ] runs-on: ubuntu-latest - name: ${{ matrix.suite }} + name: ${{ matrix.suite }} test steps: - uses: actions/checkout@v3 with: path: app-autoscaler-release - # TODO: unhashme - # - uses: ./app-autoscaler-release/.github/actions/acceptance_setup - # with: - # ssh-key: ${{ secrets.BBL_SSH_KEY }} + - uses: ./app-autoscaler-release/.github/actions/setup_acceptance + with: + ssh-key: ${{ secrets.BBL_SSH_KEY }} - name: run acceptance test - ${{ matrix.suite }} run: | - echo ">> WIP: exiting early"; exit 1 cd ${{ env.AUTOSCALER_DIR }} # SUITES needs to be lowercase for ginkgo mysuite="${{matrix.suite}}" echo make acceptance-tests SUITES="${mysuite,,}" acceptance_tests_verify: - # This job needs acceptance_tests as it needs to wait for tests to complete needs: [ deploy_autoscaler, acceptance_tests ] if: ${{ always() }} name: Acceptance Tests Result (Buildin) @@ -95,12 +89,10 @@ jobs: - uses: actions/checkout@v3 with: path: app-autoscaler-release - # # TODO: unhash me - # - uses: ./app-autoscaler-release/.github/actions/acceptance_setup - # with: - # ssh-key: ${{ secrets.BBL_SSH_KEY }} + - uses: ./app-autoscaler-release/.github/actions/setup_acceptance + with: + ssh-key: ${{ secrets.BBL_SSH_KEY }} - run: | - echo ">> WIP: exiting early"; exit 0 cd ${{ env.AUTOSCALER_DIR }} make deployment-cleanup diff --git a/.github/workflows/disabled/acceptance_tests_buildin_close.yaml b/.github/workflows/acceptance_tests_buildin_close.yaml similarity index 94% rename from .github/workflows/disabled/acceptance_tests_buildin_close.yaml rename to .github/workflows/acceptance_tests_buildin_close.yaml index 7d792af26e..d16f5526c7 100644 --- a/.github/workflows/disabled/acceptance_tests_buildin_close.yaml +++ b/.github/workflows/acceptance_tests_buildin_close.yaml @@ -29,7 +29,7 @@ jobs: with: path: app-autoscaler-release ref: main - - uses: ./app-autoscaler-release/.github/actions/acceptance_tests_common + - uses: ./app-autoscaler-release/.github/actions/setup_acceptance with: ssh-key: ${{ secrets.BBL_SSH_KEY }} diff --git a/.github/workflows/disabled/bosh-release-checks.yaml b/.github/workflows/bosh-release-checks.yaml similarity index 100% rename from .github/workflows/disabled/bosh-release-checks.yaml rename to .github/workflows/bosh-release-checks.yaml diff --git a/.github/workflows/disabled/bosh-templates.yaml b/.github/workflows/bosh-templates.yaml similarity index 100% rename from .github/workflows/disabled/bosh-templates.yaml rename to .github/workflows/bosh-templates.yaml diff --git a/.github/workflows/disabled/codeql-analysis.yaml b/.github/workflows/codeql-analysis.yaml similarity index 100% rename from .github/workflows/disabled/codeql-analysis.yaml rename to .github/workflows/codeql-analysis.yaml diff --git a/.github/workflows/disabled/dependabot-auto-merge.yaml b/.github/workflows/dependabot-auto-merge.yaml similarity index 100% rename from .github/workflows/disabled/dependabot-auto-merge.yaml rename to .github/workflows/dependabot-auto-merge.yaml diff --git a/.github/workflows/disabled/dependabot_update.yaml b/.github/workflows/dependabot_update.yaml similarity index 100% rename from .github/workflows/disabled/dependabot_update.yaml rename to .github/workflows/dependabot_update.yaml diff --git a/.github/workflows/disabled/acceptance_tests_broker.yaml b/.github/workflows/disabled/acceptance_tests_broker.yaml deleted file mode 100644 index 0e996eb4d7..0000000000 --- a/.github/workflows/disabled/acceptance_tests_broker.yaml +++ /dev/null @@ -1,227 +0,0 @@ -name: Acceptance Tests (Broker) -on: - pull_request: - types: [ opened, labeled, synchronize ] -env: - MAVEN_VERSION: 3.6.3 - MAVEN_SHA: c35a1803a6e70a126e80b2b3ae33eed961f83ed74d18fcd16909b2d44d7dada3203f1ffe726c17ef8dcca2dcaa9fca676987befeadc9b9f759967a8cb77181c0 - BUILDIN_MODE: false - SERVICE_OFFERING_ENABLED: true - check_name: "acceptance_test_check_broker" - PR_NUMBER: "${{ github.event.pull_request.number }}" - DEPLOYMENT_NAME: "autoscaler-${{ github.event.pull_request.number }}" - SERVICE_BROKER_NAME: "autoscaler-${{ github.event.pull_request.number }}servicebroker" - SERVICE_NAME: "autoscaler-${{ github.event.pull_request.number }}" - BBL_STATE_PATH: "${{ github.workspace }}/bbl/bbl-state" - NAME_PREFIX: "autoscaler-${{ github.event.pull_request.number }}-TESTS" - GINKGO_OPTS: "--fail-fast" - NODES: 3 - AUTOSCALER_DIR: "${{ github.workspace }}/app-autoscaler-release" - CI_DIR: "${{ github.workspace }}/app-autoscaler-release/ci" - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - start_pending_result: - # if open and synchronised events happen just check if it has the label - # or if label event and has the correct label added we might be able to just remove this - if: | - ( ( github.event.action == 'opened' || github.event.action == 'synchronize' ) - && ( contains(github.event.pull_request.labels.*.name, 'allow-acceptance-tests') || contains(github.event.pull_request.labels.*.name, 'dependencies') ) - ) || - ( ( github.event.action == 'labeled' ) - && ( github.event.label.name == 'allow-acceptance-tests' || github.event.label.name == 'dependencies' ) - ) - name: Post pending Acceptance test result - runs-on: ubuntu-latest - outputs: - check_id: ${{ steps.create_check.outputs.check_id }} - permissions: - checks: write - steps: - - run: echo "sha is ${{github.event.pull_request.head.sha}}" - - run: | - [[ "${ACT}" ]] && { echo "Run via ACT - skipping"; exit 0; } - - echo "::group::Creating new check" - - curl -vf -X POST \ - --retry 5 \ - -H "Accept: application/vnd.github+json" \ - -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ - "https://api.github.com/repos/${GITHUB_REPOSITORY}/check-runs" \ - -d '{ "name": "${{env.check_name}}","head_sha": "${{ github.event.pull_request.head.sha }}","status": "in_progress","external_id": "${{ github.run_id }}","output":{ "title":"Acceptance Test running", "summary":"acceptance tests for commit ${{ github.event.pull_request.head.sha }}","text":"Awaiting test result" }}' \ - -o new_check.json - - id=$(jq -r '.id' new_check.json) - - if [ -z "${id}" ]; then - echo "ERROR: Failed to create the required check job" - echo "Result of curl:" - cat new_check.json - exit 1 - fi - echo "::endgroup::" - - echo "Id is: ${id}" - echo "::set-output name=check_id::${id}" - id: create_check - name: Adding initial pending acceptance test result - - #Note: All the tests that can fail and should be reported in the error result need to end with "acceptance tests" to enable filtering of the checks. - deploy_autoscaler: - needs: [ start_pending_result ] - name: "Deploy for acceptance tests" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - path: app-autoscaler-release - - uses: ./app-autoscaler-release/.github/actions/acceptance_tests_common - with: - ssh-key: ${{ secrets.BBL_SSH_KEY }} - - # TODO: When removing metricserver and metricgateway merge enable-log-cache.yml into the default templates/app-autoscaler.yml manifest. - - name: deploy autoscaler - run: | - cd ${{ env.AUTOSCALER_DIR }} - make deployment - - acceptance_test_api: - needs: [ deploy_autoscaler ] - name: "API acceptance tests" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - path: app-autoscaler-release - - uses: ./app-autoscaler-release/.github/actions/acceptance_tests_common - with: - ssh-key: ${{ secrets.BBL_SSH_KEY }} - - - name: run acceptance test - api - run: | - cd ${{ env.AUTOSCALER_DIR }} - make acceptance-tests SUITES="api" - - acceptance_test_app: - needs: [ deploy_autoscaler ] - name: "APP acceptance tests" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - path: app-autoscaler-release - - uses: ./app-autoscaler-release/.github/actions/acceptance_tests_common - with: - ssh-key: ${{ secrets.BBL_SSH_KEY }} - - - name: run acceptance test - app - run: | - cd ${{ env.AUTOSCALER_DIR }} - make acceptance-tests SUITES="app" - - acceptance_test_broker: - needs: [ deploy_autoscaler ] - name: "Broker acceptance tests" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - path: app-autoscaler-release - - uses: ./app-autoscaler-release/.github/actions/acceptance_tests_common - with: - ssh-key: ${{ secrets.BBL_SSH_KEY }} - - - name: run acceptance tests - broker - run: | - cd ${{ env.AUTOSCALER_DIR }} - make acceptance-tests SUITES="broker" - - ### This is a final node to indicate the completion of all the acceptance tests - completed_run: - needs: [ start_pending_result, acceptance_test_app, acceptance_test_broker, acceptance_test_api ] - name: Posting test result - runs-on: ubuntu-latest - permissions: - checks: write - steps: - - run: | - [[ "${ACT}" ]] && { echo "Run via ACT - skipping"; exit 0; } - curl -sf -X PATCH \ - --retry 5 \ - -H "Accept: application/vnd.github+json" \ - -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ - "https://api.github.com/repos/${GITHUB_REPOSITORY}/check-runs/${{needs.start_pending_result.outputs.check_id}}" \ - -d '{ "name": "${{env.check_name}}", "status": "completed", "conclusion": "success" }' - - deployment_cleanup: - needs: [ completed_run ] - name: Cleanup deployments - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - path: app-autoscaler-release - - uses: ./app-autoscaler-release/.github/actions/acceptance_tests_common - with: - ssh-key: ${{ secrets.BBL_SSH_KEY }} - - run: | - cd ${{ env.AUTOSCALER_DIR }} - make deployment-cleanup - - report_result: - needs: [ completed_run ] - if: ${{ always() }} - name: Acceptance Tests Result (Broker) - runs-on: ubuntu-latest - permissions: - checks: read - actions: read - steps: - - name: Retrieve and assume last acceptance test result - run: | - [[ "${ACT}" ]] && { echo "Run via ACT - skipping"; exit 0; } - - echo "::group::Getting the latest acceptance test result" - set -eo pipefail - echo "Getting the last result" - curl -sf -H "Accept: application/vnd.github+json" \ - --retry 5 \ - -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ - "https://api.github.com/repos/${GITHUB_REPOSITORY}/commits/${{ github.event.pull_request.head.sha }}/check-runs" \ - | jq '[.check_runs[] | select(.name=="${{env.check_name}}")]' > results.json - jq '.|last' results.json > latest_result.json - check_suite=$( jq '.check_suite.id' latest_result.json ) - id=$( jq '.id' latest_result.json ) - conclusion=$( jq -r '.conclusion' latest_result.json ) - number_of_checks=$(jq '. | length' results.json) - echo "== Latest ${{env.check_name}} check result ==" - echo - cat latest_result.json - echo "::endgroup::" - - echo "::group::Check Info" - echo "Latest check id:${id}" - echo "Number of checks for commit ${{ github.event.pull_request.head.sha }} ${number_of_checks}" - echo "Conclustion of check: ${conclusion}" - echo "::endgroup::" - - if [ ${number_of_checks} -eq 0 ]; then - echo "Error: The Acceptance tests have never been run for this commit!" - echo "Add the correct label to enable the running of the acceptance tests." - exit 1 - fi - - if [ "${conclusion}" != "success" ]; then - echo "Error: The latest Acceptance Test run failed!" - echo - echo "List of the failed checks:" - echo "==========================" - curl -sf --retry 5 "https://api.github.com/repos/${GITHUB_REPOSITORY}/commits/${{ github.event.pull_request.head.sha }}/check-runs" \ - | jq '.check_runs[] | select(.conclusion == "failure") | select(.name? | match(".*acceptance tests")) | " - \(.name): \(.html_url)"' - echo "==========================" - exit 1 - fi diff --git a/.github/workflows/disabled/test_hard_dependency.yaml b/.github/workflows/disabled/test_hard_dependency.yaml deleted file mode 100644 index 0374f90ec0..0000000000 --- a/.github/workflows/disabled/test_hard_dependency.yaml +++ /dev/null @@ -1,32 +0,0 @@ -name: Test failing workflows early -on: - pull_request: - types: [ opened, labeled, synchronize ] - paths: - - 'src/acceptance/**' - -jobs: - job_1: - name: "Job 1" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - path: app-autoscaler-release - - name: "Let the workflow fail" - run: | - echo '::set-output name=workflow_conclusion::failure' - exit 1 - - job_2: - needs: [ job_1 ] - name: "Job 2 (dependent on Job 1)" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - path: app-autoscaler-release - - name: deploy autoscaler - run: | - echo 'I succeed always!' - exit 0 \ No newline at end of file diff --git a/.github/workflows/disabled/eslint.yaml b/.github/workflows/eslint.yaml similarity index 100% rename from .github/workflows/disabled/eslint.yaml rename to .github/workflows/eslint.yaml diff --git a/.github/workflows/disabled/generate.yaml b/.github/workflows/generate.yaml similarity index 100% rename from .github/workflows/disabled/generate.yaml rename to .github/workflows/generate.yaml diff --git a/.github/workflows/disabled/golangci-lint.yaml b/.github/workflows/golangci-lint.yaml similarity index 100% rename from .github/workflows/disabled/golangci-lint.yaml rename to .github/workflows/golangci-lint.yaml diff --git a/.github/workflows/disabled/image.yaml b/.github/workflows/image.yaml similarity index 100% rename from .github/workflows/disabled/image.yaml rename to .github/workflows/image.yaml diff --git a/.github/workflows/disabled/java-ci-lint.yaml b/.github/workflows/java-ci-lint.yaml similarity index 100% rename from .github/workflows/disabled/java-ci-lint.yaml rename to .github/workflows/java-ci-lint.yaml diff --git a/.github/workflows/disabled/manifest.yaml b/.github/workflows/manifest.yaml similarity index 100% rename from .github/workflows/disabled/manifest.yaml rename to .github/workflows/manifest.yaml diff --git a/.github/workflows/disabled/mysql.yaml b/.github/workflows/mysql.yaml similarity index 100% rename from .github/workflows/disabled/mysql.yaml rename to .github/workflows/mysql.yaml diff --git a/.github/workflows/disabled/node-vendoring.yaml b/.github/workflows/node-vendoring.yaml similarity index 100% rename from .github/workflows/disabled/node-vendoring.yaml rename to .github/workflows/node-vendoring.yaml diff --git a/.github/workflows/disabled/postgres.yaml b/.github/workflows/postgres.yaml similarity index 100% rename from .github/workflows/disabled/postgres.yaml rename to .github/workflows/postgres.yaml diff --git a/.github/workflows/disabled/rubocop.yaml b/.github/workflows/rubocop.yaml similarity index 100% rename from .github/workflows/disabled/rubocop.yaml rename to .github/workflows/rubocop.yaml diff --git a/.github/workflows/disabled/shellcheck.yaml b/.github/workflows/shellcheck.yaml similarity index 100% rename from .github/workflows/disabled/shellcheck.yaml rename to .github/workflows/shellcheck.yaml diff --git a/.github/workflows/disabled/tidy-go-mod.yaml b/.github/workflows/tidy-go-mod.yaml similarity index 100% rename from .github/workflows/disabled/tidy-go-mod.yaml rename to .github/workflows/tidy-go-mod.yaml