2020-08-05 00:46:11 -07:00
|
|
|
on:
|
2020-08-04 12:55:24 -07:00
|
|
|
repository_dispatch:
|
|
|
|
types: [funcbench_start]
|
2020-05-07 01:08:21 -07:00
|
|
|
name: Funcbench Workflow
|
|
|
|
jobs:
|
|
|
|
run_funcbench:
|
|
|
|
name: Running funcbench
|
|
|
|
if: github.event.action == 'funcbench_start'
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
|
|
AUTH_FILE: ${{ secrets.TEST_INFRA_GKE_AUTH }}
|
|
|
|
BRANCH: ${{ github.event.client_payload.BRANCH }}
|
|
|
|
BENCH_FUNC_REGEX: ${{ github.event.client_payload.BENCH_FUNC_REGEX }}
|
2020-08-05 00:46:11 -07:00
|
|
|
PACKAGE_PATH: ${{ github.event.client_payload.PACKAGE_PATH }}
|
2020-05-07 01:08:21 -07:00
|
|
|
GITHUB_TOKEN: ${{ secrets.PROMBOT_TOKEN }}
|
|
|
|
GITHUB_ORG: prometheus
|
|
|
|
GITHUB_REPO: prometheus
|
|
|
|
GITHUB_STATUS_TARGET_URL: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}
|
|
|
|
LAST_COMMIT_SHA: ${{ github.event.client_payload.LAST_COMMIT_SHA }}
|
|
|
|
PROJECT_ID: macro-mile-203600
|
|
|
|
PR_NUMBER: ${{ github.event.client_payload.PR_NUMBER }}
|
|
|
|
ZONE: europe-west3-a
|
|
|
|
steps:
|
|
|
|
- name: Update status to pending
|
|
|
|
run: >-
|
|
|
|
curl -i -X POST
|
|
|
|
-H "Authorization: Bearer $GITHUB_TOKEN"
|
|
|
|
-H "Content-Type: application/json"
|
|
|
|
--data '{"state":"pending","context":"funcbench-status","target_url":"'$GITHUB_STATUS_TARGET_URL'"}'
|
|
|
|
"https://api.github.com/repos/$GITHUB_REPOSITORY/statuses/$LAST_COMMIT_SHA"
|
|
|
|
- name: Prepare nodepool
|
2020-05-24 02:24:18 -07:00
|
|
|
uses: docker://prominfra/funcbench:master
|
2020-05-07 01:08:21 -07:00
|
|
|
with:
|
2020-05-24 02:24:18 -07:00
|
|
|
entrypoint: 'docker_entrypoint'
|
|
|
|
args: make deploy
|
2020-05-07 01:08:21 -07:00
|
|
|
- name: Delete all resources
|
|
|
|
if: always()
|
2020-05-24 02:24:18 -07:00
|
|
|
uses: docker://prominfra/funcbench:master
|
2020-05-07 01:08:21 -07:00
|
|
|
with:
|
2020-05-24 02:24:18 -07:00
|
|
|
entrypoint: 'docker_entrypoint'
|
|
|
|
args: make clean
|
2020-05-07 01:08:21 -07:00
|
|
|
- name: Update status to failure
|
|
|
|
if: failure()
|
|
|
|
run: >-
|
|
|
|
curl -i -X POST
|
|
|
|
-H "Authorization: Bearer $GITHUB_TOKEN"
|
|
|
|
-H "Content-Type: application/json"
|
|
|
|
--data '{"state":"failure","context":"funcbench-status","target_url":"'$GITHUB_STATUS_TARGET_URL'"}'
|
|
|
|
"https://api.github.com/repos/$GITHUB_REPOSITORY/statuses/$LAST_COMMIT_SHA"
|
|
|
|
- name: Update status to success
|
|
|
|
if: success()
|
|
|
|
run: >-
|
|
|
|
curl -i -X POST
|
|
|
|
-H "Authorization: Bearer $GITHUB_TOKEN"
|
|
|
|
-H "Content-Type: application/json"
|
|
|
|
--data '{"state":"success","context":"funcbench-status","target_url":"'$GITHUB_STATUS_TARGET_URL'"}'
|
|
|
|
"https://api.github.com/repos/$GITHUB_REPOSITORY/statuses/$LAST_COMMIT_SHA"
|