From 9c9703b9fbbf6f5eace25f49e3407f9cd3926594 Mon Sep 17 00:00:00 2001 From: Karsten Sperling Date: Thu, 28 Mar 2024 12:02:23 +1300 Subject: [PATCH] Attempted fix --- .github/actions/bootstrap/action.yaml | 16 +++++------ .github/actions/dynamic/action.yaml | 38 +++++++++++++++++++++++++++ .github/workflows/darwin.yaml | 16 +++++------ 3 files changed, 52 insertions(+), 18 deletions(-) create mode 100644 .github/actions/dynamic/action.yaml diff --git a/.github/actions/bootstrap/action.yaml b/.github/actions/bootstrap/action.yaml index 5d9c2b0c6a646c..21ee1764b3f043 100644 --- a/.github/actions/bootstrap/action.yaml +++ b/.github/actions/bootstrap/action.yaml @@ -37,12 +37,10 @@ runs: - name: Bootstrap from cache id: restore - uses: Wandalen/wretry.action@v1.4.10 + uses: ./.github/actions/dynamic continue-on-error: true with: action: ${{ steps.prepare.outputs.backend }}/cache/restore@v4 - attempt_limit: 3 - attempt_delay: 2000 with: | key: ${{ steps.prepare.outputs.key }} path: | @@ -58,18 +56,16 @@ runs: run: source scripts/bootstrap.sh -p all,${{ inputs.platform }} - name: Save bootstrap cache - uses: Wandalen/wretry.action@v1.4.10 + uses: ./.github/actions/dynamic if: ${{ fromJSON(steps.restore.outputs.outputs).cache-hit != 'true' }} continue-on-error: true with: action: ${{ steps.prepare.outputs.backend }}/cache/save@v4 - attempt_limit: 3 - attempt_delay: 2000 with: | key: ${{ steps.prepare.outputs.key }} path: | - .environment - build_overrides/pigweed_environment.gni + .environment + build_overrides/pigweed_environment.gni - name: Upload bootstrap logs uses: actions/upload-artifact@v4 @@ -77,5 +73,5 @@ runs: with: name: ${{ inputs.bootstrap-log-name }} path: | - .environment/gn_out/.ninja_log - .environment/pigweed-venv/*.log + .environment/gn_out/.ninja_log + .environment/pigweed-venv/*.log diff --git a/.github/actions/dynamic/action.yaml b/.github/actions/dynamic/action.yaml new file mode 100644 index 00000000000000..7cee233c4f4ce2 --- /dev/null +++ b/.github/actions/dynamic/action.yaml @@ -0,0 +1,38 @@ +name: Dynamic +description: Dynamically resolves another GitHub action +inputs: + action: + description: Action reference + required: true + with: + description: Action inputs as multi-line YAML string + required: false + default: "" +outputs: + outputs: + description: JSON object of outputs from the action + value: ${{ steps.run.outputs.outputs }} +runs: + using: composite + steps: + - name: Instantiate + shell: bash + run: | + # Dynamically invoke ${{ inputs.action }} + with='${{ inputs.with }}' + [[ -z "$with" ]] || with="$(echo ' with:'; sed -e 's/^/ /' <<<"$with")" + mkdir -p ./.tmp/dynamic-action-instance + cat <./.tmp/dynamic-action-instance/action.yaml + runs: + using: composite + steps: + - id: run + uses: ${{ inputs.action }} + $with + outputs: + outputs: + value: $(echo '$'){{ toJSON(steps.run.outputs) }} + END + - name: Run + id: run + uses: ./.tmp/dynamic-action-instance diff --git a/.github/workflows/darwin.yaml b/.github/workflows/darwin.yaml index f84c85e5716189..d4ea40ca4ee312 100644 --- a/.github/workflows/darwin.yaml +++ b/.github/workflows/darwin.yaml @@ -37,14 +37,14 @@ jobs: options: # We don't need a full matrix - flavor: macos-release-availability arguments: -sdk macosx -configuration Release WARNING_CFLAGS='${inherited} -Werror -Wconversion -Wno-unguarded-availability-new' - - flavor: ios-release - arguments: -sdk iphoneos -configuration Release WARNING_CFLAGS='${inherited} -Werror -Wconversion' GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1' - - flavor: ios-debug - arguments: -sdk iphoneos -configuration Debug WARNING_CFLAGS='${inherited} -Werror -Wconversion' GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1' - - flavor: tvos-debug - arguments: -sdk appletvos -configuration Debug WARNING_CFLAGS='${inherited} -Werror -Wconversion' GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1' - - flavor: watchos-debug - arguments: -sdk watchos -configuration Debug WARNING_CFLAGS='${inherited} -Werror -Wconversion' GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1' + # - flavor: ios-release + # arguments: -sdk iphoneos -configuration Release WARNING_CFLAGS='${inherited} -Werror -Wconversion' GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1' + # - flavor: ios-debug + # arguments: -sdk iphoneos -configuration Debug WARNING_CFLAGS='${inherited} -Werror -Wconversion' GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1' + # - flavor: tvos-debug + # arguments: -sdk appletvos -configuration Debug WARNING_CFLAGS='${inherited} -Werror -Wconversion' GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1' + # - flavor: watchos-debug + # arguments: -sdk watchos -configuration Debug WARNING_CFLAGS='${inherited} -Werror -Wconversion' GCC_PREPROCESSOR_DEFINITIONS='${inherited} MTR_NO_AVAILABILITY=1' steps: - name: Checkout uses: actions/checkout@v4