diff --git a/.github/workflows/build-ruby.yml b/.github/workflows/build-ruby.yml index bf1bd85..a5e85e8 100644 --- a/.github/workflows/build-ruby.yml +++ b/.github/workflows/build-ruby.yml @@ -231,6 +231,7 @@ jobs: uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 with: persist-credentials: false + fetch-depth: 2 # First, build image for x86_64 as it will fail fast # @@ -240,8 +241,9 @@ jobs: if: ${{ contains(matrix.arch, 'x86_64') }} run: | cache_from=() - parents="$(git rev-list --parents -n 1 ${{ github.sha }})" - for sha in $parents; do + parents=( $(git rev-list --parents -n 1 ${{ github.sha }}) ) + for sha in "${parents[@]}"; do + echo "${sha}" cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}-g${sha}) done cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}) @@ -250,8 +252,9 @@ jobs: if: ${{ contains(matrix.arch, 'x86_64') }} run: | cache_from=() - parents="$(git rev-list --parents -n 1 ${{ github.sha }})" - for sha in $parents; do + parents=( $(git rev-list --parents -n 1 ${{ github.sha }}) ) + for sha in "${parents[@]}"; do + echo "${sha}" cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}-g${sha}) done cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}) @@ -271,8 +274,9 @@ jobs: if: ${{ contains(matrix.arch, 'x86_64') }} run: | cache_from=() - parents="$(git rev-list --parents -n 1 ${{ github.sha }})" - for sha in $parents; do + parents=( $(git rev-list --parents -n 1 ${{ github.sha }}) ) + for sha in "${parents[@]}"; do + echo "${sha}" cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}-g${sha}) done cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}) @@ -281,8 +285,9 @@ jobs: if: ${{ contains(matrix.arch, 'x86_64') && matrix.libc == 'musl' }} run: | cache_from=() - parents="$(git rev-list --parents -n 1 ${{ github.sha }})" - for sha in $parents; do + parents=( $(git rev-list --parents -n 1 ${{ github.sha }}) ) + for sha in "${parents[@]}"; do + echo "${sha}" cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}-gcc-g${sha}) done cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}-gcc) @@ -302,8 +307,9 @@ jobs: if: ${{ contains(matrix.arch, 'aarch64') }} run: | cache_from=() - parents="$(git rev-list --parents -n 1 ${{ github.sha }})" - for sha in $parents; do + parents=( $(git rev-list --parents -n 1 ${{ github.sha }}) ) + for sha in "${parents[@]}"; do + echo "${sha}" cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}-g${sha}) done cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}) @@ -312,8 +318,9 @@ jobs: if: ${{ contains(matrix.arch, 'aarch64') }} run: | cache_from=() - parents="$(git rev-list --parents -n 1 ${{ github.sha }})" - for sha in $parents; do + parents=( $(git rev-list --parents -n 1 ${{ github.sha }}) ) + for sha in "${parents[@]}"; do + echo "${sha}" cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}-g${sha}) done cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}) @@ -333,8 +340,9 @@ jobs: if: ${{ contains(matrix.arch, 'aarch64') }} run: | cache_from=() - parents="$(git rev-list --parents -n 1 ${{ github.sha }})" - for sha in $parents; do + parents=( $(git rev-list --parents -n 1 ${{ github.sha }}) ) + for sha in "${parents[@]}"; do + echo "${sha}" cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}-g${sha}) done cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}) @@ -343,8 +351,9 @@ jobs: if: ${{ contains(matrix.arch, 'aarch64') && matrix.libc == 'musl' }} run: | cache_from=() - parents="$(git rev-list --parents -n 1 ${{ github.sha }})" - for sha in $parents; do + parents=( $(git rev-list --parents -n 1 ${{ github.sha }}) ) + for sha in "${parents[@]}"; do + echo "${sha}" cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}-gcc-g${sha}) done cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}-gcc) @@ -360,8 +369,9 @@ jobs: - name: Push CI run image (${{ join(matrix.arch, ', ') }}) run: | cache_from=() - parents="$(git rev-list --parents -n 1 ${{ github.sha }})" - for sha in $parents; do + parents=( $(git rev-list --parents -n 1 ${{ github.sha }}) ) + for sha in "${parents[@]}"; do + echo "${sha}" cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}-g${sha}) done cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}) @@ -369,8 +379,9 @@ jobs: - name: Push commit image (${{ join(matrix.arch, ', ') }}) run: | cache_from=() - parents="$(git rev-list --parents -n 1 ${{ github.sha }})" - for sha in $parents; do + parents=( $(git rev-list --parents -n 1 ${{ github.sha }}) ) + for sha in "${parents[@]}"; do + echo "${sha}" cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}-g${sha}) done cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}) @@ -379,8 +390,9 @@ jobs: if: ${{ inputs.push }} run: | cache_from=() - parents="$(git rev-list --parents -n 1 ${{ github.sha }})" - for sha in $parents; do + parents=( $(git rev-list --parents -n 1 ${{ github.sha }}) ) + for sha in "${parents[@]}"; do + echo "${sha}" cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}-g${sha}) done cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}) @@ -391,8 +403,9 @@ jobs: if: ${{ inputs.push && matrix.libc == 'gnu' }} run: | cache_from=() - parents="$(git rev-list --parents -n 1 ${{ github.sha }})" - for sha in $parents; do + parents=( $(git rev-list --parents -n 1 ${{ github.sha }}) ) + for sha in "${parents[@]}"; do + echo "${sha}" cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}-g${sha}) done cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}) @@ -403,8 +416,9 @@ jobs: if: ${{ matrix.libc == 'gnu' || matrix.libc == 'centos' }} run: | cache_from=() - parents="$(git rev-list --parents -n 1 ${{ github.sha }})" - for sha in $parents; do + parents=( $(git rev-list --parents -n 1 ${{ github.sha }}) ) + for sha in "${parents[@]}"; do + echo "${sha}" cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}-gcc-g${sha}) done cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}-gcc) @@ -413,8 +427,9 @@ jobs: if: ${{ inputs.push && (matrix.libc == 'gnu' || matrix.libc == 'centos') }} run: | cache_from=() - parents="$(git rev-list --parents -n 1 ${{ github.sha }})" - for sha in $parents; do + parents=( $(git rev-list --parents -n 1 ${{ github.sha }}) ) + for sha in "${parents[@]}"; do + echo "${sha}" cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}-gcc-g${sha}) done cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}-gcc) @@ -429,8 +444,9 @@ jobs: if: ${{ matrix.libc == 'musl' }} run: | cache_from=() - parents="$(git rev-list --parents -n 1 ${{ github.sha }})" - for sha in $parents; do + parents=( $(git rev-list --parents -n 1 ${{ github.sha }}) ) + for sha in "${parents[@]}"; do + echo "${sha}" cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}-gcc-g${sha}) cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}-g${sha}) done @@ -441,8 +457,9 @@ jobs: if: ${{ inputs.push && matrix.libc == 'musl' }} run: | cache_from=() - parents="$(git rev-list --parents -n 1 ${{ github.sha }})" - for sha in $parents; do + parents=( $(git rev-list --parents -n 1 ${{ github.sha }}) ) + for sha in "${parents[@]}"; do + echo "${sha}" cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}-gcc-g${sha}) cache_from+=(--cache-from=type=registry,ref=${{ steps.vars.outputs.IMAGE }}:${{ steps.vars.outputs.RELEASE_TAG }}-g${sha}) done