diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fb936826..6196fc50 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -188,9 +188,9 @@ jobs: # ------------------------------------------------------------------ # 4. Header-only externals (Eigen, Boost, CGAL, fmt, pybind11, ...) # ------------------------------------------------------------------ - - name: Cache header-only externals + - name: Restore header-only externals cache id: cache-headeronlys - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: | external/argparse @@ -214,12 +214,32 @@ jobs: curl -L -o external/external_headeronlys.tar.gz "$HEADERONLYS_URL" cd external && tar -xzf external_headeronlys.tar.gz + - name: Save header-only externals cache + if: always() + uses: actions/cache/save@v4 + with: + path: | + external/argparse + external/boost + external/CGAL + external/cppcodec + external/cpptrace + external/doctest + external/eigen + external/exprtk + external/fmt + external/nanoflann + external/nlohmann + external/pybind11 + external/pybind11_json + key: headeronlys-v1 + # ------------------------------------------------------------------ # 5. cfd_externals (zlib, hdf5, cgns, parmetis) # ------------------------------------------------------------------ - - name: Cache cfd_externals install + - name: Restore cfd_externals cache id: cache-cfd-ext - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: external/cfd_externals/install key: cfd-ext-${{ runner.os }}-${{ steps.submod.outputs.cfd_ext_sha }} @@ -227,16 +247,29 @@ jobs: - name: Build cfd_externals if: steps.cache-cfd-ext.outputs.cache-hit != 'true' run: | + # Double-check: skip if install already restored via prefix match + if [ -f external/cfd_externals/install/lib/libcgns.a ]; then + echo "cfd_externals install present (cache prefix match), skipping build" + exit 0 + fi + rm -rf external/cfd_externals git submodule update --init --recursive --depth=1 cd external/cfd_externals CC=mpicc CXX=mpicxx python3 cfd_externals_build.py + - name: Save cfd_externals cache + if: always() + uses: actions/cache/save@v4 + with: + path: external/cfd_externals/install + key: cfd-ext-${{ runner.os }}-${{ steps.submod.outputs.cfd_ext_sha }} + # ------------------------------------------------------------------ # 6. Python venv # ------------------------------------------------------------------ - - name: Cache Python venv + - name: Restore Python venv cache id: cache-venv - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: venv key: venv-ci-${{ runner.os }}-${{ steps.submod.outputs.cfd_ext_sha }}-${{ hashFiles('requirements.txt', 'scripts/install_python_deps.sh') }} @@ -249,6 +282,13 @@ jobs: pip install --upgrade pip PIP=$PWD/venv/bin/pip ./scripts/install_python_deps.sh + - name: Save Python venv cache + if: always() + uses: actions/cache/save@v4 + with: + path: venv + key: venv-ci-${{ runner.os }}-${{ steps.submod.outputs.cfd_ext_sha }}-${{ hashFiles('requirements.txt', 'scripts/install_python_deps.sh') }} + # ------------------------------------------------------------------ # 7. ccache # ------------------------------------------------------------------ diff --git a/AGENTS.md b/AGENTS.md index 261e8a33..173d13ad 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -333,8 +333,19 @@ Key concepts agents should know: **Read-only by default.** You may use `gh` freely for read operations (viewing issues, PRs, checks, releases, diffs, comments). **Do NOT use `gh` for any write operation** (creating/closing issues, creating/merging PRs, posting -comments, approving reviews, creating releases, editing labels, etc.) **unless -the user explicitly requests that specific write action.** One-time explicit -permission does not carry over to other write actions — ask each time. +comments, approving reviews, creating releases, editing labels, deleting +caches, etc.) **unless the user explicitly requests that specific write +action.** One-time explicit permission does not carry over to other write +actions — ask each time. + +**Operations requiring explicit user authorization (non-exhaustive):** +- `gh pr create/merge/close/edit` +- `gh issue create/close/edit` +- `gh pr comment` / `gh issue comment` +- `gh pr review` +- `gh release create/delete` +- `gh cache delete` +- `gh api` with non-GET methods (POST, PUT, PATCH, DELETE) +- `git push --force` / `git push --force-with-lease` **Draft PR by default** You must use --draft on new prs.