From 7a4272e38dc77f98806f4cd6075f707b5e97fd08 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sat, 8 Aug 2026 04:09:07 +0000 Subject: [PATCH 1/3] Extract duration measurement into reusable composite action Co-authored-by: gabrielrufino <31759891+gabrielrufino@users.noreply.github.com> --- action.yml | 32 ++++++++++++-------------------- measure/action.yml | 19 +++++++++++++++++++ 2 files changed, 31 insertions(+), 20 deletions(-) create mode 100644 measure/action.yml diff --git a/action.yml b/action.yml index 4e0b4fa..b4d286b 100644 --- a/action.yml +++ b/action.yml @@ -67,32 +67,24 @@ runs: echo "scripts=$scripts" >> $GITHUB_OUTPUT shell: bash - id: install - run: | - start=$(date +%s) - ${{ steps.package-manager.outputs.install_cmd }} - echo "duration=$(( $(date +%s) - start ))" >> $GITHUB_OUTPUT - shell: bash + uses: ./measure + with: + run: ${{ steps.package-manager.outputs.install_cmd }} - id: build if: ${{ contains(steps.scripts.outputs.scripts, 'build') && !contains(inputs.except, 'build') }} - run: | - start=$(date +%s) - ${{ steps.package-manager.outputs.pkg_cmd }} run build - echo "duration=$(( $(date +%s) - start ))" >> $GITHUB_OUTPUT - shell: bash + uses: ./measure + with: + run: ${{ steps.package-manager.outputs.pkg_cmd }} run build - id: lint if: ${{ contains(steps.scripts.outputs.scripts, 'lint') && !contains(inputs.except, 'lint') }} - run: | - start=$(date +%s) - ${{ steps.package-manager.outputs.pkg_cmd }} run lint - echo "duration=$(( $(date +%s) - start ))" >> $GITHUB_OUTPUT - shell: bash + uses: ./measure + with: + run: ${{ steps.package-manager.outputs.pkg_cmd }} run lint - id: test if: ${{ contains(steps.scripts.outputs.scripts, 'test') && !contains(inputs.except, 'test') }} - run: | - start=$(date +%s) - ${{ steps.package-manager.outputs.pkg_cmd }} test - echo "duration=$(( $(date +%s) - start ))" >> $GITHUB_OUTPUT - shell: bash + uses: ./measure + with: + run: ${{ steps.package-manager.outputs.pkg_cmd }} test - run: ${{ steps.package-manager.outputs.pkg_cmd }} run test:e2e if: ${{ contains(steps.scripts.outputs.scripts, 'test:e2e') && !contains(inputs.except, 'test:e2e') }} shell: bash diff --git a/measure/action.yml b/measure/action.yml new file mode 100644 index 0000000..3e5b87e --- /dev/null +++ b/measure/action.yml @@ -0,0 +1,19 @@ +name: 'Measure' +description: 'Runs a command and measures its duration' +inputs: + run: + required: true + description: 'The command to run' +outputs: + duration: + description: 'Duration of the command in seconds' + value: ${{ steps.run.outputs.duration }} +runs: + using: composite + steps: + - id: run + run: | + start=$(date +%s) + ${{ inputs.run }} + echo "duration=$(( $(date +%s) - start ))" >> $GITHUB_OUTPUT + shell: bash From 55fcfad7fcfdba70e0d784fcfe2e654754765efc Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sat, 8 Aug 2026 04:14:30 +0000 Subject: [PATCH 2/3] Fix CI workflow to include measure sub-action in artifacts Co-authored-by: gabrielrufino <31759891+gabrielrufino@users.noreply.github.com> --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3fb08fa..1d9240d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,9 @@ jobs: - uses: actions/upload-artifact@v4 with: name: action - path: action.yml + path: | + action.yml + measure/ test: name: 'Test: package manager ${{ matrix.package-manager }}' strategy: From 83552435218f1f811b46a616ff75e0cf28201466 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sat, 8 Aug 2026 04:20:12 +0000 Subject: [PATCH 3/3] Fix test workflow artifact paths for nested composite actions Co-authored-by: gabrielrufino <31759891+gabrielrufino@users.noreply.github.com> --- .github/workflows/ci.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1d9240d..7e5724d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,7 +33,10 @@ jobs: with: repository: gabrielrufino/node-template - uses: actions/download-artifact@v4 - - uses: ./action/ + with: + name: action + path: . + - uses: ./ with: package-manager: ${{ matrix.package-manager }} test-using-except: @@ -46,7 +49,10 @@ jobs: with: repository: gabrielrufino/node-template - uses: actions/download-artifact@v4 - - uses: ./action/ + with: + name: action + path: . + - uses: ./ with: except: build test-in-different-operating-systems: @@ -62,7 +68,10 @@ jobs: with: repository: gabrielrufino/node-template - uses: actions/download-artifact@v4 - - uses: ./action/ + with: + name: action + path: . + - uses: ./ concurrency: group: ${{ github.workflow }}-${{ github.ref }}