From 10efcda1ec765089c266806da5cc6b6668078a7c Mon Sep 17 00:00:00 2001 From: Serhii Mamontov Date: Thu, 23 May 2024 15:54:14 +0300 Subject: [PATCH 1/2] build(runner): use large GitHub runner --- .github/workflows/commands-handler.yml | 14 +++++---- .github/workflows/release.yml | 21 ++++++++------ .github/workflows/run-tests.yml | 40 +++++++++++++++----------- .github/workflows/run-validations.yml | 14 +++++---- 4 files changed, 52 insertions(+), 37 deletions(-) diff --git a/.github/workflows/commands-handler.yml b/.github/workflows/commands-handler.yml index 4e34b04c..e2262dd2 100644 --- a/.github/workflows/commands-handler.yml +++ b/.github/workflows/commands-handler.yml @@ -11,11 +11,13 @@ jobs: process: name: Process command if: github.event.issue.pull_request && endsWith(github.repository, '-private') != true - runs-on: ubuntu-latest + runs-on: + group: Default Larger Runners + labels: ubuntu-latest-m steps: - name: Check referred user id: user-check - env: + env: CLEN_BOT: ${{ secrets.CLEN_BOT }} run: echo "expected-user=${{ startsWith(github.event.comment.body, format('@{0} ', env.CLEN_BOT)) }}" >> $GITHUB_OUTPUT - name: Regular comment @@ -23,12 +25,12 @@ jobs: run: echo -e "\033[38;2;19;181;255mThis is regular commit which should be ignored.\033[0m" - name: Checkout repository if: steps.user-check.outputs.expected-user == 'true' - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: - token: ${{ secrets.GH_TOKEN }} + token: ${{ secrets.GH_TOKEN }} - name: Checkout release actions if: steps.user-check.outputs.expected-user == 'true' - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: pubnub/client-engineering-deployment-tools ref: v1 @@ -40,4 +42,4 @@ jobs: with: token: ${{ secrets.GH_TOKEN }} listener: ${{ secrets.CLEN_BOT }} - jira-api-key: ${{ secrets.JIRA_API_KEY }} \ No newline at end of file + jira-api-key: ${{ secrets.JIRA_API_KEY }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 40c35ec5..efbbeed1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,20 +2,21 @@ name: Automated product release on: pull_request: - branches: [ master ] - types: [ closed ] - + branches: [master] + types: [closed] jobs: check-release: name: Check release required - runs-on: ubuntu-latest + runs-on: + group: Default Larger Runners + labels: ubuntu-latest-m if: github.event.pull_request.merged && endsWith(github.repository, '-private') != true outputs: release: ${{ steps.check.outputs.ready }} steps: - name: Checkout actions - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: pubnub/client-engineering-deployment-tools ref: v1 @@ -28,17 +29,19 @@ jobs: token: ${{ secrets.GH_TOKEN }} publish: name: Publish package - runs-on: macos-11 + runs-on: + group: Default + labels: macos-latest needs: check-release if: needs.check-release.outputs.release == 'true' steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: # This should be the same as the one specified for on.pull_request.branches ref: master - name: Checkout release actions - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: pubnub/client-engineering-deployment-tools ref: v1 @@ -54,4 +57,4 @@ jobs: uses: ./.github/.release/actions/actions/test-reports/upload with: token: ${{ secrets.GH_TOKEN }} - acceptance-tests-workflow: Tests \ No newline at end of file + acceptance-tests-workflow: Tests diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 80a4f7cf..0345f2b8 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -7,11 +7,11 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true env: - PAM_PUBLISH_KEY: ${{ secrets.PAM_PUBLISH_KEY }} - PAM_SUBSCRIBE_KEY: ${{ secrets.PAM_SUBSCRIBE_KEY }} - PAM_SECRET_KEY: ${{ secrets.PAM_SECRET_KEY }} - PUBLISH_KEY: ${{ secrets.PUBLISH_KEY }} - SUBSCRIBE_KEY: ${{ secrets.SUBSCRIBE_KEY }} + PAM_PUBLISH_KEY: ${{ secrets.SDK_PAM_PUB_KEY }} + PAM_SUBSCRIBE_KEY: ${{ secrets.SDK_PAM_SUB_KEY }} + PAM_SECRET_KEY: ${{ secrets.SDK_PAM_SEC_KEY }} + PUBLISH_KEY: ${{ secrets.SDK_PUB_KEY }} + SUBSCRIBE_KEY: ${{ secrets.SDK_SUB_KEY }} defaults: run: shell: bash @@ -19,25 +19,27 @@ defaults: jobs: tests: name: Integration and Unit tests - runs-on: ubuntu-latest + runs-on: + group: Default Larger Runners + labels: ubuntu-latest-m strategy: fail-fast: true - matrix: + matrix: go: [1.16.15, 1.17.13, 1.18.9, 1.19.4] steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: token: ${{ secrets.GH_TOKEN }} - name: Checkout actions - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: pubnub/client-engineering-deployment-tools ref: v1 token: ${{ secrets.GH_TOKEN }} path: .github/.release/actions - name: Setup Go ${{ matrix.go }} - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: go-version: ${{ matrix.go }} cache: true @@ -48,12 +50,14 @@ jobs: uses: ./.github/.release/actions/actions/utils/fast-jobs-failure acceptance-tests: name: Acceptance tests - runs-on: ubuntu-latest + runs-on: + group: Default Larger Runners + labels: ubuntu-latest-m steps: - name: Checkout project - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Checkout mock-server action - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: pubnub/client-engineering-deployment-tools ref: v1 @@ -64,7 +68,7 @@ jobs: with: token: ${{ secrets.GH_TOKEN }} - name: Setup Go 1.19.4 - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: go-version: 1.19.4 cache: true @@ -78,7 +82,7 @@ jobs: cd tests/contract go test -path ../../sdk-specifications/features -tagsFilter "~@skip && ~@na=go && ~@beta" -format "junit:main.xml" - name: Expose acceptance tests reports - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: always() with: name: acceptance-test-reports @@ -91,8 +95,10 @@ jobs: uses: ./.github/.release/actions/actions/utils/fast-jobs-failure all-tests: name: Tests - runs-on: ubuntu-latest + runs-on: + group: Default Larger Runners + labels: ubuntu-latest-m needs: [tests, acceptance-tests] steps: - name: Tests summary - run: echo -e "\033[38;2;95;215;0m\033[1mAll tests successfully passed" \ No newline at end of file + run: echo -e "\033[38;2;95;215;0m\033[1mAll tests successfully passed" diff --git a/.github/workflows/run-validations.yml b/.github/workflows/run-validations.yml index 3ade808d..ec266b32 100644 --- a/.github/workflows/run-validations.yml +++ b/.github/workflows/run-validations.yml @@ -13,12 +13,14 @@ defaults: jobs: pubnub-yml: name: "Validate .pubnub.yml" - runs-on: ubuntu-latest + runs-on: + group: Default Larger Runners + labels: ubuntu-latest-m steps: - name: Checkout project - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Checkout validator action - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: pubnub/client-engineering-deployment-tools ref: v1 @@ -33,8 +35,10 @@ jobs: uses: ./.github/.release/actions/actions/utils/fast-jobs-failure all-validations: name: Validations - runs-on: ubuntu-latest + runs-on: + group: Default Larger Runners + labels: ubuntu-latest-m needs: [pubnub-yml] steps: - name: Validations summary - run: echo -e "\033[38;2;95;215;0m\033[1mAll validations passed" \ No newline at end of file + run: echo -e "\033[38;2;95;215;0m\033[1mAll validations passed" From 06f541b60e5cb19a86f4d775d4f0dc08926d14dc Mon Sep 17 00:00:00 2001 From: Serhii Mamontov Date: Wed, 29 May 2024 00:51:28 +0300 Subject: [PATCH 2/2] build(workflow): change runner groups --- .github/workflows/commands-handler.yml | 3 +-- .github/workflows/release.yml | 10 ++++------ .github/workflows/run-tests.yml | 11 ++++------- .github/workflows/run-validations.yml | 8 +++----- 4 files changed, 12 insertions(+), 20 deletions(-) diff --git a/.github/workflows/commands-handler.yml b/.github/workflows/commands-handler.yml index e2262dd2..48f71d24 100644 --- a/.github/workflows/commands-handler.yml +++ b/.github/workflows/commands-handler.yml @@ -12,8 +12,7 @@ jobs: name: Process command if: github.event.issue.pull_request && endsWith(github.repository, '-private') != true runs-on: - group: Default Larger Runners - labels: ubuntu-latest-m + group: Default steps: - name: Check referred user id: user-check diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index efbbeed1..d02b6f12 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,10 +8,9 @@ on: jobs: check-release: name: Check release required - runs-on: - group: Default Larger Runners - labels: ubuntu-latest-m if: github.event.pull_request.merged && endsWith(github.repository, '-private') != true + runs-on: + group: Default outputs: release: ${{ steps.check.outputs.ready }} steps: @@ -29,11 +28,10 @@ jobs: token: ${{ secrets.GH_TOKEN }} publish: name: Publish package - runs-on: - group: Default - labels: macos-latest needs: check-release if: needs.check-release.outputs.release == 'true' + runs-on: + group: macos-gh steps: - name: Checkout repository uses: actions/checkout@v4 diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 0345f2b8..3a4807e3 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -20,8 +20,7 @@ jobs: tests: name: Integration and Unit tests runs-on: - group: Default Larger Runners - labels: ubuntu-latest-m + group: Default strategy: fail-fast: true matrix: @@ -51,8 +50,7 @@ jobs: acceptance-tests: name: Acceptance tests runs-on: - group: Default Larger Runners - labels: ubuntu-latest-m + group: Default steps: - name: Checkout project uses: actions/checkout@v4 @@ -95,10 +93,9 @@ jobs: uses: ./.github/.release/actions/actions/utils/fast-jobs-failure all-tests: name: Tests - runs-on: - group: Default Larger Runners - labels: ubuntu-latest-m needs: [tests, acceptance-tests] + runs-on: + group: Default steps: - name: Tests summary run: echo -e "\033[38;2;95;215;0m\033[1mAll tests successfully passed" diff --git a/.github/workflows/run-validations.yml b/.github/workflows/run-validations.yml index ec266b32..3a8adc16 100644 --- a/.github/workflows/run-validations.yml +++ b/.github/workflows/run-validations.yml @@ -14,8 +14,7 @@ jobs: pubnub-yml: name: "Validate .pubnub.yml" runs-on: - group: Default Larger Runners - labels: ubuntu-latest-m + group: Default steps: - name: Checkout project uses: actions/checkout@v4 @@ -35,10 +34,9 @@ jobs: uses: ./.github/.release/actions/actions/utils/fast-jobs-failure all-validations: name: Validations - runs-on: - group: Default Larger Runners - labels: ubuntu-latest-m needs: [pubnub-yml] + runs-on: + group: Default steps: - name: Validations summary run: echo -e "\033[38;2;95;215;0m\033[1mAll validations passed"