From ba34c938543f085aaa45a2435dfdffd51439149a Mon Sep 17 00:00:00 2001 From: Meysam Azad Date: Sat, 7 Oct 2023 20:44:46 +0700 Subject: [PATCH 01/11] =?UTF-8?q?feat(ci):=20upload=20metrics=20to=20GitHu?= =?UTF-8?q?b=20Artifacts=20=E2=9C=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fixes rust-lang/simpleinfra#74 --- .github/workflows/ci.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8c207e7ea115c..84d39f5782211 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -159,6 +159,14 @@ jobs: AWS_ACCESS_KEY_ID: "${{ env.ARTIFACTS_AWS_ACCESS_KEY_ID }}" AWS_SECRET_ACCESS_KEY: "${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.ARTIFACTS_AWS_ACCESS_KEY_ID)] }}" if: "success() && !env.SKIP_JOB && (github.event_name == 'push' || env.DEPLOY == '1' || env.DEPLOY_ALT == '1')" + - name: upload metrics to GitHub Artifact + uses: actions/upload-artifact@v4 + with: + name: metrics + path: build/cpu-usage.csv + if-no-files-found: ignore + retention-days: 5 + if: always() && !env.SKIP_JOB auto: name: "auto - ${{ matrix.name }}" env: From 4ca0cbfce40bb3532684dccc7b464dc93ca9e984 Mon Sep 17 00:00:00 2001 From: Meysam Azad Date: Sat, 7 Oct 2023 20:50:02 +0700 Subject: [PATCH 02/11] move changes to src/ci --- .github/workflows/ci.yml | 16 ++++++++++++++++ src/ci/github-actions/ci.yml | 12 ++++++++++++ 2 files changed, 28 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 84d39f5782211..6592d0e4ff74c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -532,6 +532,14 @@ jobs: AWS_ACCESS_KEY_ID: "${{ env.ARTIFACTS_AWS_ACCESS_KEY_ID }}" AWS_SECRET_ACCESS_KEY: "${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.ARTIFACTS_AWS_ACCESS_KEY_ID)] }}" if: "success() && !env.SKIP_JOB && (github.event_name == 'push' || env.DEPLOY == '1' || env.DEPLOY_ALT == '1')" + - name: upload metrics to GitHub Artifact + uses: actions/upload-artifact@v4 + with: + name: metrics + path: build/cpu-usage.csv + if-no-files-found: ignore + retention-days: 5 + if: always() && !env.SKIP_JOB try: name: "try - ${{ matrix.name }}" env: @@ -652,6 +660,14 @@ jobs: AWS_ACCESS_KEY_ID: "${{ env.ARTIFACTS_AWS_ACCESS_KEY_ID }}" AWS_SECRET_ACCESS_KEY: "${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.ARTIFACTS_AWS_ACCESS_KEY_ID)] }}" if: "success() && !env.SKIP_JOB && (github.event_name == 'push' || env.DEPLOY == '1' || env.DEPLOY_ALT == '1')" + - name: upload metrics to GitHub Artifact + uses: actions/upload-artifact@v4 + with: + name: metrics + path: build/cpu-usage.csv + if-no-files-found: ignore + retention-days: 5 + if: always() && !env.SKIP_JOB master: name: master runs-on: ubuntu-latest diff --git a/src/ci/github-actions/ci.yml b/src/ci/github-actions/ci.yml index 93b07350ac172..efa3cb97178c1 100644 --- a/src/ci/github-actions/ci.yml +++ b/src/ci/github-actions/ci.yml @@ -249,6 +249,18 @@ x--expand-yaml-anchors--remove: if: success() && !env.SKIP_JOB && (github.event_name == 'push' || env.DEPLOY == '1' || env.DEPLOY_ALT == '1') <<: *step + - name: upload metrics to GitHub Artifact + uses: actions/upload-artifact@v4 + with: + name: metrics + path: build/cpu-usage.csv + if-no-files-found: ignore + retention-days: 5 + # Having `always` makes metric collection always happen even if the prior + # steps fail. This is useful for because the whole point of metrics is to + # help gathering information about the runtime of the CI. + if: always() && !env.SKIP_JOB + <<: *step # These snippets are used by the try-success, try-failure, auto-success and auto-failure jobs. # Check out their documentation for more information on why they're needed. From 82d8d0756af6cf57207cb07a4ef95e5102ae63af Mon Sep 17 00:00:00 2001 From: Meysam Azad Date: Sat, 7 Oct 2023 20:54:12 +0700 Subject: [PATCH 03/11] pin to v3 --- .github/workflows/ci.yml | 6 +++--- src/ci/github-actions/ci.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6592d0e4ff74c..a43d4c8a5ca30 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -160,7 +160,7 @@ jobs: AWS_SECRET_ACCESS_KEY: "${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.ARTIFACTS_AWS_ACCESS_KEY_ID)] }}" if: "success() && !env.SKIP_JOB && (github.event_name == 'push' || env.DEPLOY == '1' || env.DEPLOY_ALT == '1')" - name: upload metrics to GitHub Artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v3 with: name: metrics path: build/cpu-usage.csv @@ -533,7 +533,7 @@ jobs: AWS_SECRET_ACCESS_KEY: "${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.ARTIFACTS_AWS_ACCESS_KEY_ID)] }}" if: "success() && !env.SKIP_JOB && (github.event_name == 'push' || env.DEPLOY == '1' || env.DEPLOY_ALT == '1')" - name: upload metrics to GitHub Artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v3 with: name: metrics path: build/cpu-usage.csv @@ -661,7 +661,7 @@ jobs: AWS_SECRET_ACCESS_KEY: "${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.ARTIFACTS_AWS_ACCESS_KEY_ID)] }}" if: "success() && !env.SKIP_JOB && (github.event_name == 'push' || env.DEPLOY == '1' || env.DEPLOY_ALT == '1')" - name: upload metrics to GitHub Artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v3 with: name: metrics path: build/cpu-usage.csv diff --git a/src/ci/github-actions/ci.yml b/src/ci/github-actions/ci.yml index efa3cb97178c1..0e2b4883f4a65 100644 --- a/src/ci/github-actions/ci.yml +++ b/src/ci/github-actions/ci.yml @@ -250,7 +250,7 @@ x--expand-yaml-anchors--remove: <<: *step - name: upload metrics to GitHub Artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v3 with: name: metrics path: build/cpu-usage.csv From 6f1e219a3254254866e3af3b00038cf4c0b6a971 Mon Sep 17 00:00:00 2001 From: Meysam Azad Date: Sat, 7 Oct 2023 20:55:24 +0700 Subject: [PATCH 04/11] fix typo --- src/ci/github-actions/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ci/github-actions/ci.yml b/src/ci/github-actions/ci.yml index 0e2b4883f4a65..22f198969c7e0 100644 --- a/src/ci/github-actions/ci.yml +++ b/src/ci/github-actions/ci.yml @@ -257,7 +257,7 @@ x--expand-yaml-anchors--remove: if-no-files-found: ignore retention-days: 5 # Having `always` makes metric collection always happen even if the prior - # steps fail. This is useful for because the whole point of metrics is to + # steps fail. This is useful because the whole point of metrics is to # help gathering information about the runtime of the CI. if: always() && !env.SKIP_JOB <<: *step From 7681fea58be0d96caf768eb21e64b60a1a6f80d9 Mon Sep 17 00:00:00 2001 From: Meysam Azad Date: Sat, 7 Oct 2023 20:56:25 +0700 Subject: [PATCH 05/11] add a blank line --- src/ci/github-actions/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ci/github-actions/ci.yml b/src/ci/github-actions/ci.yml index 22f198969c7e0..cb83df9fba421 100644 --- a/src/ci/github-actions/ci.yml +++ b/src/ci/github-actions/ci.yml @@ -261,6 +261,7 @@ x--expand-yaml-anchors--remove: # help gathering information about the runtime of the CI. if: always() && !env.SKIP_JOB <<: *step + # These snippets are used by the try-success, try-failure, auto-success and auto-failure jobs. # Check out their documentation for more information on why they're needed. From 58784f8678e3b56173f37bc230d9a469801cdfd9 Mon Sep 17 00:00:00 2001 From: Meysam Azad Date: Fri, 13 Oct 2023 18:55:01 +0700 Subject: [PATCH 06/11] gather metrics and upload them all --- .github/workflows/ci.yml | 21 +++++++++++++++------ src/ci/github-actions/ci.yml | 11 +++++++++-- src/ci/scripts/gather-metrics.sh | 12 ++++++++++++ src/ci/scripts/upload-artifacts.sh | 6 +----- 4 files changed, 37 insertions(+), 13 deletions(-) create mode 100755 src/ci/scripts/gather-metrics.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a43d4c8a5ca30..56be169c208a0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -159,11 +159,14 @@ jobs: AWS_ACCESS_KEY_ID: "${{ env.ARTIFACTS_AWS_ACCESS_KEY_ID }}" AWS_SECRET_ACCESS_KEY: "${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.ARTIFACTS_AWS_ACCESS_KEY_ID)] }}" if: "success() && !env.SKIP_JOB && (github.event_name == 'push' || env.DEPLOY == '1' || env.DEPLOY_ALT == '1')" + - name: gather collected metrics + run: src/ci/scripts/gather-metrics.sh build + if: always() && !env.SKIP_JOB - name: upload metrics to GitHub Artifact uses: actions/upload-artifact@v3 with: - name: metrics - path: build/cpu-usage.csv + name: "metrics-${CI_JOB_NAME}" + path: "build/cpu-${CI_JOB_NAME}.csv\nbuild/metrics-${CI_JOB_NAME}.json\n" if-no-files-found: ignore retention-days: 5 if: always() && !env.SKIP_JOB @@ -532,11 +535,14 @@ jobs: AWS_ACCESS_KEY_ID: "${{ env.ARTIFACTS_AWS_ACCESS_KEY_ID }}" AWS_SECRET_ACCESS_KEY: "${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.ARTIFACTS_AWS_ACCESS_KEY_ID)] }}" if: "success() && !env.SKIP_JOB && (github.event_name == 'push' || env.DEPLOY == '1' || env.DEPLOY_ALT == '1')" + - name: gather collected metrics + run: src/ci/scripts/gather-metrics.sh build + if: always() && !env.SKIP_JOB - name: upload metrics to GitHub Artifact uses: actions/upload-artifact@v3 with: - name: metrics - path: build/cpu-usage.csv + name: "metrics-${CI_JOB_NAME}" + path: "build/cpu-${CI_JOB_NAME}.csv\nbuild/metrics-${CI_JOB_NAME}.json\n" if-no-files-found: ignore retention-days: 5 if: always() && !env.SKIP_JOB @@ -660,11 +666,14 @@ jobs: AWS_ACCESS_KEY_ID: "${{ env.ARTIFACTS_AWS_ACCESS_KEY_ID }}" AWS_SECRET_ACCESS_KEY: "${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.ARTIFACTS_AWS_ACCESS_KEY_ID)] }}" if: "success() && !env.SKIP_JOB && (github.event_name == 'push' || env.DEPLOY == '1' || env.DEPLOY_ALT == '1')" + - name: gather collected metrics + run: src/ci/scripts/gather-metrics.sh build + if: always() && !env.SKIP_JOB - name: upload metrics to GitHub Artifact uses: actions/upload-artifact@v3 with: - name: metrics - path: build/cpu-usage.csv + name: "metrics-${CI_JOB_NAME}" + path: "build/cpu-${CI_JOB_NAME}.csv\nbuild/metrics-${CI_JOB_NAME}.json\n" if-no-files-found: ignore retention-days: 5 if: always() && !env.SKIP_JOB diff --git a/src/ci/github-actions/ci.yml b/src/ci/github-actions/ci.yml index cb83df9fba421..37176efa9acf5 100644 --- a/src/ci/github-actions/ci.yml +++ b/src/ci/github-actions/ci.yml @@ -249,11 +249,18 @@ x--expand-yaml-anchors--remove: if: success() && !env.SKIP_JOB && (github.event_name == 'push' || env.DEPLOY == '1' || env.DEPLOY_ALT == '1') <<: *step + - name: gather collected metrics + run: src/ci/scripts/gather-metrics.sh build + if: always() && !env.SKIP_JOB + <<: *step + - name: upload metrics to GitHub Artifact uses: actions/upload-artifact@v3 with: - name: metrics - path: build/cpu-usage.csv + name: metrics-${CI_JOB_NAME} + path: | + build/cpu-${CI_JOB_NAME}.csv + build/metrics-${CI_JOB_NAME}.json if-no-files-found: ignore retention-days: 5 # Having `always` makes metric collection always happen even if the prior diff --git a/src/ci/scripts/gather-metrics.sh b/src/ci/scripts/gather-metrics.sh new file mode 100755 index 0000000000000..adacd61a8d452 --- /dev/null +++ b/src/ci/scripts/gather-metrics.sh @@ -0,0 +1,12 @@ +#!/bin/bash -eux + +# if upload_dir is not set, fetch the value from $1 +if [ -z "${upload_dir+x}" ]; then + upload_dir="$1" +fi + +# CPU usage statistics. +cp build/cpu-usage.csv "${upload_dir}/cpu-${CI_JOB_NAME}.csv" + +# Build metrics generated by x.py. +cp "${build_dir}/metrics.json" "${upload_dir}/metrics-${CI_JOB_NAME}.json" diff --git a/src/ci/scripts/upload-artifacts.sh b/src/ci/scripts/upload-artifacts.sh index 9755edb6dce58..6437f76badd6c 100755 --- a/src/ci/scripts/upload-artifacts.sh +++ b/src/ci/scripts/upload-artifacts.sh @@ -22,11 +22,7 @@ if [[ "${DEPLOY-0}" -eq "1" ]] || [[ "${DEPLOY_ALT-0}" -eq "1" ]]; then cp -r "${dist_dir}"/* "${upload_dir}" fi -# CPU usage statistics. -cp build/cpu-usage.csv "${upload_dir}/cpu-${CI_JOB_NAME}.csv" - -# Build metrics generated by x.py. -cp "${build_dir}/metrics.json" "${upload_dir}/metrics-${CI_JOB_NAME}.json" +source "$(cd "$(dirname "$0")" && pwd)/gather-metrics.sh" # Toolstate data. if [[ -n "${DEPLOY_TOOLSTATES_JSON+x}" ]]; then From f25c5ea017d4a2aaed7c587dcddcc08c93c2f515 Mon Sep 17 00:00:00 2001 From: Meysam Azad Date: Fri, 13 Oct 2023 18:57:32 +0700 Subject: [PATCH 07/11] remove redundant comment --- src/ci/scripts/gather-metrics.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/src/ci/scripts/gather-metrics.sh b/src/ci/scripts/gather-metrics.sh index adacd61a8d452..2744c4b38e447 100755 --- a/src/ci/scripts/gather-metrics.sh +++ b/src/ci/scripts/gather-metrics.sh @@ -1,6 +1,5 @@ #!/bin/bash -eux -# if upload_dir is not set, fetch the value from $1 if [ -z "${upload_dir+x}" ]; then upload_dir="$1" fi From 420bbb4c9ee8d24d58ac87a668aeaa471c9f08b8 Mon Sep 17 00:00:00 2001 From: Meysam Azad Date: Fri, 13 Oct 2023 19:09:36 +0700 Subject: [PATCH 08/11] set build-dir if not already --- src/ci/scripts/gather-metrics.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ci/scripts/gather-metrics.sh b/src/ci/scripts/gather-metrics.sh index 2744c4b38e447..f8e51e22dc212 100755 --- a/src/ci/scripts/gather-metrics.sh +++ b/src/ci/scripts/gather-metrics.sh @@ -4,6 +4,10 @@ if [ -z "${upload_dir+x}" ]; then upload_dir="$1" fi +if [ -z "${build_dir+x}" ]; then + build_dir="build" +fi + # CPU usage statistics. cp build/cpu-usage.csv "${upload_dir}/cpu-${CI_JOB_NAME}.csv" From c85d039cd7f22743c8072f3c38fccd8daf23b01f Mon Sep 17 00:00:00 2001 From: Meysam Azad Date: Fri, 13 Oct 2023 19:24:57 +0700 Subject: [PATCH 09/11] change build-dir on linux --- src/ci/scripts/gather-metrics.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/ci/scripts/gather-metrics.sh b/src/ci/scripts/gather-metrics.sh index f8e51e22dc212..7bffcb2897575 100755 --- a/src/ci/scripts/gather-metrics.sh +++ b/src/ci/scripts/gather-metrics.sh @@ -1,11 +1,18 @@ #!/bin/bash -eux if [ -z "${upload_dir+x}" ]; then - upload_dir="$1" + upload_dir="$1" fi if [ -z "${build_dir+x}" ]; then - build_dir="build" + source "$(cd "$(dirname "$0")" && pwd)/../shared.sh" + + build_dir="build" + + if isLinux; then + build_dir=obj/build + fi + fi # CPU usage statistics. From 3e309f1b918f25da40318ea854af3af48bb5de60 Mon Sep 17 00:00:00 2001 From: Meysam Azad Date: Fri, 13 Oct 2023 19:36:58 +0700 Subject: [PATCH 10/11] skip metrics if not exists --- src/ci/scripts/gather-metrics.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ci/scripts/gather-metrics.sh b/src/ci/scripts/gather-metrics.sh index 7bffcb2897575..13e4ddc983014 100755 --- a/src/ci/scripts/gather-metrics.sh +++ b/src/ci/scripts/gather-metrics.sh @@ -18,5 +18,7 @@ fi # CPU usage statistics. cp build/cpu-usage.csv "${upload_dir}/cpu-${CI_JOB_NAME}.csv" -# Build metrics generated by x.py. -cp "${build_dir}/metrics.json" "${upload_dir}/metrics-${CI_JOB_NAME}.json" +if [ -f "${build_dir}/metrics.json" ]; then + # Build metrics generated by x.py. + cp "${build_dir}/metrics.json" "${upload_dir}/metrics-${CI_JOB_NAME}.json" +fi From 605a294654b5cecd2a247e24d35e0e1fc5519a34 Mon Sep 17 00:00:00 2001 From: Meysam Azad Date: Sun, 15 Oct 2023 16:16:59 +0700 Subject: [PATCH 11/11] create two steps for two platforms --- .github/workflows/ci.yml | 42 ++++++++++++++++++++++++++++-------- src/ci/github-actions/ci.yml | 23 ++++++++++++++++---- 2 files changed, 52 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 56be169c208a0..19cef6f3912c1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -162,14 +162,22 @@ jobs: - name: gather collected metrics run: src/ci/scripts/gather-metrics.sh build if: always() && !env.SKIP_JOB - - name: upload metrics to GitHub Artifact + - name: upload metrics to GitHub Artifact for windows uses: actions/upload-artifact@v3 with: name: "metrics-${CI_JOB_NAME}" - path: "build/cpu-${CI_JOB_NAME}.csv\nbuild/metrics-${CI_JOB_NAME}.json\n" + path: "build\\cpu-${CI_JOB_NAME}.csv\nbuild\\metrics-${CI_JOB_NAME}.json\n" if-no-files-found: ignore retention-days: 5 - if: always() && !env.SKIP_JOB + if: "always() && !env.SKIP_JOB && contains(matrix.os, 'windows')" + - name: upload metrics to GitHub Artifact for linux + uses: actions/upload-artifact@v3 + with: + name: "metrics-${CI_JOB_NAME}" + path: "obj/build/cpu-${CI_JOB_NAME}.csv\nobj/build/metrics-${CI_JOB_NAME}.json\n" + if-no-files-found: ignore + retention-days: 5 + if: "always() && !env.SKIP_JOB && (contains(matrix.os, 'linux') || contains(matrix.os, 'ubuntu'))" auto: name: "auto - ${{ matrix.name }}" env: @@ -538,14 +546,22 @@ jobs: - name: gather collected metrics run: src/ci/scripts/gather-metrics.sh build if: always() && !env.SKIP_JOB - - name: upload metrics to GitHub Artifact + - name: upload metrics to GitHub Artifact for windows uses: actions/upload-artifact@v3 with: name: "metrics-${CI_JOB_NAME}" - path: "build/cpu-${CI_JOB_NAME}.csv\nbuild/metrics-${CI_JOB_NAME}.json\n" + path: "build\\cpu-${CI_JOB_NAME}.csv\nbuild\\metrics-${CI_JOB_NAME}.json\n" if-no-files-found: ignore retention-days: 5 - if: always() && !env.SKIP_JOB + if: "always() && !env.SKIP_JOB && contains(matrix.os, 'windows')" + - name: upload metrics to GitHub Artifact for linux + uses: actions/upload-artifact@v3 + with: + name: "metrics-${CI_JOB_NAME}" + path: "obj/build/cpu-${CI_JOB_NAME}.csv\nobj/build/metrics-${CI_JOB_NAME}.json\n" + if-no-files-found: ignore + retention-days: 5 + if: "always() && !env.SKIP_JOB && (contains(matrix.os, 'linux') || contains(matrix.os, 'ubuntu'))" try: name: "try - ${{ matrix.name }}" env: @@ -669,14 +685,22 @@ jobs: - name: gather collected metrics run: src/ci/scripts/gather-metrics.sh build if: always() && !env.SKIP_JOB - - name: upload metrics to GitHub Artifact + - name: upload metrics to GitHub Artifact for windows uses: actions/upload-artifact@v3 with: name: "metrics-${CI_JOB_NAME}" - path: "build/cpu-${CI_JOB_NAME}.csv\nbuild/metrics-${CI_JOB_NAME}.json\n" + path: "build\\cpu-${CI_JOB_NAME}.csv\nbuild\\metrics-${CI_JOB_NAME}.json\n" if-no-files-found: ignore retention-days: 5 - if: always() && !env.SKIP_JOB + if: "always() && !env.SKIP_JOB && contains(matrix.os, 'windows')" + - name: upload metrics to GitHub Artifact for linux + uses: actions/upload-artifact@v3 + with: + name: "metrics-${CI_JOB_NAME}" + path: "obj/build/cpu-${CI_JOB_NAME}.csv\nobj/build/metrics-${CI_JOB_NAME}.json\n" + if-no-files-found: ignore + retention-days: 5 + if: "always() && !env.SKIP_JOB && (contains(matrix.os, 'linux') || contains(matrix.os, 'ubuntu'))" master: name: master runs-on: ubuntu-latest diff --git a/src/ci/github-actions/ci.yml b/src/ci/github-actions/ci.yml index 37176efa9acf5..67571a9236272 100644 --- a/src/ci/github-actions/ci.yml +++ b/src/ci/github-actions/ci.yml @@ -254,19 +254,34 @@ x--expand-yaml-anchors--remove: if: always() && !env.SKIP_JOB <<: *step - - name: upload metrics to GitHub Artifact + - name: upload metrics to GitHub Artifact for windows uses: actions/upload-artifact@v3 with: name: metrics-${CI_JOB_NAME} path: | - build/cpu-${CI_JOB_NAME}.csv - build/metrics-${CI_JOB_NAME}.json + build\cpu-${CI_JOB_NAME}.csv + build\metrics-${CI_JOB_NAME}.json if-no-files-found: ignore retention-days: 5 # Having `always` makes metric collection always happen even if the prior # steps fail. This is useful because the whole point of metrics is to # help gathering information about the runtime of the CI. - if: always() && !env.SKIP_JOB + if: always() && !env.SKIP_JOB && contains(matrix.os, 'windows') + <<: *step + + - name: upload metrics to GitHub Artifact for linux + uses: actions/upload-artifact@v3 + with: + name: metrics-${CI_JOB_NAME} + path: | + obj/build/cpu-${CI_JOB_NAME}.csv + obj/build/metrics-${CI_JOB_NAME}.json + if-no-files-found: ignore + retention-days: 5 + # Having `always` makes metric collection always happen even if the prior + # steps fail. This is useful because the whole point of metrics is to + # help gathering information about the runtime of the CI. + if: always() && !env.SKIP_JOB && (contains(matrix.os, 'linux') || contains(matrix.os, 'ubuntu')) <<: *step # These snippets are used by the try-success, try-failure, auto-success and auto-failure jobs.