Postsubmit #180
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Postsubmit | |
on: | |
schedule: | |
- cron: "0 4 * * *" # Once a day at 4am. | |
# Manual runs through Actions tab in the UI | |
workflow_dispatch: | |
permissions: | |
contents: read | |
jobs: | |
call-bazel: | |
uses: ./.github/workflows/check-bazel.yml | |
secrets: | |
ROBCO_INTEGRATION_TEST_GITHUB_ROBOT_JSON_KEY: ${{ secrets.ROBCO_INTEGRATION_TEST_GITHUB_ROBOT_JSON_KEY }} | |
# Runs .github/ci/integration_test.sh through Cloud Build. | |
# It needs to run on Cloud Build as it needs ssh access to Cloud VMs which | |
# is blocked from the outside by the GCE Enforcer. | |
integration-test: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3.1.0 | |
- name: Create service account credentials files | |
env: | |
ROBCO_INTEGRATION_TEST_GITHUB_ROBOT_JSON_KEY: ${{ secrets.ROBCO_INTEGRATION_TEST_GITHUB_ROBOT_JSON_KEY }} | |
run: | | |
echo "$ROBCO_INTEGRATION_TEST_GITHUB_ROBOT_JSON_KEY" > robco_integration_test_credentials.json | |
echo "$ROBCO_INTEGRATION_TEST_GITHUB_ROBOT_JSON_KEY" > robco_integration_test_credentials.json | |
- name: Run integration_test.sh on Cloud Build | |
env: | |
MANUAL_RUN: "${{ github.event_name == 'workflow_dispatch' }}" | |
run: | | |
gcloud auth activate-service-account --key-file robco_integration_test_credentials.json | |
gcloud builds submit \ | |
--project robco-integration-test \ | |
--region europe-west1 \ | |
--config .github/ci/integration_test_cloudbuild.yaml \ | |
--substitutions _GITHUB_SHA=${GITHUB_SHA},_MANUAL_RUN=${MANUAL_RUN} |