Skip to content

Commit

Permalink
Further fix the dep cache to last a max of one day
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchcapper committed Dec 7, 2024
1 parent 9ea521a commit 80e9faf
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 14 deletions.
5 changes: 4 additions & 1 deletion .github/set_dep_vars.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@ Set-StrictMode -version latest;
$ErrorActionPreference = "Stop";
$VerbosePreference="Continue";

$cacheKey=(date +'%m%d')
$arr=($env:DEPS).split()
$cnt=1
foreach ($dep in $arr) {
if ($dep){
echo "Dep$($cnt)Name=$dep" >> $env:GITHUB_OUTPUT
$cacheKey+=$dep + "-"
$cnt++
}
}
}
echo "DepsCacheKey=$cacheKey" >> $env:GITHUB_OUTPUT
9 changes: 8 additions & 1 deletion .github/workflows/do_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ jobs:
- uses: actions/[email protected]
with:
submodules: true
- name: Set DepCache Variables
if: ${{ inputs.RequiredDeps != '' }}
shell: powershell
id: vars
env:
DEPS: "${{ inputs.RequiredDeps }}"
run: ${{ github.workspace }}\.github\set_dep_vars.ps1
- name: ENV Set
run: |
$dir=$env:GITHUB_WORKSPACE
Expand Down Expand Up @@ -110,7 +117,7 @@ jobs:
with:
path: |
d:/artifacts
key: ${{ inputs.BuildPkg }}
key: ${{ env.DepsCacheKey }}


- name: MSBuild Setup
Expand Down
19 changes: 9 additions & 10 deletions .github/workflows/restore_deps_to_cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,27 @@ jobs:
run:
shell: pwsh
steps:
- name: Set DepCache Variables
shell: powershell
id: vars
env:
DEPS: "${{ inputs.RequiredDeps }}"
run: ${{ github.workspace }}\.github\set_dep_vars.ps1

- name: Check Existing Cache
id: cachecheck
uses: actions/cache/restore@v3
with:
path: |
d:/artifacts
key: ${{ inputs.BuildPkg }}-${{ inputs.RequiredDeps }}
key: ${{ env.DepsCacheKey }}
lookup-only: true

- uses: actions/[email protected]
if: steps.cachecheck.outputs.cache-hit != 'true'
with:
submodules: true

- name: Set Variables
shell: powershell
id: vars
if: steps.cachecheck.outputs.cache-hit != 'true'
env:
DEPS: "${{ inputs.RequiredDeps }}"
run: ${{ github.workspace }}\.github\set_dep_vars.ps1

- name: Download Artifact ${{ steps.vars.outputs.Dep1Name }}
uses: mitchcapper/action-download-artifact@ce1b9a1572bf43f4e5e89568e74cb1f2299e6362
if: ${{ steps.vars.outputs.Dep1Name && steps.cachecheck.outputs.cache-hit != 'true' }}
Expand Down Expand Up @@ -129,7 +128,7 @@ jobs:
with:
path: |
d:/artifacts
key: ${{ inputs.BuildPkg }}-${{ inputs.RequiredDeps }}
key: ${{ env.DepsCacheKey }}
# - name: Debug Session
# if: ${{ failure() }}
# run: D:/a/docs/docs/.github/debug_ssh_start.ps1
Expand Down
4 changes: 2 additions & 2 deletions build/f_wget2_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,14 @@ fi
if [[ -z $SKIP_STEP || $SKIP_STEP == "bootstrap" ]]; then
gnulib_ensure_buildaux_scripts_copied;
setup_gnulibtool_py_autoconfwrapper #needed for generated .mk/.ac files but if just stock then the below line likely works
libtool_fixes "build-aux/ltmain.sh" "m4/libtool.m4"
./bootstrap --no-bootstrap-sync --no-git --gnulib-srcdir=gnulib --skip-po
libtool_fixes "build-aux/ltmain.sh" "m4/libtool.m4"
autoreconf --symlink --verbose
SKIP_STEP=""
fi
fi
if [[ $SKIP_STEP == "autoconf" ]]; then #not empty allowed as if we bootstrapped above we dont need to run nautoconf
autoreconf --symlink --verbose --install
libtool_fixes "build-aux/ltmain.sh" "m4/libtool.m4"
autoreconf --verbose #update for libtool fixes
gnulib_ensure_buildaux_scripts_copied;
SKIP_STEP="" #to do all the other steps
Expand Down

0 comments on commit 80e9faf

Please sign in to comment.