Skip to content

Commit

Permalink
Merge branch 'master' into kh-update-nix
Browse files Browse the repository at this point in the history
* master: (242 commits)
  chore(docs): Update Windows installation  (#3326)
  chore!: change stdlib function `pedersen` to `pedersen_commitment` (#3341)
  chore: add back algolia recrawler (#3332)
  chore: comment out algolia recrawler workflow as its failing master (#3331)
  chore: Modify single line if-else expression width threshold (#3329)
  feat: Expand trait impl overlap check to cover generic types (#3320)
  feat: Implement where clauses on impls (#3324)
  chore: builtin wrapping shift left (#3270)
  chore: format integration tests  (#3257)
  fix(3300): cache warnings into debug artefacts (#3313)
  fix(3275): activate brillig modulo test with negative integers (#3318)
  feat: Add check for overlapping generic traits (#3307)
  feat: Refactor debugger and separate core from UI (#3308)
  chore: recrawl docs on merge (#3306)
  chore: add bn254 attribute when needed in the stdlib (#3208)
  feat: add exports of JS black box solvers to noirJS (#3295)
  chore: upload acir artifacts as a github artifact (#3288)
  chore: bump bb version to 0.12.0 (#3304)
  chore(docs): Supplement descriptions for defaulting loop indices to be `u64` (#3237)
  chore: create publish-docs.yml (#3298)
  ...
  • Loading branch information
TomAFrench committed Oct 30, 2023
2 parents eea9a84 + 7d126c5 commit 025a8c0
Show file tree
Hide file tree
Showing 1,307 changed files with 64,965 additions and 13,541 deletions.
22 changes: 11 additions & 11 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
module.exports = {
root: true,
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint", "prettier"],
extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
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"
'comma-spacing': ['error', { before: false, after: true }],
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': [
'warn', // or "error"
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
},
],
"prettier/prettier": "error",
'prettier/prettier': 'error',
},
};
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 @@
#!/bin/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
27 changes: 27 additions & 0 deletions .github/actions/nix/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Setup Nix
description: Installs and setups Nix components

inputs:
github-token:
description: 'Github Access Token'
required: true
nix-cache-name:
description: 'Name of the Cachix cache to use'
required: true
cachix-auth-token:
description: 'Cachix Auth Token'
required: true


runs:
using: composite
steps:
- uses: cachix/install-nix-action@v22
with:
nix_path: nixpkgs=channel:nixos-23.05
github_access_token: ${{ inputs.github-token }}

- uses: cachix/cachix-action@v12
with:
name: ${{ inputs.nix-cache-name }}
authToken: ${{ inputs.cachix-auth-token }}
3 changes: 0 additions & 3 deletions .github/labeler.yml

This file was deleted.

26 changes: 6 additions & 20 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,23 @@
# Description

<!-- Thanks for taking the time to improve Noir! -->
<!-- Please fill out all fields marked with an asterisk (*). -->

## Problem\*

<!-- Describe the problem this Pull Request (PR) resolves / link to the GitHub Issue that describes the problem. -->

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

## Summary\*

<!-- Describe the changes in this PR. -->
<!-- Supplement code examples and highlight breaking changes, if applicable. -->

## Documentation

- [ ] This PR requires documentation updates when merged.

<!-- If checked, check one of the following: -->

- [ ] I will submit a noir-lang/docs PR.

<!-- Submit a PR on https://github.com/noir-lang/docs. Thank you! -->
## Additional Context

- [ ] I will request for and support Dev Rel's help in documenting this PR.

<!-- List / highlight what should be documented. -->
<!-- Dev Rel will reach out for clarifications when needed. Thank you! -->

## Additional Context
## Documentation\*

<!-- Supplement further information if applicable. -->
Check one:
- [ ] No documentation needed.
- [ ] Documentation included in this PR.
- [ ] **[Exceptional Case]** Documentation to be submitted in a separate PR.

# PR Checklist\*

Expand Down
126 changes: 126 additions & 0 deletions .github/workflows/auto-pr-rebuild-script.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
name: Rebuild ACIR artifacts

on:
pull_request:
push:
branches:
- master

jobs:
check-artifacts-requested:
name: Check if artifacts should be published
runs-on: ubuntu-22.04
outputs:
publish: ${{ steps.check.outputs.publish }}

steps:
- name: Check if artifacts should be published
id: check
run: |
if [ ${{ github.ref_name }} == "master" ]; then
# Always publish on master
echo "publish=true" >> "$GITHUB_OUTPUT"
else
# Only publish on PRs if label is set
HAS_ARTIFACT_LABEL=$(gh pr view $PR --repo $REPO_URL --json labels | jq '.labels | any(.name == "publish-acir")')
echo "publish=$HAS_ARTIFACT_LABEL" >> "$GITHUB_OUTPUT"
fi
env:
GH_TOKEN: ${{ github.token }}
PR: ${{ github.event.pull_request.number }}
REPO_URL: ${{ github.repositoryUrl }}

build-nargo:
name: Build nargo binary
runs-on: ubuntu-22.04
needs: [check-artifacts-requested]
if: ${{ needs.check-artifacts-requested.outputs.publish == true }}
strategy:
matrix:
target: [x86_64-unknown-linux-gnu]

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

- name: Setup toolchain
uses: dtolnay/rust-toolchain@1.66.0

- 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

auto-pr-rebuild-script:
name: Rebuild ACIR artifacts
needs: [build-nargo]
runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@v2

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

- name: Add Nargo to $PATH
run: |
chmod +x ${{ github.workspace }}/nargo/nargo
echo "${{ github.workspace }}/nargo" >> $GITHUB_PATH
- name: Set up Git user (Github Action)
run: |
git config --local user.name kevaundray
git config --local user.email kevtheappdev@gmail.com
- name: Run rebuild script
working-directory: tooling/nargo_cli/tests
run: |
chmod +x ./rebuild.sh
./rebuild.sh
- name: Upload ACIR artifacts
uses: actions/upload-artifact@v3
with:
name: acir-artifacts
path: ./tooling/nargo_cli/tests/acir_artifacts
retention-days: 10

- name: Check for changes in acir_artifacts directory
id: check_changes
if: ${{ github.ref_name }} == "master"
run: |
git diff --quiet tooling/nargo_cli/tests/acir_artifacts/ || echo "::set-output name=changes::true"
- name: Create or Update PR
if: steps.check_changes.outputs.changes == 'true'
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.NOIR_REPO_TOKEN }}
commit-message: "chore: update acir artifacts"
title: "chore: Update ACIR artifacts"
body: "Automatic PR to update acir artifacts"
add-paths: tooling/nargo_cli/tests/acir_artifacts/*.gz
labels: "auto-pr"
branch: "auto-pr-rebuild-script-branch"
Loading

0 comments on commit 025a8c0

Please sign in to comment.