diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 10caba84..2c21d571 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,9 +4,9 @@ on: push: branches: - main - - main-v[0-9].** + - main-v[0-9]+.** tags: - - v[0-9].** + - v[0-9]+.** pull_request: types: @@ -16,6 +16,9 @@ on: - auto_merge_enabled - edited + merge_group: + types: [checks_requested] + jobs: commitlint: runs-on: ubuntu-latest diff --git a/.github/workflows/compiled_cairo.yml b/.github/workflows/compiled_cairo.yml deleted file mode 100644 index 747c6349..00000000 --- a/.github/workflows/compiled_cairo.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: CI - -on: - push: - branches: - - main - tags: - - v[0-9].** - - pull_request: - types: - - opened - - reopened - - synchronize - paths: - - 'crates/blockifier/feature_contracts/cairo0/**' - -jobs: - verify_cairo_file_dependencies: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@master - with: - components: rustfmt - toolchain: nightly-2024-01-12 - - uses: Swatinem/rust-cache@v2 - - uses: actions/setup-python@v4 - with: - python-version: '3.9' - cache: 'pip' - - run: - pip install -r crates/blockifier/tests/requirements.txt; - cargo test verify_feature_contracts -- --include-ignored diff --git a/.github/workflows/post-merge.yml b/.github/workflows/post-merge.yml index b93bc468..bf484c6f 100644 --- a/.github/workflows/post-merge.yml +++ b/.github/workflows/post-merge.yml @@ -15,10 +15,5 @@ jobs: components: rustfmt toolchain: nightly-2024-01-12 - uses: Swatinem/rust-cache@v2 - - uses: actions/setup-python@v4 - with: - python-version: '3.9' - cache: 'pip' - run: - pip install -r crates/blockifier/tests/requirements.txt; cargo test -- --include-ignored diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 00000000..951d56ca --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,32 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "committer" +version = "0.1.0-rc.0" +dependencies = [ + "pretty_assertions", +] + +[[package]] +name = "diff" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" + +[[package]] +name = "pretty_assertions" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af7cee1a6c8a5b9208b3cb1061f10c0cb689087b3d8ce85fb9d2dd7a29b6ba66" +dependencies = [ + "diff", + "yansi", +] + +[[package]] +name = "yansi" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 00000000..c0cc4700 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,26 @@ +[workspace] +# Using version 2 to avoid unifying features. For more info, read: +# https://doc.rust-lang.org/cargo/reference/resolver.html#feature-resolver-version-2 +resolver = "2" + +members = ["crates/committer"] + +[workspace.package] +version = "0.1.0-rc.0" +edition = "2021" +repository = "https://github.com/starkware-libs/committer/" +license = "Apache-2.0" +license-file = "LICENSE" + +[workspace.dependencies] +pretty_assertions = "1.2.1" + +[workspace.lints.rust] +warnings = "deny" +future-incompatible = "deny" +nonstandard-style = "deny" +rust-2018-idioms = "deny" +unused = "deny" + +[workspace.lints.clippy] +as_conversions = "deny" diff --git a/commitlint.config.js b/commitlint.config.js new file mode 100644 index 00000000..9b454b82 --- /dev/null +++ b/commitlint.config.js @@ -0,0 +1,53 @@ +const Configuration = { + /* + * Resolve and load @commitlint/config-conventional from node_modules. + * Referenced packages must be installed. + * See [the README](https://github.com/conventional-changelog/commitlint/blob/master/%40commitlint/config-conventional/README.md) + * for applied rules. + */ + extends: ['@commitlint/config-conventional'], + /* + * Resolve and load conventional-changelog-atom from node_modules. + * Referenced packages must be installed + */ + // parserPreset: 'conventional-changelog-atom', + /* + * Resolve and load @commitlint/format from node_modules. + * Referenced package must be installed + */ + formatter: '@commitlint/format', + /* + * Any rules defined here will override rules from @commitlint/config-conventional + */ + rules: { + 'scope-enum': [2, 'always', [ + 'ci', + ]], + }, + /* + * Functions that return true if commitlint should ignore the given message. + */ + ignores: [(commit) => commit === ''], + /* + * Whether commitlint uses the default ignore rules. + */ + defaultIgnores: true, + /* + * Custom URL to show upon failure + */ + helpUrl: + 'https://github.com/conventional-changelog/commitlint/#what-is-commitlint', + /* + * Custom prompt configs, not used currently. + */ + prompt: { + messages: {}, + questions: { + type: { + description: 'please input type:', + }, + }, + }, +}; + +module.exports = Configuration; diff --git a/crates/committer/Cargo.toml b/crates/committer/Cargo.toml new file mode 100644 index 00000000..ad4ec450 --- /dev/null +++ b/crates/committer/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "committer" +version.workspace = true +edition.workspace = true +repository.workspace = true +license-file.workspace = true +description = "Computes and manages Starknet state." + +[lints] +workspace = true + +[dev-dependencies] +pretty_assertions.workspace = true diff --git a/crates/committer/src/lib.rs b/crates/committer/src/lib.rs new file mode 100644 index 00000000..6121599b --- /dev/null +++ b/crates/committer/src/lib.rs @@ -0,0 +1,15 @@ +// TODO(Dori, 3/3/2024): Delete this dummy code. +pub fn dummy() -> u8 { + 7 +} + +#[cfg(test)] +pub mod test { + use super::dummy; + use pretty_assertions::assert_eq; + + #[test] + fn test_dummy() { + assert_eq!(dummy(), 7); + } +} diff --git a/scripts/merge_paths.json b/scripts/merge_paths.json index 34de8855..0967ef42 100644 --- a/scripts/merge_paths.json +++ b/scripts/merge_paths.json @@ -1,3 +1 @@ -{ - "main-v0.13.1": "main" -} +{} diff --git a/scripts/merge_paths_test.py b/scripts/merge_paths_test.py index 3b083904..1d8f471a 100755 --- a/scripts/merge_paths_test.py +++ b/scripts/merge_paths_test.py @@ -4,6 +4,10 @@ def test_linear_path(): merge_paths = load_merge_paths() + # No feature branches means nothing to test. + if len(merge_paths) == 0: + return + src_dst_iter = iter(merge_paths.items()) (oldest_branch, prev_dst_branch) = next(src_dst_iter) assert (