diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0d2030e..68c9c7e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,15 +8,36 @@ on: env: CARGO_TERM_COLOR: always + MINIMUM_NOIR_VERSION: v0.37.0 jobs: + noir-version-list: + name: Query supported Noir versions + runs-on: ubuntu-latest + outputs: + noir_versions: ${{ steps.get_versions.outputs.versions }} + + steps: + - name: Checkout sources + id: get_versions + run: | + # gh returns the Noir releases in reverse chronological order so we keep all releases published after the minimum supported version. + VERSIONS=$(gh release list -R noir-lang/noir --exclude-pre-releases --json tagName -q 'map(.tagName) | index(env.MINIMUM_NOIR_VERSION) as $index | if $index then .[0:$index+1] else [env.MINIMUM_NOIR_VERSION] end') + echo "versions=$VERSIONS" + echo "versions=$VERSIONS" >> $GITHUB_OUTPUT + env: + GH_TOKEN: ${{ github.token }} + test: + needs: [noir-version-list] name: Test on Nargo ${{matrix.toolchain}} runs-on: ubuntu-latest strategy: fail-fast: false matrix: - toolchain: [nightly, 0.37.0] + toolchain: ${{ fromJson( needs.noir-version-list.outputs.noir_versions )}} + include: + - toolchain: nightly steps: - name: Checkout sources uses: actions/checkout@v4 @@ -38,8 +59,7 @@ jobs: - name: Install Nargo uses: noir-lang/noirup@v0.1.3 with: - toolchain: 0.37.0 - + toolchain: ${{ env.MINIMUM_NOIR_VERSION }} - name: Run formatter run: nargo fmt --check @@ -64,4 +84,4 @@ jobs: fi env: # We treat any cancelled, skipped or failing jobs as a failure for the workflow as a whole. - FAIL: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped') }} + FAIL: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped') }} \ No newline at end of file diff --git a/Nargo.toml b/Nargo.toml index 628b216..91e7ae5 100644 --- a/Nargo.toml +++ b/Nargo.toml @@ -5,4 +5,4 @@ authors = [""] compiler_version = ">=0.37.0" [dependencies] -noir_sort = {tag = "v0.2.0", git = "https://github.com/noir-lang/noir_sort"} \ No newline at end of file +noir_sort = {tag = "v0.2.1", git = "https://github.com/noir-lang/noir_sort"} \ No newline at end of file diff --git a/src/get_literal.nr b/src/get_literal.nr index 6e2d0d3..f3693ab 100644 --- a/src/get_literal.nr +++ b/src/get_literal.nr @@ -13,7 +13,7 @@ global LITERAL_OFFSET_SHIFT: [Field; 6] = * @brief a JSON "literal" type has 3 states: "true", "false", "null". * As such we can't directly convert to a bool and cover all possible cases **/ -struct JSONLiteral { +pub struct JSONLiteral { value: Field, } diff --git a/src/getters.nr b/src/getters.nr index a7144bd..faa1661 100644 --- a/src/getters.nr +++ b/src/getters.nr @@ -12,7 +12,7 @@ use crate::transcript_entry::TranscriptEntry; /** * @brief records data used to reason about whether a key exists in a json blob **/ -struct KeySearchResult { +pub struct KeySearchResult { found: bool, // does the key exist? target_lt_smallest_entry: bool, // is the target keyhash smaller than the smallest keyhash in self.key_hashes? target_gt_largest_entry: bool, // is the target keyhash larger than the largest keyhash in self.key_hashes? diff --git a/src/json.nr b/src/json.nr index b07c96b..d412ede 100644 --- a/src/json.nr +++ b/src/json.nr @@ -20,7 +20,7 @@ use crate::transcript_entry::{ /** * @brief records a value in a json blob **/ -struct JSONValue { +pub struct JSONValue { value: BoundedVec, // raw bytes that constitute the json value entry value_type: Field, // either STRING_TOKEN, NUMERIC_TOKEN or LITERAL_TOKEN } @@ -42,7 +42,7 @@ impl JSONValue { * @description The "root" of the JSON refers to the parent object or array (or a value if the json is just a single value e.g. text = "\"foo\": \"bar\"") * @note text that describes just a single JSON value is not yet fully supported. Only use this library for processing objects or arrays for now **/ -struct JSON { +pub struct JSON { json: [u8; NumBytes], // the raw json bytes json_packed: [Field; NumPackedFields], // raw bytes, but packed into 31-byte Field elements raw_transcript: [Field; MaxNumTokens], // transcript of json tokens after basic processing