From e0c248160b5574c0a0a5dc6433a58e3d3b463fc0 Mon Sep 17 00:00:00 2001 From: Elias Segundo Antonio Date: Fri, 9 Sep 2022 10:52:36 -0500 Subject: [PATCH 1/4] Updating build_playground_backend workflow (#167) Co-authored-by: Elias Segundo --- .../workflows/build_playground_backend.yml | 46 +++++++++---------- 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/.github/workflows/build_playground_backend.yml b/.github/workflows/build_playground_backend.yml index 4aa0fd294931..c41137ce193d 100644 --- a/.github/workflows/build_playground_backend.yml +++ b/.github/workflows/build_playground_backend.yml @@ -17,42 +17,47 @@ name: Build And Deploy Playground Backend Application on: push: - tags: 'v*' + tags: ['v*'] branches: ['master', 'release-*'] - pull_request: + pull_request_target: paths: ['playground/backend/**'] branches: ['playground-staging'] workflow_dispatch: - -# This allows a subsequently queued workflow run to interrupt previous runs -concurrency: - group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' - cancel-in-progress: true - +permissions: read-all jobs: build_playground_backend_docker_image: name: Build Playground Backend App - runs-on: ubuntu-latest + runs-on: [self-hosted, ubuntu-20.04] env: - GO_VERSION: 1.18.0 - BEAM_VERSION: 2.40.0 + GO_VERSION: 1.17.0 + BEAM_VERSION: 2.33.0 TERRAFORM_VERSION: 1.0.9 STAND_SUFFIX: '' DATASTORE_EMULATOR_HOST: 127.0.0.1:8888 steps: - name: Check out the repo uses: actions/checkout@v3 - - uses: actions/setup-java@v3 with: - distribution: 'zulu' - java-version: '8' + ref: ${{ github.event.pull_request.head.sha }} + - name: Set up Java + uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: '8' - uses: actions/setup-go@v3 with: - go-version: '${{ env.GO_VERSION }}' + go-version: '${{ env.GO_VERSION }}' + - name: Install dependencies + run: sudo apt update && sudo apt install libsnmp-dev -y - name: Remove default github maven configuration # This step is a workaround to avoid a decryption issue run: rm ~/.m2/settings.xml - + - name: Install sbt for running SCIO tests + run: | + echo "deb https://repo.scala-sbt.org/scalasbt/debian all main" | sudo tee /etc/apt/sources.list.d/sbt.list &&\ + echo "deb https://repo.scala-sbt.org/scalasbt/debian /" | sudo tee /etc/apt/sources.list.d/sbt_old.list &&\ + curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | sudo apt-key add + sudo apt-get update && sudo apt-get install -y sbt - name: Set up Cloud SDK and its components uses: google-github-actions/setup-gcloud@v0 with: @@ -60,7 +65,7 @@ jobs: version: '389.0.0' - name: Run PreCommit - run: ./gradlew playground:backend:precommit + run: ./gradlew playground:backend:precommit - name: install npm uses: actions/setup-node@v3 with: @@ -91,10 +96,3 @@ jobs: GOOGLE_APPLICATION_CREDENTIALS: /tmp/gcp_access.json run: ./gradlew playground:terraform:deployBackend -Pdocker-tag=${{env.DOCKERTAG}} -Pproject_id=${{ secrets.GCP_PLAYGROUND_PROJECT_ID }} -Pproject_environment='beta' -Pdocker-repository-root='${{ secrets.PLAYGROUND_REGISTRY_NAME}}/${{ secrets.GCP_PLAYGROUND_PROJECT_ID }}/playground-repository' if: startsWith(github.ref, 'refs/tags/') - - name: DB Index creation - run: | - gcloud auth activate-service-account --project=${{ secrets.GCP_PLAYGROUND_PROJECT_ID }} --key-file=/tmp/gcp_access.json - gcloud app deploy playground/index.yaml --project=${{ secrets.GCP_PLAYGROUND_PROJECT_ID }} - if: startsWith(github.ref, 'refs/tags/') - env: - GOOGLE_APPLICATION_CREDENTIALS: /tmp/gcp_access.json From 680afaeebdbae90a842ccbe056d1ac19108878b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniela=20Mart=C3=ADn?= Date: Fri, 9 Sep 2022 11:03:55 -0500 Subject: [PATCH 2/4] Added master changes in build_playground_backend to avoid merge conflicts --- .github/workflows/build_playground_backend.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/build_playground_backend.yml b/.github/workflows/build_playground_backend.yml index c41137ce193d..46d97fd6bdff 100644 --- a/.github/workflows/build_playground_backend.yml +++ b/.github/workflows/build_playground_backend.yml @@ -24,6 +24,10 @@ on: branches: ['playground-staging'] workflow_dispatch: permissions: read-all +# This allows a subsequently queued workflow run to interrupt previous runs +concurrency: + group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' + cancel-in-progress: true jobs: build_playground_backend_docker_image: name: Build Playground Backend App @@ -96,3 +100,10 @@ jobs: GOOGLE_APPLICATION_CREDENTIALS: /tmp/gcp_access.json run: ./gradlew playground:terraform:deployBackend -Pdocker-tag=${{env.DOCKERTAG}} -Pproject_id=${{ secrets.GCP_PLAYGROUND_PROJECT_ID }} -Pproject_environment='beta' -Pdocker-repository-root='${{ secrets.PLAYGROUND_REGISTRY_NAME}}/${{ secrets.GCP_PLAYGROUND_PROJECT_ID }}/playground-repository' if: startsWith(github.ref, 'refs/tags/') + - name: DB Index creation + run: | + gcloud auth activate-service-account --project=${{ secrets.GCP_PLAYGROUND_PROJECT_ID }} --key-file=/tmp/gcp_access.json + gcloud app deploy playground/index.yaml --project=${{ secrets.GCP_PLAYGROUND_PROJECT_ID }} + if: startsWith(github.ref, 'refs/tags/') + env: + GOOGLE_APPLICATION_CREDENTIALS: /tmp/gcp_access.json From ad1eb44e55e4c2357c38da66a07e521076422280 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniela=20Mart=C3=ADn?= Date: Fri, 9 Sep 2022 11:07:54 -0500 Subject: [PATCH 3/4] Reverted GO_VERSION and BEAM_VERSION to have the same as master build_playground_backend --- .github/workflows/build_playground_backend.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build_playground_backend.yml b/.github/workflows/build_playground_backend.yml index 46d97fd6bdff..908f541e9901 100644 --- a/.github/workflows/build_playground_backend.yml +++ b/.github/workflows/build_playground_backend.yml @@ -28,13 +28,14 @@ permissions: read-all concurrency: group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' cancel-in-progress: true + jobs: build_playground_backend_docker_image: name: Build Playground Backend App runs-on: [self-hosted, ubuntu-20.04] env: - GO_VERSION: 1.17.0 - BEAM_VERSION: 2.33.0 + GO_VERSION: 1.18.0 + BEAM_VERSION: 2.40.0 TERRAFORM_VERSION: 1.0.9 STAND_SUFFIX: '' DATASTORE_EMULATOR_HOST: 127.0.0.1:8888 @@ -69,7 +70,7 @@ jobs: version: '389.0.0' - name: Run PreCommit - run: ./gradlew playground:backend:precommit + run: ./gradlew playground:backend:precommit - name: install npm uses: actions/setup-node@v3 with: @@ -102,8 +103,8 @@ jobs: if: startsWith(github.ref, 'refs/tags/') - name: DB Index creation run: | - gcloud auth activate-service-account --project=${{ secrets.GCP_PLAYGROUND_PROJECT_ID }} --key-file=/tmp/gcp_access.json - gcloud app deploy playground/index.yaml --project=${{ secrets.GCP_PLAYGROUND_PROJECT_ID }} + gcloud auth activate-service-account --project=${{ secrets.GCP_PLAYGROUND_PROJECT_ID }} --key-file=/tmp/gcp_access.json + gcloud app deploy playground/index.yaml --project=${{ secrets.GCP_PLAYGROUND_PROJECT_ID }} if: startsWith(github.ref, 'refs/tags/') env: GOOGLE_APPLICATION_CREDENTIALS: /tmp/gcp_access.json From 8a0bac1dd280915dbc9040c57866a578c187d98c Mon Sep 17 00:00:00 2001 From: elink22 <103056145+elink22@users.noreply.github.com> Date: Thu, 24 Nov 2022 10:45:25 -0600 Subject: [PATCH 4/4] Switching trigger to pull_request (#259) * Switching to pull_request * Removing ref from checkout --- .github/workflows/build_playground_backend.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/build_playground_backend.yml b/.github/workflows/build_playground_backend.yml index 908f541e9901..f4875f67e61e 100644 --- a/.github/workflows/build_playground_backend.yml +++ b/.github/workflows/build_playground_backend.yml @@ -19,11 +19,10 @@ on: push: tags: ['v*'] branches: ['master', 'release-*'] - pull_request_target: + pull_request: paths: ['playground/backend/**'] branches: ['playground-staging'] workflow_dispatch: -permissions: read-all # This allows a subsequently queued workflow run to interrupt previous runs concurrency: group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' @@ -42,8 +41,6 @@ jobs: steps: - name: Check out the repo uses: actions/checkout@v3 - with: - ref: ${{ github.event.pull_request.head.sha }} - name: Set up Java uses: actions/setup-java@v3 with: