diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 59a1965d9676..0385c5732fbb 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -283,6 +283,30 @@ jobs: SLACK_USERNAME: Buildbot SLACK_TITLE: "Build Success" SLACK_FOOTER: "" + # In case of self-hosted EC2 errors, remove this block. + stop-platform-build-runner: + name: "Platform: Stop Build EC2 Runner" + timeout-minutes: 10 + needs: + - start-platform-build-runner # required to get output from the start-runner job + - platform-build # required to wait when the main job is done + runs-on: ubuntu-latest + if: ${{ always() }} # required to stop the runner even if the error happened in the previous jobs + steps: + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.SELF_RUNNER_AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.SELF_RUNNER_AWS_SECRET_ACCESS_KEY }} + aws-region: us-east-2 + - name: Stop EC2 runner + uses: machulav/ec2-github-runner@v2.3.0 + with: + mode: stop + github-token: ${{ secrets.SELF_RUNNER_GITHUB_ACCESS_TOKEN }} + label: ${{ needs.start-platform-build-runner.outputs.label }} + ec2-instance-id: ${{ needs.start-platform-build-runner.outputs.ec2-instance-id }} + octavia-cli-build: runs-on: ubuntu-latest name: "Octavia CLI: Build" @@ -353,29 +377,6 @@ jobs: SLACK_USERNAME: Buildbot SLACK_TITLE: "Build Success" SLACK_FOOTER: "" - # In case of self-hosted EC2 errors, remove this block. - stop-platform-build-runner: - name: "Platform: Stop Build EC2 Runner" - timeout-minutes: 10 - needs: - - start-platform-build-runner # required to get output from the start-runner job - - platform-build # required to wait when the main job is done - runs-on: ubuntu-latest - if: ${{ always() }} # required to stop the runner even if the error happened in the previous jobs - steps: - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.SELF_RUNNER_AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.SELF_RUNNER_AWS_SECRET_ACCESS_KEY }} - aws-region: us-east-2 - - name: Stop EC2 runner - uses: machulav/ec2-github-runner@v2.3.0 - with: - mode: stop - github-token: ${{ secrets.SELF_RUNNER_GITHUB_ACCESS_TOKEN }} - label: ${{ needs.start-platform-build-runner.outputs.label }} - ec2-instance-id: ${{ needs.start-platform-build-runner.outputs.ec2-instance-id }} ## Frontend Test ## Gradle Build @@ -396,7 +397,7 @@ jobs: with: aws-access-key-id: ${{ secrets.SELF_RUNNER_AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.SELF_RUNNER_AWS_SECRET_ACCESS_KEY }} - github-token: ${{ secrets.SELF_RUNNER_GITHUB_ACCESS_TOKEN }} + github-token: ${{ secrets.SELF_RUNNER_GITHUB_ACCESS_TOKEN_1 }} frontend-test: needs: start-frontend-test-runner # required to start the main job when the runner is ready runs-on: ${{ needs.start-frontend-test-runner.outputs.label }} # run the job on the newly created runner @@ -461,7 +462,7 @@ jobs: uses: machulav/ec2-github-runner@v2.3.0 with: mode: stop - github-token: ${{ secrets.SELF_RUNNER_GITHUB_ACCESS_TOKEN }} + github-token: ${{ secrets.SELF_RUNNER_GITHUB_ACCESS_TOKEN_1 }} label: ${{ needs.start-frontend-test-runner.outputs.label }} ec2-instance-id: ${{ needs.start-frontend-test-runner.outputs.ec2-instance-id }} @@ -486,7 +487,7 @@ jobs: ec2-image-id: ami-0c1a9bc22624339d8 aws-access-key-id: ${{ secrets.SELF_RUNNER_AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.SELF_RUNNER_AWS_SECRET_ACCESS_KEY }} - github-token: ${{ secrets.SELF_RUNNER_GITHUB_ACCESS_TOKEN }} + github-token: ${{ secrets.SELF_RUNNER_GITHUB_ACCESS_TOKEN_1 }} kube-acceptance-test: # In case of self-hosted EC2 errors, removed the `needs` line and switch back to running on ubuntu-latest. needs: start-kube-acceptance-test-runner # required to start the main job when the runner is ready @@ -613,7 +614,7 @@ jobs: uses: machulav/ec2-github-runner@v2.3.0 with: mode: stop - github-token: ${{ secrets.SELF_RUNNER_GITHUB_ACCESS_TOKEN }} + github-token: ${{ secrets.SELF_RUNNER_GITHUB_ACCESS_TOKEN_1 }} label: ${{ needs.start-kube-acceptance-test-runner.outputs.label }} ec2-instance-id: ${{ needs.start-kube-acceptance-test-runner.outputs.ec2-instance-id }} @@ -638,7 +639,7 @@ jobs: ec2-image-id: ami-0c1a9bc22624339d8 aws-access-key-id: ${{ secrets.SELF_RUNNER_AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.SELF_RUNNER_AWS_SECRET_ACCESS_KEY }} - github-token: ${{ secrets.SELF_RUNNER_GITHUB_ACCESS_TOKEN }} + github-token: ${{ secrets.SELF_RUNNER_GITHUB_ACCESS_TOKEN_1 }} kube-acceptance-test-v2: # In case of self-hosted EC2 errors, removed the `needs` line and switch back to running on ubuntu-latest. needs: start-kube-acceptance-test-runner-v2 # required to start the main job when the runner is ready @@ -735,6 +736,6 @@ jobs: uses: machulav/ec2-github-runner@v2.3.0 with: mode: stop - github-token: ${{ secrets.SELF_RUNNER_GITHUB_ACCESS_TOKEN }} + github-token: ${{ secrets.SELF_RUNNER_GITHUB_ACCESS_TOKEN_1 }} label: ${{ needs.start-kube-acceptance-test-runner-v2.outputs.label }} ec2-instance-id: ${{ needs.start-kube-acceptance-test-runner-v2.outputs.ec2-instance-id }}