Skip to content

Commit

Permalink
Merge branch 'master' into phated/lsp-wasm
Browse files Browse the repository at this point in the history
  • Loading branch information
TomAFrench authored Oct 25, 2023
2 parents 43ec9dc + 3866d7e commit c584fdd
Show file tree
Hide file tree
Showing 377 changed files with 5,069 additions and 1,697 deletions.
4 changes: 2 additions & 2 deletions .github/actions/docs/build-status/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ while [[ "$DEPLOY_STATUS" != "ready" && $COUNT -lt $MAX_RETRIES ]]; do
exit 0
elif [[ "$DEPLOY_STATUS" == "error" ]]; then
echo "deploy_status=failure" >> $GITHUB_OUTPUT
exit 0
exit 1
fi

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

echo "deploy_status=failure" >> $GITHUB_OUTPUT
exit 0
exit 1
58 changes: 52 additions & 6 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,57 @@ on:
- opened
- synchronize
- labeled
push:
paths:
- 'docs/**'

jobs:

build_and_deploy:
add_label:
runs-on: ubuntu-latest
outputs:
has_label: ${{ steps.check-labels.outputs.result }}
steps:
- name: Check if label is present
id: check-labels
uses: actions/github-script@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const labels = context.payload.pull_request.labels.map(label => label.name);
if (labels.includes('documentation')) {
return true;
}
// Fetch the list of files changed in the PR
const { data: files } = await github.pulls.listFiles({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number
});
// Check if any file is within the 'docs' folder
const docsChanged = files.some(file => file.filename.startsWith('docs/'));
return docsChanged;
- name: Add label if not present
if: steps.check-labels.outputs.result == 'true'
uses: actions/github-script@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const labels = context.payload.pull_request.labels.map(label => label.name);
if (!labels.includes('documentation')) {
github.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
labels: ['documentation']
})
}
deploy_docs:
runs-on: ubuntu-latest
permissions:
pull-requests: write
if: contains(github.event.pull_request.labels.*.name, 'documentation')
needs: add_label
if: needs.add_label.outputs.has_label == 'true'
steps:
- name: Checkout code
uses: actions/checkout@v2
Expand Down Expand Up @@ -60,9 +100,11 @@ jobs:
site-id: ${{ secrets.NETLIFY_SITE_ID }}
continue-on-error: true


- name: Debugging - print deploy_status
run: echo "${{ steps.check_deploy_status.outputs.deploy_status }}"


- name: Change PR Comment for Successful Deployment
if: steps.check_deploy_status.outputs.deploy_status == 'success'
uses: mshick/add-pr-comment@v2
Expand Down Expand Up @@ -94,3 +136,7 @@ jobs:
Deployment didn't succeed. Please check logs below and resolve the issue 🧐
[![Netlify Status](https://api.netlify.com/api/v1/badges/${{ secrets.NETLIFY_SITE_ID }}/deploy-status?branch=${{ github.head_ref || github.ref }})](https://app.netlify.com/sites/noir-docs-v2/deploys)
- name: Fail the workflow if deployment failed
if: steps.check_deploy_status.outputs.deploy_status == 'failure'
run: exit 1
90 changes: 90 additions & 0 deletions .github/workflows/gates_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: Report gates diff

on:
push:
branches:
- master
pull_request:

jobs:
build-nargo:
runs-on: ubuntu-latest
strategy:
matrix:
target: [x86_64-unknown-linux-gnu]

steps:
- name: Checkout Noir repo
uses: actions/checkout@v4

- name: Setup toolchain
uses: dtolnay/[email protected]

- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.target }}
cache-on-failure: true
save-if: ${{ github.event_name != 'merge_group' }}

- name: Build Nargo
run: cargo build --package nargo_cli --release

- name: Package artifacts
run: |
mkdir dist
cp ./target/release/nargo ./dist/nargo
7z a -ttar -so -an ./dist/* | 7z a -si ./nargo-x86_64-unknown-linux-gnu.tar.gz
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: nargo
path: ./dist/*
retention-days: 3


compare_gas_reports:
needs: [build-nargo]
runs-on: ubuntu-latest
permissions:
pull-requests: write

steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Download nargo binary
uses: actions/download-artifact@v3
with:
name: nargo
path: ./nargo

- name: Set nargo on PATH
run: |
nargo_binary="${{ github.workspace }}/nargo/nargo"
chmod +x $nargo_binary
echo "$(dirname $nargo_binary)" >> $GITHUB_PATH
export PATH="$PATH:$(dirname $nargo_binary)"
nargo -V
- name: Generate gates report
working-directory: ./tooling/nargo_cli/tests
run: |
./gates_report.sh
mv gates_report.json ../../../gates_report.json
- name: Compare gates reports
id: gates_diff
uses: TomAFrench/noir-gates-diff@e7cf131b7e7f044c01615f93f0b855f65ddc02d4
with:
report: gates_report.json
summaryQuantile: 0.9 # only display the 10% most significant circuit size diffs in the summary (defaults to 20%)

- name: Add gates diff to sticky comment
if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target'
uses: marocchino/sticky-pull-request-comment@v2
with:
# delete the comment in case changes no longer impact circuit sizes
delete: ${{ !steps.gates_diff.outputs.markdown }}
message: ${{ steps.gates_diff.outputs.markdown }}
7 changes: 6 additions & 1 deletion .github/workflows/test-acvm-js.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: Test acvm_js

on: [push, pull_request]
on:
pull_request:
merge_group:
push:
branches:
- master

# This will cancel previous runs when a branch or PR is updated
concurrency:
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/test-noir_wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,16 @@ jobs:
name: nargo
path: ./nargo

- name: Compile test program with Nargo CLI
working-directory: ./compiler/wasm/noir-script
- name: Compile fixtures with Nargo CLI
working-directory: ./compiler/wasm/fixtures
run: |
nargo_binary=${{ github.workspace }}/nargo/nargo
chmod +x $nargo_binary
$nargo_binary compile
for dir in $(ls -d */); do
pushd $dir/noir-script
$nargo_binary compile
popd
done
- name: Install Yarn dependencies
uses: ./.github/actions/setup
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ result
!tooling/nargo_cli/tests/acir_artifacts/*/target
!tooling/nargo_cli/tests/acir_artifacts/*/target/witness.gz
!compiler/wasm/noir-script/target

gates_report.json

# Github Actions scratch space
# This gives a location to download artifacts into the repository in CI without making git dirty.
libbarretenberg-wasm32
Expand Down
4 changes: 2 additions & 2 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
".": "0.16.0",
"acvm-repo": "0.28.0"
".": "0.18.0",
"acvm-repo": "0.30.0"
}
Loading

0 comments on commit c584fdd

Please sign in to comment.