mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-10-03 21:21:03 +00:00
Saves and restores mtimes to a file, also covering the `o/` directory to hopefully preserve make dependency information better.
69 lines
1.7 KiB
YAML
69 lines
1.7 KiB
YAML
name: build
|
|
|
|
env:
|
|
COSMOCC_VERSION: 3.9.2
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- "master"
|
|
- "flake"
|
|
pull_request:
|
|
branches:
|
|
- "master"
|
|
|
|
# run workflow manually from the Actions tab
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
matrix_on_mode:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
mode: ["", tiny, rel, tinylinux, optlinux]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
# Full checkout needed for git-restore-mtime-bare.
|
|
fetch-depth: 0
|
|
|
|
# TODO(jart): fork this action.
|
|
- uses: chetan/git-restore-mtime-action@v2
|
|
|
|
- uses: actions/cache/restore@v4
|
|
id: cache
|
|
with:
|
|
path: |
|
|
.cosmocc
|
|
o
|
|
key: ${{ env.COSMOCC_VERSION }}-${{ matrix.mode }}-${{ github.sha }}
|
|
restore-keys: |
|
|
${{ env.COSMOCC_VERSION }}-${{ matrix.mode }}-
|
|
${{ env.COSMOCC_VERSION }}-
|
|
|
|
- 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
|
|
run: sudo cp -a build/bootstrap/ape.elf /usr/bin/ape
|
|
|
|
- name: support ape bins 2
|
|
run: sudo sh -c "echo ':APE:M::MZqFpD::/usr/bin/ape:' >/proc/sys/fs/binfmt_misc/register"
|
|
|
|
- name: make matrix
|
|
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 }}
|