From 6951dae34bde9517ea3f3c50c107db8f8e7d9bc5 Mon Sep 17 00:00:00 2001 From: chahatsagarmain Date: Sun, 12 Jan 2025 04:07:37 +0530 Subject: [PATCH 01/14] added workflow to check bundle size Signed-off-by: chahatsagarmain --- .github/workflows/ci-check-bundle-size.yml | 107 +++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 .github/workflows/ci-check-bundle-size.yml diff --git a/.github/workflows/ci-check-bundle-size.yml b/.github/workflows/ci-check-bundle-size.yml new file mode 100644 index 00000000000..05764e392a5 --- /dev/null +++ b/.github/workflows/ci-check-bundle-size.yml @@ -0,0 +1,107 @@ +name: Check Binaries bundle size + +on: + push: + branches: [main] + + pull_request: + branches: [main] + +concurrency: + group: ${{ github.workflow }}-${{ (github.event.pull_request && github.event.pull_request.number) || github.ref || github.run_id }} + cancel-in-progress: true + +# See https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions +permissions: + contents: read + +jobs: + generate-matrix: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + - name: define matrix + id: set-matrix + run: | + echo "matrix=$(bash scripts/utils/platforms-to-gh-matrix.sh)" >> $GITHUB_OUTPUT + + build-binaries: + needs: generate-matrix + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: ${{fromJson(needs.generate-matrix.outputs.matrix)}} + name: build-binaries-${{ matrix.os }}-${{ matrix.arch }} + steps: + - uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 + with: + egress-policy: audit + + - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + with: + submodules: true + + - name: Fetch git tags + run: | + git fetch --prune --unshallow --tags + + - uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0 + with: + go-version: 1.23.x + + - name: Setup Node.js version + uses: ./.github/actions/setup-node.js + + - name: Install tools + run: make install-ci + + - name: Build platform binaries + run: make build-binaries-${{ matrix.os }}-${{ matrix.arch }} + + - name: Calculate bundle size + run: | + TOTAL_SIZE=$(du -sb ./cmd/jaeger/jaeger-${{ matrix.os }}-${{ matrix.arch }} | cut -f1) + echo "$TOTAL_SIZE" > ./new_bundle_size.txt + echo "Total bundle size: $TOTAL_SIZE bytes" + + - name: Restore previous bundle size + id: cache-bundle-size + uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 #v4.2.0 + with: + path: ./bundle_size.txt + key: bundle-size-jaeger-${{ matrix.os }}-${{ matrix.arch }} + + - name: Compare bundle sizes + run: | + if [ -f ./bundle_size.txt ]; then + OLD_BUNDLE_SIZE=$(cat ./bundle_size.txt) + NEW_BUNDLE_SIZE=$(cat ./new_bundle_size.txt) + echo "Previous bundle size: $OLD_BUNDLE_SIZE bytes" + echo "New bundle size: $NEW_BUNDLE_SIZE bytes" + + SIZE_CHANGE=$(( $NEW_BUNDLE_SIZE - $OLD_BUNDLE_SIZE )) + PERCENTAGE_CHANGE=$(( SIZE_CHANGE * 100 / $OLD_BUNDLE_SIZE )) + echo "Size change: $PERCENTAGE_CHANGE%" + if [ $PERCENTAGE_CHANGE -gt 2 ]; then + echo "❌ Bundle size increased by more than 2% ($PERCENTAGE_CHANGE%)" + exit 1 + else + echo "✅ Bundle size change is within acceptable range ($PERCENTAGE_CHANGE%)" + fi + else + echo "No previous bundle size found. This will be the baseline." + fi + + - name: Remove previous *_bundle_*.txt + run: | + rm -rf ./bundle_size.txt + mv ./new_bundle_size.txt ./bundle_size.txt + + - name: Save new bundle size + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 #v4.2.0 + with: + path: ./bundle_size.txt + key: bundle-size-jaeger-${{ matrix.os }}-${{ matrix.arch }} From bc8c00661f6f211cb5d0176ab5cba07f94c8a6bb Mon Sep 17 00:00:00 2001 From: chahatsagarmain Date: Sun, 12 Jan 2025 18:36:02 +0530 Subject: [PATCH 02/14] use only one binary Signed-off-by: chahatsagarmain --- .github/workflows/ci-check-bundle-size.yml | 29 ++++++---------------- 1 file changed, 8 insertions(+), 21 deletions(-) diff --git a/.github/workflows/ci-check-bundle-size.yml b/.github/workflows/ci-check-bundle-size.yml index 05764e392a5..997d771bb84 100644 --- a/.github/workflows/ci-check-bundle-size.yml +++ b/.github/workflows/ci-check-bundle-size.yml @@ -16,24 +16,8 @@ permissions: contents: read jobs: - generate-matrix: + build-and-check: runs-on: ubuntu-latest - outputs: - matrix: ${{ steps.set-matrix.outputs.matrix }} - steps: - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - - name: define matrix - id: set-matrix - run: | - echo "matrix=$(bash scripts/utils/platforms-to-gh-matrix.sh)" >> $GITHUB_OUTPUT - - build-binaries: - needs: generate-matrix - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: ${{fromJson(needs.generate-matrix.outputs.matrix)}} - name: build-binaries-${{ matrix.os }}-${{ matrix.arch }} steps: - uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 with: @@ -57,12 +41,15 @@ jobs: - name: Install tools run: make install-ci - - name: Build platform binaries - run: make build-binaries-${{ matrix.os }}-${{ matrix.arch }} + - name: Build jaeger binary + run: / + export GOOS=linux + export GOARCH=amd64 + make build-jaeger - name: Calculate bundle size run: | - TOTAL_SIZE=$(du -sb ./cmd/jaeger/jaeger-${{ matrix.os }}-${{ matrix.arch }} | cut -f1) + TOTAL_SIZE=$(du -sb ./cmd/jaeger/jaeger-linux-amd64 | cut -f1) echo "$TOTAL_SIZE" > ./new_bundle_size.txt echo "Total bundle size: $TOTAL_SIZE bytes" @@ -71,7 +58,7 @@ jobs: uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 #v4.2.0 with: path: ./bundle_size.txt - key: bundle-size-jaeger-${{ matrix.os }}-${{ matrix.arch }} + key: bundle-size-jaeger-linux-amd64 - name: Compare bundle sizes run: | From 614823eb970c7b906a08d4514c827d769c59d898 Mon Sep 17 00:00:00 2001 From: chahatsagarmain Date: Sun, 12 Jan 2025 18:42:39 +0530 Subject: [PATCH 03/14] minor fix Signed-off-by: chahatsagarmain --- .github/workflows/ci-check-bundle-size.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-check-bundle-size.yml b/.github/workflows/ci-check-bundle-size.yml index 997d771bb84..7f06015947f 100644 --- a/.github/workflows/ci-check-bundle-size.yml +++ b/.github/workflows/ci-check-bundle-size.yml @@ -42,7 +42,7 @@ jobs: run: make install-ci - name: Build jaeger binary - run: / + run: | export GOOS=linux export GOARCH=amd64 make build-jaeger From 230171c9f6ede3a31f2da94e50eae5b32d6fa2e0 Mon Sep 17 00:00:00 2001 From: chahatsagarmain Date: Tue, 14 Jan 2025 18:17:58 +0530 Subject: [PATCH 04/14] minor changes Signed-off-by: chahatsagarmain --- .github/workflows/ci-check-bundle-size.yml | 38 +++++++++------------- 1 file changed, 15 insertions(+), 23 deletions(-) diff --git a/.github/workflows/ci-check-bundle-size.yml b/.github/workflows/ci-check-bundle-size.yml index 7f06015947f..d7d92900e3b 100644 --- a/.github/workflows/ci-check-bundle-size.yml +++ b/.github/workflows/ci-check-bundle-size.yml @@ -38,14 +38,8 @@ jobs: - name: Setup Node.js version uses: ./.github/actions/setup-node.js - - name: Install tools - run: make install-ci - - name: Build jaeger binary - run: | - export GOOS=linux - export GOARCH=amd64 - make build-jaeger + run: make build-jaeger - name: Calculate bundle size run: | @@ -61,25 +55,23 @@ jobs: key: bundle-size-jaeger-linux-amd64 - name: Compare bundle sizes + if: steps.cache-bundle-size.outputs.cache-hit == 'true' run: | - if [ -f ./bundle_size.txt ]; then - OLD_BUNDLE_SIZE=$(cat ./bundle_size.txt) - NEW_BUNDLE_SIZE=$(cat ./new_bundle_size.txt) - echo "Previous bundle size: $OLD_BUNDLE_SIZE bytes" - echo "New bundle size: $NEW_BUNDLE_SIZE bytes" - - SIZE_CHANGE=$(( $NEW_BUNDLE_SIZE - $OLD_BUNDLE_SIZE )) - PERCENTAGE_CHANGE=$(( SIZE_CHANGE * 100 / $OLD_BUNDLE_SIZE )) - echo "Size change: $PERCENTAGE_CHANGE%" - if [ $PERCENTAGE_CHANGE -gt 2 ]; then - echo "❌ Bundle size increased by more than 2% ($PERCENTAGE_CHANGE%)" - exit 1 - else - echo "✅ Bundle size change is within acceptable range ($PERCENTAGE_CHANGE%)" - fi + OLD_BUNDLE_SIZE=$(cat ./bundle_size.txt) + NEW_BUNDLE_SIZE=$(cat ./new_bundle_size.txt) + echo "Previous bundle size: $OLD_BUNDLE_SIZE bytes" + echo "New bundle size: $NEW_BUNDLE_SIZE bytes" + + SIZE_CHANGE=$(( $NEW_BUNDLE_SIZE - $OLD_BUNDLE_SIZE )) + PERCENTAGE_CHANGE=$(( SIZE_CHANGE * 100 / $OLD_BUNDLE_SIZE )) + echo "Size change: $PERCENTAGE_CHANGE%" + if [ $PERCENTAGE_CHANGE -gt 2 ]; then + echo "❌ Bundle size increased by more than 2% ($PERCENTAGE_CHANGE%)" + exit 1 else - echo "No previous bundle size found. This will be the baseline." + echo "✅ Bundle size change is within acceptable range ($PERCENTAGE_CHANGE%)" fi + - name: Remove previous *_bundle_*.txt run: | From 1f4915ffc00c70813fa4d96d666c0cc2c313d6d9 Mon Sep 17 00:00:00 2001 From: chahatsagarmain Date: Tue, 14 Jan 2025 18:38:07 +0530 Subject: [PATCH 05/14] minor change Signed-off-by: chahatsagarmain --- .github/workflows/ci-check-bundle-size.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-check-bundle-size.yml b/.github/workflows/ci-check-bundle-size.yml index d7d92900e3b..966ec8d8034 100644 --- a/.github/workflows/ci-check-bundle-size.yml +++ b/.github/workflows/ci-check-bundle-size.yml @@ -52,7 +52,7 @@ jobs: uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 #v4.2.0 with: path: ./bundle_size.txt - key: bundle-size-jaeger-linux-amd64 + key: jaeger-bundle - name: Compare bundle sizes if: steps.cache-bundle-size.outputs.cache-hit == 'true' @@ -79,8 +79,8 @@ jobs: mv ./new_bundle_size.txt ./bundle_size.txt - name: Save new bundle size - if: github.event_name == 'push' && github.ref == 'refs/heads/main' + if: ${{ (github.event_name == 'push') && (github.ref == 'refs/heads/main') }} uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 #v4.2.0 with: path: ./bundle_size.txt - key: bundle-size-jaeger-${{ matrix.os }}-${{ matrix.arch }} + key: jaeger-bundle From 3cc8f37a5c0ba37ed70507e0fb586a7488788ef2 Mon Sep 17 00:00:00 2001 From: chahatsagarmain Date: Tue, 14 Jan 2025 18:48:59 +0530 Subject: [PATCH 06/14] fixes Signed-off-by: chahatsagarmain --- .github/workflows/ci-check-bundle-size.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-check-bundle-size.yml b/.github/workflows/ci-check-bundle-size.yml index 966ec8d8034..6df27e0e097 100644 --- a/.github/workflows/ci-check-bundle-size.yml +++ b/.github/workflows/ci-check-bundle-size.yml @@ -53,6 +53,8 @@ jobs: with: path: ./bundle_size.txt key: jaeger-bundle + restore-keys: | + jaeger-bundle - name: Compare bundle sizes if: steps.cache-bundle-size.outputs.cache-hit == 'true' @@ -83,4 +85,4 @@ jobs: uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 #v4.2.0 with: path: ./bundle_size.txt - key: jaeger-bundle + key: jaeger-bundle_${{ github.run_id }} From 6d30ca19286309ead2da24806d0dd602c261a834 Mon Sep 17 00:00:00 2001 From: chahatsagarmain Date: Wed, 15 Jan 2025 22:07:44 +0530 Subject: [PATCH 07/14] changes Signed-off-by: chahatsagarmain --- .github/workflows/ci-check-bundle-size.yml | 44 +++++++++++----------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ci-check-bundle-size.yml b/.github/workflows/ci-check-bundle-size.yml index 6df27e0e097..7080a50de40 100644 --- a/.github/workflows/ci-check-bundle-size.yml +++ b/.github/workflows/ci-check-bundle-size.yml @@ -1,4 +1,4 @@ -name: Check Binaries bundle size +name: Check Binaries binary size on: push: @@ -41,48 +41,48 @@ jobs: - name: Build jaeger binary run: make build-jaeger - - name: Calculate bundle size + - name: Calculate jaeger binary size run: | TOTAL_SIZE=$(du -sb ./cmd/jaeger/jaeger-linux-amd64 | cut -f1) - echo "$TOTAL_SIZE" > ./new_bundle_size.txt - echo "Total bundle size: $TOTAL_SIZE bytes" + echo "$TOTAL_SIZE" > ./new_jaeger_binary_size.txt + echo "Total binary size: $TOTAL_SIZE bytes" - - name: Restore previous bundle size - id: cache-bundle-size + - name: Restore previous binary size + id: cache-binary-size uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 #v4.2.0 with: - path: ./bundle_size.txt - key: jaeger-bundle + path: ./jaeger_binary_size.txt + key: jaeger-binary restore-keys: | - jaeger-bundle + jaeger-binary - - name: Compare bundle sizes - if: steps.cache-bundle-size.outputs.cache-hit == 'true' + - name: Compare jaeger binary sizes + if: steps.cache-binary-size.outputs.cache-hit == 'true' run: | - OLD_BUNDLE_SIZE=$(cat ./bundle_size.txt) - NEW_BUNDLE_SIZE=$(cat ./new_bundle_size.txt) - echo "Previous bundle size: $OLD_BUNDLE_SIZE bytes" - echo "New bundle size: $NEW_BUNDLE_SIZE bytes" + OLD_BUNDLE_SIZE=$(cat ./jaeger_binary_size.txt) + NEW_BUNDLE_SIZE=$(cat ./new_jaeger_binary_size.txt) + echo "Previous binary size: $OLD_BUNDLE_SIZE bytes" + echo "New binary size: $NEW_BUNDLE_SIZE bytes" SIZE_CHANGE=$(( $NEW_BUNDLE_SIZE - $OLD_BUNDLE_SIZE )) PERCENTAGE_CHANGE=$(( SIZE_CHANGE * 100 / $OLD_BUNDLE_SIZE )) echo "Size change: $PERCENTAGE_CHANGE%" if [ $PERCENTAGE_CHANGE -gt 2 ]; then - echo "❌ Bundle size increased by more than 2% ($PERCENTAGE_CHANGE%)" + echo "❌ binary size increased by more than 2% ($PERCENTAGE_CHANGE%)" exit 1 else - echo "✅ Bundle size change is within acceptable range ($PERCENTAGE_CHANGE%)" + echo "✅ binary size change is within acceptable range ($PERCENTAGE_CHANGE%)" fi - name: Remove previous *_bundle_*.txt run: | - rm -rf ./bundle_size.txt - mv ./new_bundle_size.txt ./bundle_size.txt + rm -rf ./jaeger_binary_size.txt + mv ./new_jaeger_binary_size.txt ./jaeger_binary_size.txt - - name: Save new bundle size + - name: Save new jaeger binary size if: ${{ (github.event_name == 'push') && (github.ref == 'refs/heads/main') }} uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 #v4.2.0 with: - path: ./bundle_size.txt - key: jaeger-bundle_${{ github.run_id }} + path: ./jaeger_binary_size.txt + key: jaeger_binary_${{ github.run_id }} From cd74eb307f356fc142f967da6cb03cb9f2976512 Mon Sep 17 00:00:00 2001 From: chahatsagarmain Date: Wed, 15 Jan 2025 22:09:10 +0530 Subject: [PATCH 08/14] changes Signed-off-by: chahatsagarmain --- .github/workflows/ci-check-bundle-size.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-check-bundle-size.yml b/.github/workflows/ci-check-bundle-size.yml index 7080a50de40..77428c12eee 100644 --- a/.github/workflows/ci-check-bundle-size.yml +++ b/.github/workflows/ci-check-bundle-size.yml @@ -52,9 +52,9 @@ jobs: uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 #v4.2.0 with: path: ./jaeger_binary_size.txt - key: jaeger-binary + key: jaeger_binary restore-keys: | - jaeger-binary + jaeger_binary - name: Compare jaeger binary sizes if: steps.cache-binary-size.outputs.cache-hit == 'true' From 9220d5df6ab9d94482239df437c9d492d3aa5cd6 Mon Sep 17 00:00:00 2001 From: chahatsagarmain Date: Wed, 15 Jan 2025 22:13:10 +0530 Subject: [PATCH 09/14] changes Signed-off-by: chahatsagarmain --- .github/workflows/ci-check-bundle-size.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci-check-bundle-size.yml b/.github/workflows/ci-check-bundle-size.yml index 77428c12eee..5c772bd3b07 100644 --- a/.github/workflows/ci-check-bundle-size.yml +++ b/.github/workflows/ci-check-bundle-size.yml @@ -59,13 +59,13 @@ jobs: - name: Compare jaeger binary sizes if: steps.cache-binary-size.outputs.cache-hit == 'true' run: | - OLD_BUNDLE_SIZE=$(cat ./jaeger_binary_size.txt) - NEW_BUNDLE_SIZE=$(cat ./new_jaeger_binary_size.txt) - echo "Previous binary size: $OLD_BUNDLE_SIZE bytes" - echo "New binary size: $NEW_BUNDLE_SIZE bytes" + OLD_BINARY_SIZE=$(cat ./jaeger_binary_size.txt) + NEW_BINARY_SIZE=$(cat ./new_jaeger_binary_size.txt) + echo "Previous binary size: $OLD_BINARY_SIZE bytes" + echo "New binary size: $NEW_BINARY_SIZE bytes" - SIZE_CHANGE=$(( $NEW_BUNDLE_SIZE - $OLD_BUNDLE_SIZE )) - PERCENTAGE_CHANGE=$(( SIZE_CHANGE * 100 / $OLD_BUNDLE_SIZE )) + SIZE_CHANGE=$(( $NEW_BINARY_SIZE - $OLD_BINARY_SIZE )) + PERCENTAGE_CHANGE=$(( SIZE_CHANGE * 100 / $OLD_BINARY_SIZE )) echo "Size change: $PERCENTAGE_CHANGE%" if [ $PERCENTAGE_CHANGE -gt 2 ]; then echo "❌ binary size increased by more than 2% ($PERCENTAGE_CHANGE%)" @@ -75,7 +75,7 @@ jobs: fi - - name: Remove previous *_bundle_*.txt + - name: Remove previous *_binary_*.txt run: | rm -rf ./jaeger_binary_size.txt mv ./new_jaeger_binary_size.txt ./jaeger_binary_size.txt From 0a8b747067cc74535b4065a1570a46458bc1cfb2 Mon Sep 17 00:00:00 2001 From: chahat sagar <109112505+chahatsagarmain@users.noreply.github.com> Date: Thu, 16 Jan 2025 04:18:32 +0530 Subject: [PATCH 10/14] Update .github/workflows/ci-check-bundle-size.yml Co-authored-by: Yuri Shkuro Signed-off-by: chahat sagar <109112505+chahatsagarmain@users.noreply.github.com> --- .github/workflows/ci-check-bundle-size.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-check-bundle-size.yml b/.github/workflows/ci-check-bundle-size.yml index 5c772bd3b07..1c44427c772 100644 --- a/.github/workflows/ci-check-bundle-size.yml +++ b/.github/workflows/ci-check-bundle-size.yml @@ -52,9 +52,9 @@ jobs: uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 #v4.2.0 with: path: ./jaeger_binary_size.txt - key: jaeger_binary + key: jaeger_binary_size restore-keys: | - jaeger_binary + jaeger_binary_size - name: Compare jaeger binary sizes if: steps.cache-binary-size.outputs.cache-hit == 'true' From 943cd4d57d1e017a0d9450475d198a558971b7ce Mon Sep 17 00:00:00 2001 From: chahat sagar <109112505+chahatsagarmain@users.noreply.github.com> Date: Thu, 16 Jan 2025 04:18:38 +0530 Subject: [PATCH 11/14] Update .github/workflows/ci-check-bundle-size.yml Co-authored-by: Yuri Shkuro Signed-off-by: chahat sagar <109112505+chahatsagarmain@users.noreply.github.com> --- .github/workflows/ci-check-bundle-size.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-check-bundle-size.yml b/.github/workflows/ci-check-bundle-size.yml index 1c44427c772..bb0ecc681c2 100644 --- a/.github/workflows/ci-check-bundle-size.yml +++ b/.github/workflows/ci-check-bundle-size.yml @@ -85,4 +85,4 @@ jobs: uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 #v4.2.0 with: path: ./jaeger_binary_size.txt - key: jaeger_binary_${{ github.run_id }} + key: jaeger_binary_size_${{ github.run_id }} From 48431a6c68a48f929f7e87a35421f417f18cd798 Mon Sep 17 00:00:00 2001 From: chahatsagarmain Date: Thu, 16 Jan 2025 04:33:36 +0530 Subject: [PATCH 12/14] remove fetch tags Signed-off-by: chahatsagarmain --- .github/workflows/ci-check-bundle-size.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/ci-check-bundle-size.yml b/.github/workflows/ci-check-bundle-size.yml index bb0ecc681c2..5e30430ce5c 100644 --- a/.github/workflows/ci-check-bundle-size.yml +++ b/.github/workflows/ci-check-bundle-size.yml @@ -27,10 +27,6 @@ jobs: with: submodules: true - - name: Fetch git tags - run: | - git fetch --prune --unshallow --tags - - uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0 with: go-version: 1.23.x From 5ee245698a1de8613957b76ab0870979f35d2045 Mon Sep 17 00:00:00 2001 From: chahatsagarmain Date: Thu, 16 Jan 2025 04:45:41 +0530 Subject: [PATCH 13/14] move to lint checks Signed-off-by: chahatsagarmain --- .github/workflows/ci-check-bundle-size.yml | 84 ---------------------- .github/workflows/ci-lint-checks.yaml | 67 +++++++++++++++++ 2 files changed, 67 insertions(+), 84 deletions(-) delete mode 100644 .github/workflows/ci-check-bundle-size.yml diff --git a/.github/workflows/ci-check-bundle-size.yml b/.github/workflows/ci-check-bundle-size.yml deleted file mode 100644 index 5e30430ce5c..00000000000 --- a/.github/workflows/ci-check-bundle-size.yml +++ /dev/null @@ -1,84 +0,0 @@ -name: Check Binaries binary size - -on: - push: - branches: [main] - - pull_request: - branches: [main] - -concurrency: - group: ${{ github.workflow }}-${{ (github.event.pull_request && github.event.pull_request.number) || github.ref || github.run_id }} - cancel-in-progress: true - -# See https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions -permissions: - contents: read - -jobs: - build-and-check: - runs-on: ubuntu-latest - steps: - - uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 - with: - egress-policy: audit - - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - with: - submodules: true - - - uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0 - with: - go-version: 1.23.x - - - name: Setup Node.js version - uses: ./.github/actions/setup-node.js - - - name: Build jaeger binary - run: make build-jaeger - - - name: Calculate jaeger binary size - run: | - TOTAL_SIZE=$(du -sb ./cmd/jaeger/jaeger-linux-amd64 | cut -f1) - echo "$TOTAL_SIZE" > ./new_jaeger_binary_size.txt - echo "Total binary size: $TOTAL_SIZE bytes" - - - name: Restore previous binary size - id: cache-binary-size - uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 #v4.2.0 - with: - path: ./jaeger_binary_size.txt - key: jaeger_binary_size - restore-keys: | - jaeger_binary_size - - - name: Compare jaeger binary sizes - if: steps.cache-binary-size.outputs.cache-hit == 'true' - run: | - OLD_BINARY_SIZE=$(cat ./jaeger_binary_size.txt) - NEW_BINARY_SIZE=$(cat ./new_jaeger_binary_size.txt) - echo "Previous binary size: $OLD_BINARY_SIZE bytes" - echo "New binary size: $NEW_BINARY_SIZE bytes" - - SIZE_CHANGE=$(( $NEW_BINARY_SIZE - $OLD_BINARY_SIZE )) - PERCENTAGE_CHANGE=$(( SIZE_CHANGE * 100 / $OLD_BINARY_SIZE )) - echo "Size change: $PERCENTAGE_CHANGE%" - if [ $PERCENTAGE_CHANGE -gt 2 ]; then - echo "❌ binary size increased by more than 2% ($PERCENTAGE_CHANGE%)" - exit 1 - else - echo "✅ binary size change is within acceptable range ($PERCENTAGE_CHANGE%)" - fi - - - - name: Remove previous *_binary_*.txt - run: | - rm -rf ./jaeger_binary_size.txt - mv ./new_jaeger_binary_size.txt ./jaeger_binary_size.txt - - - name: Save new jaeger binary size - if: ${{ (github.event_name == 'push') && (github.ref == 'refs/heads/main') }} - uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 #v4.2.0 - with: - path: ./jaeger_binary_size.txt - key: jaeger_binary_size_${{ github.run_id }} diff --git a/.github/workflows/ci-lint-checks.yaml b/.github/workflows/ci-lint-checks.yaml index 36cc8236bc2..260842953c2 100644 --- a/.github/workflows/ci-lint-checks.yaml +++ b/.github/workflows/ci-lint-checks.yaml @@ -117,3 +117,70 @@ jobs: - name: Run unit tests for scripts run: | SHUNIT2=.tools/shunit2 bash scripts/utils/compute-tags.test.sh + + binary-size-and-check: + runs-on: ubuntu-latest + steps: + - uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 + with: + egress-policy: audit + + - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + with: + submodules: true + + - uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0 + with: + go-version: 1.23.x + + - name: Setup Node.js version + uses: ./.github/actions/setup-node.js + + - name: Build jaeger binary + run: make build-jaeger + + - name: Calculate jaeger binary size + run: | + TOTAL_SIZE=$(du -sb ./cmd/jaeger/jaeger-linux-amd64 | cut -f1) + echo "$TOTAL_SIZE" > ./new_jaeger_binary_size.txt + echo "Total binary size: $TOTAL_SIZE bytes" + + - name: Restore previous binary size + id: cache-binary-size + uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 #v4.2.0 + with: + path: ./jaeger_binary_size.txt + key: jaeger_binary_size + restore-keys: | + jaeger_binary_size + + - name: Compare jaeger binary sizes + if: steps.cache-binary-size.outputs.cache-hit == 'true' + run: | + OLD_BINARY_SIZE=$(cat ./jaeger_binary_size.txt) + NEW_BINARY_SIZE=$(cat ./new_jaeger_binary_size.txt) + echo "Previous binary size: $OLD_BINARY_SIZE bytes" + echo "New binary size: $NEW_BINARY_SIZE bytes" + + SIZE_CHANGE=$(( $NEW_BINARY_SIZE - $OLD_BINARY_SIZE )) + PERCENTAGE_CHANGE=$(( SIZE_CHANGE * 100 / $OLD_BINARY_SIZE )) + echo "Size change: $PERCENTAGE_CHANGE%" + if [ $PERCENTAGE_CHANGE -gt 2 ]; then + echo "❌ binary size increased by more than 2% ($PERCENTAGE_CHANGE%)" + exit 1 + else + echo "✅ binary size change is within acceptable range ($PERCENTAGE_CHANGE%)" + fi + + + - name: Remove previous *_binary_*.txt + run: | + rm -rf ./jaeger_binary_size.txt + mv ./new_jaeger_binary_size.txt ./jaeger_binary_size.txt + + - name: Save new jaeger binary size + if: ${{ (github.event_name == 'push') && (github.ref == 'refs/heads/main') }} + uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 #v4.2.0 + with: + path: ./jaeger_binary_size.txt + key: jaeger_binary_size_${{ github.run_id }} \ No newline at end of file From 98b8ca880d9c65d6a4d80bb9006bbbe775074488 Mon Sep 17 00:00:00 2001 From: Yuri Shkuro Date: Wed, 15 Jan 2025 18:29:34 -0500 Subject: [PATCH 14/14] Update .github/workflows/ci-lint-checks.yaml Signed-off-by: Yuri Shkuro --- .github/workflows/ci-lint-checks.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-lint-checks.yaml b/.github/workflows/ci-lint-checks.yaml index 260842953c2..6a7691cb11e 100644 --- a/.github/workflows/ci-lint-checks.yaml +++ b/.github/workflows/ci-lint-checks.yaml @@ -118,7 +118,7 @@ jobs: run: | SHUNIT2=.tools/shunit2 bash scripts/utils/compute-tags.test.sh - binary-size-and-check: + binary-size-check: runs-on: ubuntu-latest steps: - uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1