From bf67190a8adf1630b05507df2ba407e57cb0036c Mon Sep 17 00:00:00 2001 From: Bas van Dijk Date: Tue, 25 Jun 2024 20:30:16 +0000 Subject: [PATCH 1/4] chore(IDX): have the Release Testing workflow as a template (DRY) --- .github/workflows-source/release-testing.yml | 98 ++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 .github/workflows-source/release-testing.yml diff --git a/.github/workflows-source/release-testing.yml b/.github/workflows-source/release-testing.yml new file mode 100644 index 00000000000..7b3be264290 --- /dev/null +++ b/.github/workflows-source/release-testing.yml @@ -0,0 +1,98 @@ +name: Release Testing + +on: + push: + branches: + - 'hotfix-*-rc--*' + - 'rc--*' + workflow_dispatch: + pull_request: + paths: + - '.github/workflows/release-testing.yml' + +env: + CI_COMMIT_SHA: ${{ github.sha }} + CI_COMMIT_REF_PROTECTED: ${{ github.ref_protected }} + CI_JOB_NAME: ${{ github.job }} + CI_JOB_ID: ${{ github.job }} # github does not expose this variable https://github.com/orgs/community/discussions/8945 + CI_JOB_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" + CI_PIPELINE_SOURCE: ${{ github.event_name }} + CI_PROJECT_DIR: ${{ github.workspace }} + CI_MERGE_REQUEST_TARGET_BRANCH_NAME: ${{ github.event.pull_request.base.ref }} + ROOT_PIPELINE_ID: ${{ github.run_id }} + BAZEL_STARTUP_ARGS: "--output_base=/var/tmp/bazel-output/" + RUSTFLAGS: "--remap-path-prefix=${CI_PROJECT_DIR}=/ic" + AWS_SHARED_CREDENTIALS_CONTENT: ${{ secrets.AWS_SHARED_CREDENTIALS_FILE }} + DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }} + DOCKER_HUB_PASSWORD_RO: ${{ secrets.DOCKER_HUB_PASSWORD_RO }} + BUILDEVENT_APIKEY: ${{ secrets.HONEYCOMB_API_TOKEN }} + BUILDEVENT_DATASET: "github-ci-dfinity" + +anchors: + image: &image + image: ghcr.io/dfinity/ic-build@sha256:5bd0f059ad6e21966e9c644516b6ecd52d5ed44f1b18a76b91b59740a9d639a2 + dind-large-setup: &dind-large-setup + runs-on: + group: dind-large + container: + <<: *image + timeout-minutes: 180 # 3 hours + if: ${{ vars.RUN_CI == 'true' }} + checkout: &checkout + name: Checkout + uses: actions/checkout@v4 + before-script: &before-script + name: Before script + id: before-script + shell: bash + run: ./gitlab-ci/src/ci-scripts/before-script.sh + +jobs: + bazel-system-test-nightly: + name: Bazel System Test Nightly + <<: *dind-large-setup + steps: + - <<: *checkout + - <<: *before-script + - name: Run Bazel System Test Nightly + id: bazel-test-all + uses: ./.github/actions/bazel-test-all/ + with: + BAZEL_COMMAND: "test" + BAZEL_TARGETS: "//..." + BAZEL_CI_CONFIG: "--config=ci --repository_cache=/cache/bazel" + BAZEL_EXTRA_ARGS: "--keep_going --test_tag_filters=system_test_nightly --deleted_packages=gitlab-ci/src/gitlab_config" + HONEYCOMB_API_TOKEN: ${{ secrets.HONEYCOMB_API_TOKEN }} + + bazel-system-test-staging: + name: Bazel System Test Staging + continue-on-error: True + <<: *dind-large-setup + steps: + - <<: *checkout + - <<: *before-script + - name: Run Bazel System Test Staging + id: bazel-test-all + uses: ./.github/actions/bazel-test-all/ + with: + BAZEL_COMMAND: "test" + BAZEL_TARGETS: "//..." + BAZEL_CI_CONFIG: "--config=ci --repository_cache=/cache/bazel" + BAZEL_EXTRA_ARGS: "--keep_going --test_tag_filters=system_test_staging --deleted_packages=gitlab-ci/src/gitlab_config" + HONEYCOMB_API_TOKEN: ${{ secrets.HONEYCOMB_API_TOKEN }} + + bazel-system-test-hotfix: + name: Bazel Test All + <<: *dind-large-setup + timeout-minutes: 90 + steps: + - <<: *checkout + - <<: *before-script + - name: Run Bazel Test All + id: bazel-test-all + uses: ./.github/actions/bazel-test-all/ + with: + BAZEL_COMMAND: "test" + BAZEL_CI_CONFIG: "--config=ci --repository_cache=/cache/bazel" + BAZEL_EXTRA_ARGS_RULES: "--test_tag_filters=system_test_hotfix --deleted_packages=gitlab-ci/src/gitlab_config" + HONEYCOMB_API_TOKEN: ${{ secrets.HONEYCOMB_API_TOKEN }} From 0bd49987a3c4a37e23dfd4168a49123238fdaf6c Mon Sep 17 00:00:00 2001 From: IDX GitHub Automation Date: Tue, 25 Jun 2024 20:31:38 +0000 Subject: [PATCH 2/4] IDX GitHub Automation --- .github/workflows/release-testing.yml | 39 +++++++++++---------------- 1 file changed, 15 insertions(+), 24 deletions(-) diff --git a/.github/workflows/release-testing.yml b/.github/workflows/release-testing.yml index 8daf06228dd..5657d4da6e6 100644 --- a/.github/workflows/release-testing.yml +++ b/.github/workflows/release-testing.yml @@ -1,15 +1,14 @@ name: Release Testing - on: push: branches: - 'hotfix-*-rc--*' - 'rc--*' workflow_dispatch: - + pull_request: + paths: + - '.github/workflows/release-testing.yml' env: - AWS_SHARED_CREDENTIALS_CONTENT: ${{ secrets.AWS_SHARED_CREDENTIALS_FILE }} - BAZEL_STARTUP_ARGS: "--output_base=/var/tmp/bazel-output/" CI_COMMIT_SHA: ${{ github.sha }} CI_COMMIT_REF_PROTECTED: ${{ github.ref_protected }} CI_JOB_NAME: ${{ github.job }} @@ -19,13 +18,13 @@ env: CI_PROJECT_DIR: ${{ github.workspace }} CI_MERGE_REQUEST_TARGET_BRANCH_NAME: ${{ github.event.pull_request.base.ref }} ROOT_PIPELINE_ID: ${{ github.run_id }} - BUILDEVENT_APIKEY: ${{ secrets.HONEYCOMB_API_TOKEN }} - BUILDEVENT_DATASET: "github-ci-dfinity" + BAZEL_STARTUP_ARGS: "--output_base=/var/tmp/bazel-output/" + RUSTFLAGS: "--remap-path-prefix=${CI_PROJECT_DIR}=/ic" + AWS_SHARED_CREDENTIALS_CONTENT: ${{ secrets.AWS_SHARED_CREDENTIALS_FILE }} DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }} DOCKER_HUB_PASSWORD_RO: ${{ secrets.DOCKER_HUB_PASSWORD_RO }} - -# TODO: DRY ~ put under wokflow-source - + BUILDEVENT_APIKEY: ${{ secrets.HONEYCOMB_API_TOKEN }} + BUILDEVENT_DATASET: "github-ci-dfinity" jobs: bazel-system-test-nightly: name: Bazel System Test Nightly @@ -38,22 +37,19 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Before script id: before-script shell: bash run: ./gitlab-ci/src/ci-scripts/before-script.sh - - name: Run Bazel System Test Nightly id: bazel-test-all uses: ./.github/actions/bazel-test-all/ with: BAZEL_COMMAND: "test" - BAZEL_TARGETS: "//... --deleted_packages=gitlab-ci/src/gitlab_config" + BAZEL_TARGETS: "//..." BAZEL_CI_CONFIG: "--config=ci --repository_cache=/cache/bazel" - BAZEL_EXTRA_ARGS: "--keep_going --test_tag_filters=system_test_nightly" + BAZEL_EXTRA_ARGS: "--keep_going --test_tag_filters=system_test_nightly --deleted_packages=gitlab-ci/src/gitlab_config" HONEYCOMB_API_TOKEN: ${{ secrets.HONEYCOMB_API_TOKEN }} - bazel-system-test-staging: name: Bazel System Test Staging continue-on-error: True @@ -64,38 +60,32 @@ jobs: timeout-minutes: 180 # 3 hours if: ${{ vars.RUN_CI == 'true' }} steps: - - name: Checkout uses: actions/checkout@v4 - - name: Before script id: before-script shell: bash run: ./gitlab-ci/src/ci-scripts/before-script.sh - - name: Run Bazel System Test Staging id: bazel-test-all uses: ./.github/actions/bazel-test-all/ with: BAZEL_COMMAND: "test" - BAZEL_TARGETS: "//... --deleted_packages=gitlab-ci/src/gitlab_config" + BAZEL_TARGETS: "//..." BAZEL_CI_CONFIG: "--config=ci --repository_cache=/cache/bazel" - BAZEL_EXTRA_ARGS: "--keep_going --test_tag_filters=system_test_staging" + BAZEL_EXTRA_ARGS: "--keep_going --test_tag_filters=system_test_staging --deleted_packages=gitlab-ci/src/gitlab_config" HONEYCOMB_API_TOKEN: ${{ secrets.HONEYCOMB_API_TOKEN }} - bazel-system-test-hotfix: name: Bazel Test All runs-on: group: dind-large container: image: ghcr.io/dfinity/ic-build@sha256:5bd0f059ad6e21966e9c644516b6ecd52d5ed44f1b18a76b91b59740a9d639a2 - timeout-minutes: 90 if: ${{ vars.RUN_CI == 'true' }} + timeout-minutes: 90 steps: - name: Checkout uses: actions/checkout@v4 - with: - fetch-depth: ${{ github.event_name == 'pull_request' && 256 || 0 }} - name: Before script id: before-script shell: bash @@ -106,4 +96,5 @@ jobs: with: BAZEL_COMMAND: "test" BAZEL_CI_CONFIG: "--config=ci --repository_cache=/cache/bazel" - BAZEL_EXTRA_ARGS_RULES: "--test_tag_filters=system_test_hotfix" + BAZEL_EXTRA_ARGS_RULES: "--test_tag_filters=system_test_hotfix --deleted_packages=gitlab-ci/src/gitlab_config" + HONEYCOMB_API_TOKEN: ${{ secrets.HONEYCOMB_API_TOKEN }} From f44649f8645824bc9aac12b47af7f359e3486a3d Mon Sep 17 00:00:00 2001 From: Bas van Dijk Date: Tue, 25 Jun 2024 20:43:11 +0000 Subject: [PATCH 3/4] Limit bazel targets to //rs/tests/... since that's where system-tests live --- .github/workflows-source/release-testing.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows-source/release-testing.yml b/.github/workflows-source/release-testing.yml index 7b3be264290..451c738de77 100644 --- a/.github/workflows-source/release-testing.yml +++ b/.github/workflows-source/release-testing.yml @@ -59,7 +59,7 @@ jobs: uses: ./.github/actions/bazel-test-all/ with: BAZEL_COMMAND: "test" - BAZEL_TARGETS: "//..." + BAZEL_TARGETS: "//rs/tests/..." BAZEL_CI_CONFIG: "--config=ci --repository_cache=/cache/bazel" BAZEL_EXTRA_ARGS: "--keep_going --test_tag_filters=system_test_nightly --deleted_packages=gitlab-ci/src/gitlab_config" HONEYCOMB_API_TOKEN: ${{ secrets.HONEYCOMB_API_TOKEN }} @@ -76,7 +76,7 @@ jobs: uses: ./.github/actions/bazel-test-all/ with: BAZEL_COMMAND: "test" - BAZEL_TARGETS: "//..." + BAZEL_TARGETS: "//rs/tests/..." BAZEL_CI_CONFIG: "--config=ci --repository_cache=/cache/bazel" BAZEL_EXTRA_ARGS: "--keep_going --test_tag_filters=system_test_staging --deleted_packages=gitlab-ci/src/gitlab_config" HONEYCOMB_API_TOKEN: ${{ secrets.HONEYCOMB_API_TOKEN }} @@ -93,6 +93,7 @@ jobs: uses: ./.github/actions/bazel-test-all/ with: BAZEL_COMMAND: "test" + BAZEL_TARGETS: "//rs/tests/..." BAZEL_CI_CONFIG: "--config=ci --repository_cache=/cache/bazel" BAZEL_EXTRA_ARGS_RULES: "--test_tag_filters=system_test_hotfix --deleted_packages=gitlab-ci/src/gitlab_config" HONEYCOMB_API_TOKEN: ${{ secrets.HONEYCOMB_API_TOKEN }} From 64f9025481fd2c2e85ae3f90b902d9e5e74429b5 Mon Sep 17 00:00:00 2001 From: IDX GitHub Automation Date: Tue, 25 Jun 2024 20:44:51 +0000 Subject: [PATCH 4/4] IDX GitHub Automation --- .github/workflows/release-testing.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-testing.yml b/.github/workflows/release-testing.yml index 5657d4da6e6..f1db7481bbc 100644 --- a/.github/workflows/release-testing.yml +++ b/.github/workflows/release-testing.yml @@ -46,7 +46,7 @@ jobs: uses: ./.github/actions/bazel-test-all/ with: BAZEL_COMMAND: "test" - BAZEL_TARGETS: "//..." + BAZEL_TARGETS: "//rs/tests/..." BAZEL_CI_CONFIG: "--config=ci --repository_cache=/cache/bazel" BAZEL_EXTRA_ARGS: "--keep_going --test_tag_filters=system_test_nightly --deleted_packages=gitlab-ci/src/gitlab_config" HONEYCOMB_API_TOKEN: ${{ secrets.HONEYCOMB_API_TOKEN }} @@ -71,7 +71,7 @@ jobs: uses: ./.github/actions/bazel-test-all/ with: BAZEL_COMMAND: "test" - BAZEL_TARGETS: "//..." + BAZEL_TARGETS: "//rs/tests/..." BAZEL_CI_CONFIG: "--config=ci --repository_cache=/cache/bazel" BAZEL_EXTRA_ARGS: "--keep_going --test_tag_filters=system_test_staging --deleted_packages=gitlab-ci/src/gitlab_config" HONEYCOMB_API_TOKEN: ${{ secrets.HONEYCOMB_API_TOKEN }} @@ -95,6 +95,7 @@ jobs: uses: ./.github/actions/bazel-test-all/ with: BAZEL_COMMAND: "test" + BAZEL_TARGETS: "//rs/tests/..." BAZEL_CI_CONFIG: "--config=ci --repository_cache=/cache/bazel" BAZEL_EXTRA_ARGS_RULES: "--test_tag_filters=system_test_hotfix --deleted_packages=gitlab-ci/src/gitlab_config" HONEYCOMB_API_TOKEN: ${{ secrets.HONEYCOMB_API_TOKEN }}