From 1aae3c4187a0ce0b5ed96dd7bd508f5bb6d58e45 Mon Sep 17 00:00:00 2001 From: Mitch Capper Date: Sun, 8 Dec 2024 01:34:05 -0800 Subject: [PATCH] Separate Debug and Release deps as required for proper builds --- .github/set_dep_vars.ps1 | 12 ++++++-- .github/workflows/do_build.yml | 21 ------------- .github/workflows/restore_deps_to_cache.yml | 34 ++++++++++++++++----- 3 files changed, 37 insertions(+), 30 deletions(-) diff --git a/.github/set_dep_vars.ps1 b/.github/set_dep_vars.ps1 index 892c94b..33f0985 100644 --- a/.github/set_dep_vars.ps1 +++ b/.github/set_dep_vars.ps1 @@ -2,7 +2,7 @@ Set-StrictMode -version latest; $ErrorActionPreference = "Stop"; $VerbosePreference="Continue"; -$cacheKey=(date +'%m%d') +$cacheKey= $env:Configuration + (date +'%m%d') $arr=($env:DEPS).split() $cnt=1 foreach ($dep in $arr) { @@ -12,4 +12,12 @@ foreach ($dep in $arr) { $cnt++ } } -echo "DepsCacheKey=$cacheKey" >> $env:GITHUB_OUTPUT \ No newline at end of file +$failAction="fail" +$postfix="" +if ($env:Configuration -eq "Debug") { + $failAction="ignore" + $postfix="-Debug" +} +echo "DepsCacheKey=$cacheKey" >> $env:GITHUB_OUTPUT +echo "DepsFailAction=$failAction" >> $env:GITHUB_OUTPUT +echo "DepsPostfix=$postfix" >> $env:GITHUB_OUTPUT \ No newline at end of file diff --git a/.github/workflows/do_build.yml b/.github/workflows/do_build.yml index 2c768a9..00293a2 100644 --- a/.github/workflows/do_build.yml +++ b/.github/workflows/do_build.yml @@ -46,9 +46,6 @@ jobs: strategy: fail-fast: false matrix: - #BuildPkg: [patch] - #BuildPkg: [grep] -# BuildPkg: [which,patch,zstd,pcre2,gzip,tar,zlib,findutils,libpsl,coreutils,grep] BaseImage: [windows-latest] Configuration: [Debug, Release] #right now the deps downloader always downloads release versions, we could use our debug libs for debug builds SkipDebugBuild: @@ -93,24 +90,6 @@ jobs: echo "BLD_CONFIG_BUILD_DEBUG=1" >> $env:GITHUB_ENV } -# - uses: actions/setup-dotnet@v3.0.3 -# with: -# dotnet-version: ${{env.CI_REQ_DOTNET_SDK_VER}} - - - -#previously we built all in one workflow now with them as individual workflows we download differently - - # - name: Download Required Artifacts - # uses: mitchcapper/action-download-artifact@c026c9be4097d153332e6cd0974d140ba22cd6cc - # if: ${{ inputs.RequiredDeps != '' && inputs.BuildPkg != 'script' }} - # with: - # name: ${{ inputs.RequiredDeps }} - # path: d:/artifacts - # name_prefix: WLB- - # run_id: ${{ github.run_id }} - # workflow_conclusion: "success" - - name: Restore Existing Dep Cache if: ${{ inputs.RequiredDeps != '' && inputs.BuildPkg != 'script' }} uses: actions/cache/restore@v3 diff --git a/.github/workflows/restore_deps_to_cache.yml b/.github/workflows/restore_deps_to_cache.yml index 646c21f..251f0e6 100644 --- a/.github/workflows/restore_deps_to_cache.yml +++ b/.github/workflows/restore_deps_to_cache.yml @@ -16,6 +16,11 @@ on: jobs: build: + strategy: + fail-fast: false + matrix: + Configuration: [Debug, Release] + name: DEP Download runs-on: windows-2022 environment: main @@ -33,6 +38,7 @@ jobs: id: vars env: DEPS: "${{ inputs.RequiredDeps }}" + Configuration: "${{ matrix.Configuration }}" run: ${{ github.workspace }}\.github\set_dep_vars.ps1 - name: Check Existing Cache @@ -45,78 +51,92 @@ jobs: lookup-only: true - name: Download Artifact ${{ steps.vars.outputs.Dep1Name }} - uses: mitchcapper/action-download-artifact@ce1b9a1572bf43f4e5e89568e74cb1f2299e6362 + uses: mitchcapper/action-download-artifact@e8fcde2d08c6684586e66d4fe22786fd61a6e1a8 if: ${{ steps.vars.outputs.Dep1Name && steps.cachecheck.outputs.cache-hit != 'true' }} with: name: ${{ steps.vars.outputs.Dep1Name }} path: d:/artifacts name_prefix: WLB- + name_postfix: ${{ steps.vars.outputs.DepsPostfix }} + if_no_artifact_found: ${{ steps.vars.outputs.DepsFailAction }} workflow_conclusion: "success" skip_unpack: true workflow: tool_${{ steps.vars.outputs.Dep1Name }}_build.yml - name: Download Artifact ${{ steps.vars.outputs.Dep2Name }} - uses: mitchcapper/action-download-artifact@ce1b9a1572bf43f4e5e89568e74cb1f2299e6362 + uses: mitchcapper/action-download-artifact@e8fcde2d08c6684586e66d4fe22786fd61a6e1a8 if: ${{ steps.vars.outputs.Dep2Name && steps.cachecheck.outputs.cache-hit != 'true' }} with: name: ${{ steps.vars.outputs.Dep2Name }} path: d:/artifacts name_prefix: WLB- workflow_conclusion: "success" + name_postfix: ${{ steps.vars.outputs.DepsPostfix }} + if_no_artifact_found: ${{ steps.vars.outputs.DepsFailAction }} skip_unpack: true workflow: tool_${{ steps.vars.outputs.Dep2Name }}_build.yml - name: Download Artifact ${{ steps.vars.outputs.Dep3Name }} - uses: mitchcapper/action-download-artifact@ce1b9a1572bf43f4e5e89568e74cb1f2299e6362 + uses: mitchcapper/action-download-artifact@e8fcde2d08c6684586e66d4fe22786fd61a6e1a8 if: ${{ steps.vars.outputs.Dep3Name && steps.cachecheck.outputs.cache-hit != 'true' }} with: name: ${{ steps.vars.outputs.Dep3Name }} path: d:/artifacts name_prefix: WLB- + name_postfix: ${{ steps.vars.outputs.DepsPostfix }} + if_no_artifact_found: ${{ steps.vars.outputs.DepsFailAction }} workflow_conclusion: "success" skip_unpack: true workflow: tool_${{ steps.vars.outputs.Dep3Name }}_build.yml - name: Download Artifact ${{ steps.vars.outputs.Dep4Name }} - uses: mitchcapper/action-download-artifact@ce1b9a1572bf43f4e5e89568e74cb1f2299e6362 + uses: mitchcapper/action-download-artifact@e8fcde2d08c6684586e66d4fe22786fd61a6e1a8 if: ${{ steps.vars.outputs.Dep4Name && steps.cachecheck.outputs.cache-hit != 'true' }} with: name: ${{ steps.vars.outputs.Dep4Name }} path: d:/artifacts name_prefix: WLB- + name_postfix: ${{ steps.vars.outputs.DepsPostfix }} + if_no_artifact_found: ${{ steps.vars.outputs.DepsFailAction }} workflow_conclusion: "success" skip_unpack: true workflow: tool_${{ steps.vars.outputs.Dep4Name }}_build.yml - name: Download Artifact ${{ steps.vars.outputs.Dep5Name }} - uses: mitchcapper/action-download-artifact@ce1b9a1572bf43f4e5e89568e74cb1f2299e6362 + uses: mitchcapper/action-download-artifact@e8fcde2d08c6684586e66d4fe22786fd61a6e1a8 if: ${{ steps.vars.outputs.Dep5Name && steps.cachecheck.outputs.cache-hit != 'true' }} with: name: ${{ steps.vars.outputs.Dep5Name }} path: d:/artifacts name_prefix: WLB- + name_postfix: ${{ steps.vars.outputs.DepsPostfix }} + if_no_artifact_found: ${{ steps.vars.outputs.DepsFailAction }} workflow_conclusion: "success" skip_unpack: true workflow: tool_${{ steps.vars.outputs.Dep5Name }}_build.yml - name: Download Artifact ${{ steps.vars.outputs.Dep6Name }} - uses: mitchcapper/action-download-artifact@ce1b9a1572bf43f4e5e89568e74cb1f2299e6362 + uses: mitchcapper/action-download-artifact@e8fcde2d08c6684586e66d4fe22786fd61a6e1a8 if: ${{ steps.vars.outputs.Dep6Name && steps.cachecheck.outputs.cache-hit != 'true' }} with: name: ${{ steps.vars.outputs.Dep6Name }} path: d:/artifacts name_prefix: WLB- + name_postfix: ${{ steps.vars.outputs.DepsPostfix }} + if_no_artifact_found: ${{ steps.vars.outputs.DepsFailAction }} workflow_conclusion: "success" skip_unpack: true workflow: tool_${{ steps.vars.outputs.Dep6Name }}_build.yml - name: Download Artifact ${{ steps.vars.outputs.Dep7Name }} - uses: mitchcapper/action-download-artifact@ce1b9a1572bf43f4e5e89568e74cb1f2299e6362 + uses: mitchcapper/action-download-artifact@e8fcde2d08c6684586e66d4fe22786fd61a6e1a8 if: ${{ steps.vars.outputs.Dep7Name && steps.cachecheck.outputs.cache-hit != 'true' }} with: name: ${{ steps.vars.outputs.Dep7Name }} path: d:/artifacts name_prefix: WLB- + name_postfix: ${{ steps.vars.outputs.DepsPostfix }} + if_no_artifact_found: ${{ steps.vars.outputs.DepsFailAction }} workflow_conclusion: "success" skip_unpack: true workflow: tool_${{ steps.vars.outputs.Dep7Name }}_build.yml