Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
TomAFrench committed Jan 14, 2025
0 parents commit a688aca
Show file tree
Hide file tree
Showing 3,035 changed files with 352,823 additions and 0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
1 change: 1 addition & 0 deletions .aztec-sync-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5e4b46d577ebf63114a5a5a1c5b6d2947d3b2567
24 changes: 24 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
module.exports = {
env: {
browser: true,
es6: true,
node: true,
},
root: true,
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint', 'prettier'],
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
rules: {
'comma-spacing': ['error', { before: false, after: true }],
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': [
'warn', // or "error"
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
},
],
'prettier/prettier': 'error',
},
};
12 changes: 12 additions & 0 deletions .github/ACVM_NOT_PUBLISHABLE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: "ACVM crates are not publishable"
assignees: TomAFrench, Savio-Sou
---

The ACVM crates are currently unpublishable, making a release will NOT push our crates to crates.io.

This is likely due to a crate we depend on bumping its MSRV above our own. Our lockfile is not taken into account when publishing to crates.io (as people downloading our crate don't use it) so we need to be able to use the most up-to-date versions of our dependencies (including transient dependencies) specified.

Check the [MSRV check]({{env.WORKFLOW_URL}}) workflow for details.

This issue was raised by the workflow `{{env.WORKFLOW_NAME}}`
10 changes: 10 additions & 0 deletions .github/ACVM_PUBLISH_FAILED.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: "ACVM crates failed to publish"
assignees: TomAFrench, Savio-Sou
---

The {{env.CRATE_VERSION}} release of the ACVM crates failed.

Check the [Publish ACVM crates]({{env.WORKFLOW_URL}}) workflow for details.

This issue was raised by the workflow `{{env.WORKFLOW_NAME}}`
10 changes: 10 additions & 0 deletions .github/CRATES_IO_PUBLISH_FAILED.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: "ACVM crates failed to publish"
assignees: TomAFrench, Savio-Sou
---

The {{env.CRATE_VERSION}} release of the ACVM crates failed.

Check the [Publish ACVM]({{env.WORKFLOW_URL}}) workflow for details.

This issue was raised by the workflow `{{env.WORKFLOW_NAME}}`
8 changes: 8 additions & 0 deletions .github/Cross.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[build.env]
passthrough = [
"HOME",
"RUST_BACKTRACE",
]
volumes = [
"HOME",
]
11 changes: 11 additions & 0 deletions .github/DEAD_LINKS_IN_DOCS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: "Docs contains dead links"
assignees: signorecello, catmcgee, critesjosh, jzaki, Savio-Sou
labels: documentation
---

Some of the external links in the docs are now dead. This is likely due to the thing being linked to being moved.

Check the [Check Markdown links]({{env.WORKFLOW_URL}}) workflow for details.

This issue was raised by the workflow `{{env.WORKFLOW_NAME}}`
11 changes: 11 additions & 0 deletions .github/JS_PUBLISH_FAILED.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: "JS packages failed to publish"
assignees: TomAFrench, Savio-Sou
labels: js
---

The {{env.NPM_TAG}} release of the JS packages failed.

Check the [Publish JS packages]({{env.WORKFLOW_URL}}) workflow for details.

This issue was raised by the workflow `{{env.WORKFLOW_NAME}}`
22 changes: 22 additions & 0 deletions .github/actions/docs/build-status/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: 'Get build status'
description: 'Gets the build status of a Netlify site'
inputs:
branch-name:
description: 'Branch name'
required: true
site-id:
description: Netlify site id
required: true
outputs:
deploy_status:
description: "The deploy status"
value: ${{ steps.check_deploy_status.outputs.deploy_status }}
runs:
using: "composite"
steps:
- run: ${{ github.action_path }}/script.sh
shell: bash
id: check_deploy_status
env:
BRANCH_NAME: ${{ inputs.branch-name }}
SITE_ID: ${{ inputs.site-id }}
28 changes: 28 additions & 0 deletions .github/actions/docs/build-status/script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env bash

BRANCH_NAME=$(echo "$BRANCH_NAME" | sed -e "s#refs/[^/]*/##")
DEPLOY_STATUS=$(curl -X GET "https://api.netlify.com/api/v1/sites/$SITE_ID/deploys?branch=$BRANCH_NAME" | jq -r '.[] | select(.created_at != null) | .state' | head -1)

echo "$SITE_ID"
MAX_RETRIES=10
COUNT=0
while [[ "$DEPLOY_STATUS" != "ready" && $COUNT -lt $MAX_RETRIES ]]; do
sleep 20
DEPLOY_STATUS=$(curl -X GET "https://api.netlify.com/api/v1/sites/$SITE_ID/deploys?branch=$BRANCH_NAME" | jq -r '.[] | select(.created_at != null) | .state' | head -1)
COUNT=$((COUNT+1))

echo "Deploy status: $DEPLOY_STATUS"
# If deploy status is ready, set the output and exit successfully
if [[ "$DEPLOY_STATUS" == "ready" ]]; then
echo "deploy_status=success" >> $GITHUB_OUTPUT
exit 0
elif [[ "$DEPLOY_STATUS" == "error" ]]; then
echo "deploy_status=failure" >> $GITHUB_OUTPUT
exit 1
fi

echo "Deploy still running. Retrying..."
done

echo "deploy_status=failure" >> $GITHUB_OUTPUT
exit 1
26 changes: 26 additions & 0 deletions .github/actions/install-playwright/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Install Playwright
description: Installs Playwright and its dependencies and caches them.

runs:
using: composite
steps:
# - name: Query playwright version
# shell: bash
# run: echo "PLAYWRIGHT_VERSION=$(yarn workspace @noir-lang/noirc_abi info @web/test-runner-playwright --json | jq .children.Version | tr -d '"')" >> $GITHUB_ENV

# - name: Cache playwright binaries
# uses: actions/cache@v4
# id: playwright-cache
# with:
# path: |
# ~/.cache/ms-playwright
# key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}

- name: Install playwright deps
shell: bash
# if: steps.playwright-cache.outputs.cache-hit != 'true'
run: |
# Workaround: https://github.com/microsoft/playwright/issues/30503#issuecomment-2074783821
sudo rm /etc/apt/sources.list.d/microsoft-prod.list
./.github/scripts/playwright-install.sh
16 changes: 16 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Install Yarn dependencies
description: Installs the workspace's yarn dependencies and caches them

runs:
using: composite
steps:
- uses: actions/setup-node@v4
id: node
with:
node-version: 18.19.0
cache: 'yarn'
cache-dependency-path: 'yarn.lock'

- name: Install
run: yarn --immutable
shell: bash
3 changes: 3 additions & 0 deletions .github/critical_libraries_status/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.actual.jsonl
.actual.jsonl.jq
.failures.jsonl.jq
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
20 changes: 20 additions & 0 deletions .github/critical_libraries_status/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Critical Libraries Status

This directory contains one `.failures.jsonl` file per external directory that is checked by CI.
CI will run the external repository tests and compare the test failures against those recorded
in these files. If there's a difference, CI will fail.

This allows us to mark some tests as expected to fail if we introduce breaking changes.
When tests are fixed on the external repository, CI will let us know that we need to remove
the `.failures.jsonl` failures on our side.

The format of the `.failures.jsonl` files is one JSON per line with a failure:

```json
{"suite":"one","name":"foo"}
```

If it's expected that an external repository doesn't compile (because a PR introduces breaking changes
to, say, the type system) you can remove the `.failures.jsonl` file for that repository and CI
will pass again. Once the repository compiles again, CI will let us know and require us to put
back the `.failures.jsonl` file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
25 changes: 25 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Description

## Problem\*

Resolves <!-- Link to GitHub Issue -->

## Summary\*



## Additional Context



## Documentation\*

Check one:
- [ ] No documentation needed.
- [ ] Documentation included in this PR.
- [ ] **[For Experimental Features]** Documentation to be submitted in a separate PR.

# PR Checklist\*

- [ ] I have tested the changes locally.
- [ ] I have formatted the changes with [Prettier](https://prettier.io/) and/or `cargo fmt` on default settings.
6 changes: 6 additions & 0 deletions .github/scripts/acvm_js-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
set -eu

.github/scripts/wasm-bindgen-install.sh
.github/scripts/wasm-opt-install.sh
yarn workspace @noir-lang/acvm_js build
5 changes: 5 additions & 0 deletions .github/scripts/acvm_js-test-browser.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
set -eu

./.github/scripts/playwright-install.sh
yarn workspace @noir-lang/acvm_js test:browser
4 changes: 4 additions & 0 deletions .github/scripts/acvm_js-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
set -eu

yarn workspace @noir-lang/acvm_js test
9 changes: 9 additions & 0 deletions .github/scripts/cargo-binstall-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash
set -eu

cd $(dirname "$0")

CARGO_BINSTALL_CHECK=$(./command-check.sh cargo-binstall)
if [ $CARGO_BINSTALL_CHECK != "true" ]; then
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
fi
39 changes: 39 additions & 0 deletions .github/scripts/check_test_results.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash
set -eu

# Usage: ./check_test_results.sh <expected.json> <actual.jsonl>
# Compares the output of two test results of the same repository.
# If any of the files doesn't exist or is empty, the script will consider that the test suite
# couldn't be compiled.

function process_json_lines() {
cat $1 | jq -c 'select(.type == "test" and .event == "failed") | {suite: .suite, name: .name}' | jq -s -c 'sort_by(.suite, .name) | .[]' > $1.jq
}

if [ -f $1 ] && [ -f $2 ]; then
# Both files exist, let's compare them
$(process_json_lines $2)
if ! diff $1 $2.jq; then
echo "Error: test failures don't match expected failures"
echo "Lines prefixed with '>' are new test failures (you could add them to '$1')"
echo "Lines prefixed with '<' are tests that were expected to fail but passed (you could remove them from '$1')"
exit -1
fi
elif [ -f $1 ]; then
# Only the expected file exists, which means the actual test couldn't be compiled.
echo "Error: external library tests couldn't be compiled."
echo "You could rename '$1' to '$1.does_not_compile' if it's expected that the external library can't be compiled."
exit -1
elif [ -f $2 ]; then
# Only the actual file exists, which means we are expecting the external library
# not to compile but it did.
echo "Error: expected external library not to compile, but it did."
echo "You could create '$1' with these contents:"
$(process_json_lines $2)
cat $2.jq
exit -1
else
# Both files don't exists, which means we are expecting the external library not
# to compile, and it didn't, so all is good.
exit 0
fi
4 changes: 4 additions & 0 deletions .github/scripts/command-check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
set -eu

command -v $1 >/dev/null 2>&1 && echo "true" || { echo >&2 "$1 is not installed" && echo "false"; }
5 changes: 5 additions & 0 deletions .github/scripts/integration-test-browser.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
set -eu

./.github/scripts/playwright-install.sh
yarn workspace integration-tests test:browser
5 changes: 5 additions & 0 deletions .github/scripts/integration-test-node.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
set -eu

apt-get install libc++-dev -y
yarn workspace integration-tests test:node
27 changes: 27 additions & 0 deletions .github/scripts/merge-bench-reports.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash
set -eu

echo "Merging reports"

REPORT_NAME=$1
NAME_PLURAL=""$REPORT_NAME"s"

combined_reports="[]"

# Iterate over each report and merge them
for report in ./reports/*; do
# The report is saved under ./$REPORT_NAME_{ matrix_report }/$REPORT_NAME_{ matrix_report }.json
FILE_PATH=$(echo $(ls $report))

# Extract the $NAME_PLURAL array from each report and merge it
combined_reports=$(jq '[."'"$NAME_PLURAL"'"[]] + '"$combined_reports" <<< "$(cat "$report/$FILE_PATH")")
done

combined_reports=$(jq '[."'$NAME_PLURAL'"[]] + '"$combined_reports" <<< "$(cat ./$REPORT_NAME.json)")

# Wrap the merged memory reports into a new object as to keep the $NAME_PLURAL key
final_report="{\"$NAME_PLURAL\": $combined_reports}"

echo "$final_report" > $REPORT_NAME.json

cat $REPORT_NAME.json
8 changes: 8 additions & 0 deletions .github/scripts/nargo-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
set -eu

export SOURCE_DATE_EPOCH=$(date +%s)
export GIT_DIRTY=false
export GIT_COMMIT=$(git rev-parse --verify HEAD)

cargo build --release
10 changes: 10 additions & 0 deletions .github/scripts/nargo-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
set -eu

apt-get install -y curl libc++-dev

export SOURCE_DATE_EPOCH=$(date +%s)
export GIT_DIRTY=false
export GIT_COMMIT=$(git rev-parse --verify HEAD)

cargo test --workspace --locked --release
4 changes: 4 additions & 0 deletions .github/scripts/noir-codegen-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
set -eu

yarn workspace @noir-lang/noir_codegen build
4 changes: 4 additions & 0 deletions .github/scripts/noir-codegen-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
set -eu

yarn workspace @noir-lang/noir_codegen test
4 changes: 4 additions & 0 deletions .github/scripts/noir-js-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
set -eu

yarn workspace @noir-lang/noir_js build
Loading

0 comments on commit a688aca

Please sign in to comment.