mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-13 06:29:11 +00:00
Better mtimes for github workflow build cache
Saves and restores mtimes to a file, also covering the `o/` directory to hopefully preserve make dependency information better.
This commit is contained in:
parent
4ca513cba2
commit
8d3bdd083c
1 changed files with 26 additions and 14 deletions
40
.github/workflows/build.yml
vendored
40
.github/workflows/build.yml
vendored
|
@ -27,22 +27,23 @@ jobs:
|
||||||
# Full checkout needed for git-restore-mtime-bare.
|
# Full checkout needed for git-restore-mtime-bare.
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
# TODO(jart): fork this action.
|
- uses: actions/cache/restore@v4
|
||||||
- uses: chetan/git-restore-mtime-action@v2
|
id: cache
|
||||||
|
|
||||||
- uses: actions/cache@v4
|
|
||||||
with:
|
with:
|
||||||
path: .cosmocc/${{ env.COSMOCC_VERSION }}
|
path: |
|
||||||
key: cosmocc-${{ env.COSMOCC_VERSION }}
|
.cosmocc/${{ env.COSMOCC_VERSION }}
|
||||||
|
o
|
||||||
- uses: actions/cache@v4
|
key: ${{ env.COSMOCC_VERSION }}-${{ matrix.mode }}-${{ github.sha }}
|
||||||
with:
|
|
||||||
path: o
|
|
||||||
key: o-${{ matrix.mode }}-${{ env.COSMOCC_VERSION }}-${{ github.sha }}
|
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
o-${{ matrix.mode }}-${{ env.COSMOCC_VERSION }}-
|
${{ env.COSMOCC_VERSION }}-${{ matrix.mode }}-
|
||||||
o-${{ matrix.mode }}-
|
${{ env.COSMOCC_VERSION }}-
|
||||||
o-
|
|
||||||
|
- name: Restore mtimes
|
||||||
|
if: steps.cache.outputs.cache-hit == 'true'
|
||||||
|
run: |
|
||||||
|
while read mtime file; do
|
||||||
|
[ -f "$file" ] && touch -d "@$mtime" "$file"
|
||||||
|
done < o/.mtimes
|
||||||
|
|
||||||
- name: support ape bins 1
|
- name: support ape bins 1
|
||||||
run: sudo cp -a build/bootstrap/ape.elf /usr/bin/ape
|
run: sudo cp -a build/bootstrap/ape.elf /usr/bin/ape
|
||||||
|
@ -52,3 +53,14 @@ jobs:
|
||||||
|
|
||||||
- name: make matrix
|
- name: make matrix
|
||||||
run: V=0 make -j2 MODE=${{ matrix.mode }}
|
run: V=0 make -j2 MODE=${{ matrix.mode }}
|
||||||
|
|
||||||
|
- name: Save mtimes
|
||||||
|
run: |
|
||||||
|
find o -type f -exec stat -c "%Y %n" {} \; > o/.mtimes
|
||||||
|
|
||||||
|
- uses: actions/cache/save@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
.cosmocc
|
||||||
|
o
|
||||||
|
key: ${{ env.COSMOCC_VERSION }}-${{ matrix.mode }}-${{ github.sha }}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue