diff --git a/.github/workflows/rainix-build-pointers.yaml b/.github/workflows/rainix-build-pointers.yaml index 4d6ba13..2b49b16 100644 --- a/.github/workflows/rainix-build-pointers.yaml +++ b/.github/workflows/rainix-build-pointers.yaml @@ -30,6 +30,17 @@ jobs: primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix', '**/flake.lock') }} restore-prefixes-first-match: nix-${{ runner.os }}- gc-max-store-size-linux: 8G + # Cache Foundry's incremental compilation cache only (NOT out/): this is a + # clean-build determinism check (assert committed pointers match a fresh + # BuildPointers run), so out/ is regenerated fresh each run while cache/ + # still speeds recompilation. + - name: Cache Foundry build + uses: actions/cache@v4 + with: + path: cache + key: foundry-${{ runner.os }}-${{ hashFiles('src/**/*.sol', 'test/**/*.sol', 'script/**/*.sol', 'foundry.toml', 'soldeer.lock', 'remappings.txt') }} + restore-keys: | + foundry-${{ runner.os }}- # Use rainix's sol-shell directly (slim — no rust/node/chromium). # Mixed-language consumers can ship their heavy default devShell without # paying for it on this purely Solidity-side check. diff --git a/.github/workflows/rainix-copy-artifacts.yaml b/.github/workflows/rainix-copy-artifacts.yaml index bbfd073..92d54ed 100644 --- a/.github/workflows/rainix-copy-artifacts.yaml +++ b/.github/workflows/rainix-copy-artifacts.yaml @@ -29,6 +29,16 @@ jobs: primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix', '**/flake.lock') }} restore-prefixes-first-match: nix-${{ runner.os }}- gc-max-store-size-linux: 8G + # Cache Foundry's incremental compilation cache only (NOT out/): out/ is + # regenerated fresh each run so the committed-artifact assert stays a true + # clean-build check, while cache/ still speeds recompilation. + - name: Cache Foundry build + uses: actions/cache@v4 + with: + path: cache + key: foundry-${{ runner.os }}-${{ hashFiles('src/**/*.sol', 'test/**/*.sol', 'script/**/*.sol', 'foundry.toml', 'soldeer.lock', 'remappings.txt') }} + restore-keys: | + foundry-${{ runner.os }}- - name: Install soldeer dependencies if: hashFiles('soldeer.lock') != '' run: nix develop github:rainlanguage/rainix#sol-shell -c forge soldeer install diff --git a/.github/workflows/rainix-manual-sol-artifacts.yaml b/.github/workflows/rainix-manual-sol-artifacts.yaml index b8d4689..74f894b 100644 --- a/.github/workflows/rainix-manual-sol-artifacts.yaml +++ b/.github/workflows/rainix-manual-sol-artifacts.yaml @@ -37,6 +37,17 @@ jobs: primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix', '**/flake.lock') }} restore-prefixes-first-match: nix-${{ runner.os }}- gc-max-store-size-linux: 8G + # Cache Foundry's incremental compilation cache + artifacts so unchanged + # contracts aren't recompiled (forge build is the dominant CI cost). + - name: Cache Foundry build + uses: actions/cache@v4 + with: + path: | + cache + out + key: foundry-${{ runner.os }}-${{ hashFiles('src/**/*.sol', 'test/**/*.sol', 'script/**/*.sol', 'foundry.toml', 'soldeer.lock', 'remappings.txt') }} + restore-keys: | + foundry-${{ runner.os }}- - name: Install soldeer dependencies if: hashFiles('soldeer.lock') != '' run: nix develop github:rainlanguage/rainix#sol-shell -c forge soldeer install diff --git a/.github/workflows/rainix-sol-static.yaml b/.github/workflows/rainix-sol-static.yaml index 78ce9ad..593ca3a 100644 --- a/.github/workflows/rainix-sol-static.yaml +++ b/.github/workflows/rainix-sol-static.yaml @@ -30,6 +30,17 @@ jobs: primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix', '**/flake.lock') }} restore-prefixes-first-match: nix-${{ runner.os }}- gc-max-store-size-linux: 8G + # Cache Foundry's incremental compilation cache + artifacts so unchanged + # contracts aren't recompiled (forge build is the dominant CI cost). + - name: Cache Foundry build + uses: actions/cache@v4 + with: + path: | + cache + out + key: foundry-${{ runner.os }}-${{ hashFiles('src/**/*.sol', 'test/**/*.sol', 'script/**/*.sol', 'foundry.toml', 'soldeer.lock', 'remappings.txt') }} + restore-keys: | + foundry-${{ runner.os }}- - name: Install soldeer dependencies if: hashFiles('soldeer.lock') != '' run: nix develop github:rainlanguage/rainix#sol-shell -c forge soldeer install diff --git a/.github/workflows/rainix-sol-test.yaml b/.github/workflows/rainix-sol-test.yaml index dd0c1df..305e925 100644 --- a/.github/workflows/rainix-sol-test.yaml +++ b/.github/workflows/rainix-sol-test.yaml @@ -59,6 +59,17 @@ jobs: primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix', '**/flake.lock') }} restore-prefixes-first-match: nix-${{ runner.os }}- gc-max-store-size-linux: 8G + # Cache Foundry's incremental compilation cache + artifacts so unchanged + # contracts aren't recompiled (forge build is the dominant CI cost). + - name: Cache Foundry build + uses: actions/cache@v4 + with: + path: | + cache + out + key: foundry-${{ runner.os }}-${{ hashFiles('src/**/*.sol', 'test/**/*.sol', 'script/**/*.sol', 'foundry.toml', 'soldeer.lock', 'remappings.txt') }} + restore-keys: | + foundry-${{ runner.os }}- - name: Install soldeer dependencies if: hashFiles('soldeer.lock') != '' run: nix develop github:rainlanguage/rainix#sol-shell -c forge soldeer install diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 38f9188..d018b1e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -54,6 +54,17 @@ jobs: primary-key: nix-${{ runner.os }}-${{ hashFiles('**/*.nix', '**/flake.lock') }} restore-prefixes-first-match: nix-${{ runner.os }}- gc-max-store-size-linux: 8G + # Cache Foundry's incremental compilation cache + artifacts so unchanged + # contracts aren't recompiled (forge build is the dominant CI cost). + - name: Cache Foundry build + uses: actions/cache@v4 + with: + path: | + cache + out + key: foundry-${{ runner.os }}-${{ hashFiles('src/**/*.sol', 'test/**/*.sol', 'script/**/*.sol', 'foundry.toml', 'soldeer.lock', 'remappings.txt') }} + restore-keys: | + foundry-${{ runner.os }}- - run: nix develop ../.. --command forge soldeer install - name: Run ${{ matrix.task }} env: