31 Commits

Author SHA1 Message Date
o-az
c32ac2a0f0 feat(ci): lint shell scripts (#12797)
* feat(ci): lint shell scripts

* fixes

---------

Co-authored-by: grandizzy <grandizzy.the.egg@gmail.com>
2025-12-16 12:57:22 +00:00
DaniPopes
3f82ca4b9b ci: disable Windows on PRs (#12162)
With merge queues we don't need to run all tests on Windows in CI
on every PR update, since any failure will still block merging.
2025-10-17 18:41:13 +00:00
DaniPopes
054a088671 ci: tweak runners, depot 16 (#11815) 2025-09-25 09:31:22 +00:00
DaniPopes
990d74ffc7 ci: rm cores from depot macos runner (#11805) 2025-09-25 05:02:54 +03:00
DaniPopes
adf97ab745 ci: fix matrix names (#11803) 2025-09-24 22:47:42 +00:00
onbjerg
1153d4f7be ci: use 1 partition (#11798)
* ci: use 1 partition

* ci: merge configs
2025-09-24 20:50:16 +02:00
onbjerg
d2ef319a59 ci: use depot (#11758) 2025-09-24 18:08:34 +00:00
DaniPopes
4cb8b63315 ci: add --no-fail-fast (#11419)
CI is pretty fast overall so I'd prefer seeing all tests that fail
rather than just the first one that happens in that run.
2025-08-25 16:55:03 +00:00
DaniPopes
23e7fb06be ci: enable testing for aarch64 linux (#11386)
* ci: enable testing for aarch64 linux

* nff

* tmp

* fix

* untmp
2025-08-21 14:57:47 +02:00
Yash Atreya
450f2c761f feat(benches): forge test --isolate (#11037) 2025-07-23 19:19:52 +05:30
Yash Atreya
aa3cc0fe9e feat: benchmark suite (#10804)
* Add Foundry multi-version benchmarking suite

- Automated benchmarking across multiple Foundry versions using hyperfine
- Supports stable, nightly, and specific version tags (e.g., v1.0.0)
- Benchmarks 5 major Foundry projects: account, v4-core, solady, morpho-blue, spark-psm
- Tests forge test, forge build (no cache), and forge build (with cache)
- Generates comparison tables in markdown format
- Uses foundryup for version management
- Exports JSON data for detailed analysis

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Fix benchmark script JSON data extraction and table formatting

- Fix relative path issue causing JSON files to fail creation
- Convert benchmark directories to absolute paths using SCRIPT_DIR
- Improve markdown table formatting with proper column names and alignment
- Use unified table generation with string concatenation for better formatting
- Increase benchmark runs from 3 to 5 for more reliable results
- Use --prepare instead of --cleanup for better cache management
- Remove stderr suppression to catch hyperfine errors
- Update table headers to show units (seconds) for clarity

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* parallel benchmarking

* refac: mv to benches/ dir

* feat: criterion benches

* fix: install foundry versions at once

* nit

* - setup benchmark repos in parallel
- run forge build in parallet for forge-test bench
- switch foundry versions
- README specifying prereqs

* feat: shell script to run benches

* feat: ci workflow, fix script

* update readme

* feat: enhance benchmarking suite with version flexibility

- Add `get_benchmark_versions()` helper to read versions from env var
- Update all benchmarks to use version helper for consistency
- Add `--versions` and `--force-install` flags to shell script
- Enable all three benchmarks (forge_test, build_no_cache, build_with_cache)
- Improve error handling for corrupted forge installations
- Remove complex workarounds in favor of clear error messages

The benchmarks now support custom versions via:
  ./run_benchmarks.sh --versions stable,nightly,v1.2.0

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>

* latest bench

* rm notes

* remove shell based bench suite

* feat: benches using criterion (#10805)

* feat: criterion benches

* - setup benchmark repos in parallel
- run forge build in parallet for forge-test bench
- switch foundry versions
- README specifying prereqs

* feat: shell script to run benches

* feat: ci workflow, fix script

* update readme

* feat: enhance benchmarking suite with version flexibility

- Add `get_benchmark_versions()` helper to read versions from env var
- Update all benchmarks to use version helper for consistency
- Add `--versions` and `--force-install` flags to shell script
- Enable all three benchmarks (forge_test, build_no_cache, build_with_cache)
- Improve error handling for corrupted forge installations
- Remove complex workarounds in favor of clear error messages

The benchmarks now support custom versions via:
  ./run_benchmarks.sh --versions stable,nightly,v1.2.0

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>

* latest bench

* rm notes

* remove shell based bench suite

---------

Co-authored-by: Claude <noreply@anthropic.com>

* unified benchmarker -
* main.rs
* forge version is controlled by the bin
* parses criterion json to collect results - writes to LATEST.md

* parallel bench

* refac

* refac benchmark results table generation

* cleanup main.rs

* rm dep

* cleanup main.rs

* deser estimate

* nit

* cleanup CriterionResult type

* feat: specify repos via flag

* nits

* update bench ci and README

* bench fuzz tests

* fmt

* license

* coverage bench

* nits

* clippy

* clippy

* separate benches into different jobs in CI

* remove criterion

* feat: hyperfine setup in foundry-bench

* forge version details: hash and date

* run benches again - run cov with --ir-min

* del

* bench in separate ci jobs

* move combine bench results logic to scripts

* setup foundryup in ci

* setup foundryup fix

* clippy

* ci: run on foundry-runner

* ci: don't use wget

* ci: add build essential

* ci: nodejs and npm

* install hyperfine for each job

* fix

* install deps script

* add benchmark-setup, using setup-node action, remove redundant files

* fix

* fix

* checkout repo

* nits

* nit

* fix

* show forge test result in top comment

* force foundry install

* fix bench comment aggregation

* nit

* fix

* feat: create PR for manual runs, else commit in the PR itself.

* fix

* fetch and pull

* chore(`benches`): update benchmark results

🤖 Generated with [Foundry Benchmarks](https://github.com/foundry-rs/foundry/actions)

Co-Authored-By: github-actions <github-actions@github.com>

* fix

* chore(`benches`): update benchmark results

🤖 Generated with [Foundry Benchmarks](https://github.com/foundry-rs/foundry/actions)

Co-Authored-By: github-actions <github-actions@github.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: GitHub Action <action@github.com>
Co-authored-by: github-actions <github-actions@github.com>
2025-07-11 12:18:25 +00:00
DaniPopes
d071cb10f2 test: update config with a closure (#9813) 2025-02-03 07:08:05 +01:00
DaniPopes
b03dd220ac chore: stop supporting legacy console.sol signatures (#8910)
* feat: stop supporting legacy console.sol signatures

* chore: update console.sol in tests

* Fix test

---------

Co-authored-by: grandizzy <grandizzy.the.egg@gmail.com>
Co-authored-by: grandizzy <38490174+grandizzy@users.noreply.github.com>
2025-01-24 12:05:37 +02:00
DaniPopes
0ade1fd5db test: consolidate RPC URLs, remove flaky ones (#8534)
* test: consolidate RPC URLs, remove flaky ones

* chore: clippy
2024-07-26 17:05:03 +02:00
Samuel Laferriere
b0e562faf3 Update prune-prereleases.js to keep 30 nightlies around (#8282) 2024-06-28 09:42:57 +02:00
Arsenii Kulikov
3df7d8a014 fix: --isolate fixes and daily CI job (#8194)
* feat: add daily CI job for `--isolate` feature

* fix tests

* wip

* fix tests

* wip

* wip

* fix

* update group name for nextest
2024-06-19 15:24:36 +02:00
DaniPopes
9e95c5537e ci: switch macos test runner to use aarch64 (#8055)
* ci: switch macos test runner to use aarch64

* tmp: run it

* Revert "ci: switch macos test runner to use aarch64"

This reverts commit 844d375d93.

* Revert "tmp: run it"

This reverts commit 0eb13b77de.

* Reapply "ci: switch macos test runner to use aarch64"

This reverts commit f6da785344.
2024-06-04 18:27:57 +02:00
DaniPopes
dacd9cf1ec test: move forge-std test to external tests (#7227) 2024-02-24 04:12:22 +01:00
DaniPopes
0840762895 ci: revert to free GHA runners for tests (#7064) 2024-02-09 16:29:54 +01:00
DaniPopes
996c643bde fix: actually run all unit tests in CI (#6989) 2024-02-01 23:44:15 +01:00
DaniPopes
4574f05378 ci: update runners (part 3) (final) (#6987) 2024-02-01 20:26:59 +01:00
DaniPopes
877ff2f7dc ci: update runners (part 2) (#6972) 2024-02-01 14:31:57 +01:00
Miao ZhiCheng
f180a132e3 Update prune-prereleases.js pruning rules (#6806)
* Update prune-prereleases.js pruning rules

    // Pruning rules:
    //   1. only keep the earliest release of the month
    //   2. to keep the newest 3 nightlies

```
import { Octokit, App } from "octokit";

// Create a personal access token at https://github.com/settings/tokens/new?scopes=repo
const octokit = new Octokit({ });

// In case node 21 is not used.
function groupBy(array, keyOrIterator) {
    var iterator;

    // use the function passed in, or create one
    if(typeof keyOrIterator !== 'function') {
        const key = String(keyOrIterator);
        iterator = function (item) { return item[key]; };
    } else {
        iterator = keyOrIterator;
    }

    return array.reduce(function (memo, item) {
        const key = iterator(item);
        memo[key] = memo[key] || [];
        memo[key].push(item);
        return memo;
    }, {});
}

async function separateReleases({ github, context }) {
    console.log("Pruning old prereleases");

    // doc: https://docs.github.com/en/rest/releases/releases
    const { data: releases } = await github.rest.repos.listReleases({
        owner: context.repo.owner,
        repo: context.repo.repo,
    });

    let nightlies = releases.filter(
        release =>
        // Only consider releases tagged `nightly-${SHA}` for deletion
        release.tag_name.includes("nightly") &&
        release.tag_name !== "nightly"
    );

    // group releases by months
    const groups = groupBy(nightlies, i => i.created_at.slice(0, 7));

    // Pruning rules:
    //   1. only keep the earliest release of the month
    //   2. to keep the newest 3 nightlies
    const toPrune = Object.values(groups)
        .reduce((acc, cur) => acc.concat(cur.slice(0, -1)), [])
        .slice(3);

    const toKeep = Object.values(groups).reduce((acc, cur) => acc.concat(cur.slice(-1)), []);

    return {
        toPrune,
        toKeep,
    };
};

(async() => {
    const releases = await separateReleases({
        github : octokit,
        context : {
            repo : { owner: "foundry-rs", repo: "foundry" }
        },
    });
    console.log("To prune:", releases.toPrune.map(i => i.name));
    console.log("To keep:", releases.toKeep.map(i => i.name));
})();
```

```
$ node index.mjs 
Pruning old prereleases
To prune: [ 'Nightly (2023-11-01)' ]
To keep: [
  'Nightly (2024-01-12)',
  'Nightly (2023-12-02)',
  'Nightly (2023-11-02)',
  'Nightly (2023-10-02)',
  'Nightly (2023-08-02)',
  'Nightly (2023-07-02)',
  'Nightly (2023-06-02)',
  'Nightly (2023-05-02)',
  'Nightly (2023-04-02)',
  'Nightly (2023-03-02)',
  'Nightly (2023-01-03)'
]
```

* Update prune-prereleases.js

* Update prune-prereleases.js

* Update prune-prereleases.js
2024-01-16 16:39:28 +01:00
DaniPopes
855d0059dc fix: windows tests (#6239)
* wip

* ci: run winders always

* ci: merge build and run steps together

* chore: display full error msg

* ignore failing test

* chore: clippy

* chore: clean up script

* rm pretty_eq

* chore: simplify test macros

* test

* test: cache when building testdata project

* move

* ci: fix caching

* chore: update actions/checkout

* tmp: run all test matrices

* chore: relax timeout for external tests

* tmp: run all test matrices 2

* fix winders

* chore: relax timeout for external tests 2

* chore: relax timeout for forge_std test

* fix: add svm target platform

* fix: ignore geb

* fix: disable aarch64 target

* tmp: unrun all test matrices

* no cross
2023-11-08 15:39:06 +01:00
Bjerg
96ab9131e6 ci: disable aarch64 mac tests (#5932) 2023-09-27 17:02:35 -04:00
DaniPopes
4a12c6e65c ci: fix build matrix (#5664) 2023-08-18 16:57:00 -04:00
DaniPopes
d58ee4e9fb ci: improve test CI (#5661) 2023-08-18 15:40:27 -04:00
Miao ZhiCheng
5ca6e6c12e Permanent monthly releases (#3888)
Fixes #3881
2022-12-14 10:07:17 +02:00
DaniPopes
860d083183 fmt: all (#3398)
* fmt: all

* fmt: rest

* fmt: missing
2022-09-28 18:28:26 +02:00
Bjerg
8ccfe493a6 Nightly backwards compatability (#574)
* Always maintain a nightly release tagged `nightly`

This works as a release channel: it is always possible to
download the latest nightly from the release tagged `nightly`.

Additionally, 3 nightlies tagged with `nightly-${SHA}` are kept,
allowing users to rollback to a specific nightly.

* Move `nightly` tag last

Ensures that newer `foundryup` installations don't fail
to update while the new `nightly-${SHA}` release is still missing
some release assets.
2022-01-25 13:40:59 +02:00
Bjerg
73c5aa6cfb Keep 3 days of nightlies (#492)
* Keep 3 days of nightlies

* Fix release asset names

* Version channel handling in `foundryup`

* Driveby: Use `foundry.paradigm.xyz`

* Fix rebase slipup

* Move GitHub scripts into their own files
2022-01-25 00:16:28 +02:00