summaryrefslogtreecommitdiff
path: root/workflow_sources/test/finish.lib.yml
diff options
context:
space:
mode:
Diffstat (limited to 'workflow_sources/test/finish.lib.yml')
-rw-r--r--workflow_sources/test/finish.lib.yml83
1 files changed, 83 insertions, 0 deletions
diff --git a/workflow_sources/test/finish.lib.yml b/workflow_sources/test/finish.lib.yml
new file mode 100644
index 0000000000..3d249a7f12
--- /dev/null
+++ b/workflow_sources/test/finish.lib.yml
@@ -0,0 +1,83 @@
+#@ load("@ytt:data", "data")
+#@ load("helpers.star", "ci_image", "skip_ci_condition")
+
+#@ def gcs_path():
+#@ c = ['monorepo_github_actions_conclusions']
+#@ c.append('${{ github.sha }}')
+#@ c.append('${{ github.workflow }}')
+#@ return '/'.join(c)
+#@ end
+
+#@ def finish_jobs(prepare_jobs_names):
+package-generic-unix:
+ name: package-generic-unix
+ needs: [prepare]
+ runs-on: ubuntu-18.04
+ if: #@ skip_ci_condition()
+ #@yaml/text-templated-strings
+ steps:
+ - name: RECORD STEP START
+ id: buildevents
+ run: |
+ echo "::set-output name=step_start::$(date +%s)"
+ - uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
+ with:
+ service_account_key: ${{ secrets.GCR_JSON_KEY }}
+ export_default_credentials: true
+ - name: PACKAGE GENERIC UNIX
+ run: |
+ gcloud auth configure-docker
+ docker pull (@= ci_image() @)
+ mkdir PACKAGES && chmod 777 PACKAGES
+ docker run \
+ --env GITHUB_RUN_ID=${{ github.run_id }} \
+ --env BUILDEVENT_APIKEY=${{ secrets.HONEYCOMB_API_KEY }} \
+ --env STEP_START=${{ steps.buildevents.outputs.step_start }} \
+ --volume ${PWD}/PACKAGES:/workspace/rabbitmq/PACKAGES \
+ (@= ci_image() @) \
+ ci/scripts/package_generic_unix.sh
+ - name: UPLOAD GENERIC UNIX PACKAGE ARTIFACT
+ #! https://github.com/marketplace/actions/upload-artifact
+ uses: actions/upload-artifact@v2-preview
+ with:
+ name: rabbitmq-server-generic-unix.tar.xz
+ path: "PACKAGES/rabbitmq-server-generic-unix-*.tar.xz"
+ - name: RECORD STEP FINISH
+ if: always()
+ run: |
+ docker run \
+ --env project=packaging \
+ --env GITHUB_RUN_ID=${{ github.run_id }} \
+ --env BUILDEVENT_APIKEY=${{ secrets.HONEYCOMB_API_KEY }} \
+ --env STEP_START=${{ steps.buildevents.outputs.step_start }} \
+ (@= ci_image() @) \
+ ci/scripts/collect.sh
+finish:
+ name: finish
+ needs: #@ prepare_jobs_names + [dep.name for dep in data.values.deps if not getattr(dep, "skip_tests", False)] + ['package-generic-unix']
+ runs-on: ubuntu-18.04
+ if: #@ skip_ci_condition()
+ #@yaml/text-templated-strings
+ steps:
+ - uses: technote-space/workflow-conclusion-action@v1
+ - uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
+ with:
+ service_account_key: ${{ secrets.GCR_JSON_KEY }}
+ export_default_credentials: true
+ - name: RECORD BUILD FINISH
+ run: |
+ echo -n "${{ env.WORKFLOW_CONCLUSION }}" > conclusion
+
+ gsutil cp conclusion \
+ 'gs://(@= gcs_path() @)'
+
+ gcloud auth configure-docker
+ docker pull (@= ci_image() @)
+ docker run \
+ --env GITHUB_RUN_ID=${{ github.run_id }} \
+ --env BUILDEVENT_APIKEY=${{ secrets.HONEYCOMB_API_KEY }} \
+ --env BUILD_START=${{ needs.prepare.outputs.build_start }} \
+ --env BUILD_RESULT=${{ env.WORKFLOW_CONCLUSION }} \
+ (@= ci_image() @) \
+ ci/scripts/finish.sh
+#@ end \ No newline at end of file