-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Testing and drift testing #65
Merged
+195
−22
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
65de5d7
feat: adding some CI to vite-hardhat
signorecello b018ca7
Adding some drift testing
signorecello 556514b
fixes
signorecello 86218e0
fixes
signorecello c545fe9
fixing yarn lock
signorecello 1aff40d
wrapping up
signorecello File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Install Yarn dependencies | ||
description: Installs the workspace's yarn dependencies and caches them | ||
inputs: | ||
project: | ||
description: The project to install dependencies for | ||
required: true | ||
version: | ||
description: The version of the project to install dependencies for | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Enable Corepack before setting up Node | ||
run: corepack enable | ||
shell: bash | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: '${{ inputs.project }}/package.json' | ||
cache: 'yarn' | ||
|
||
- name: Install | ||
run: yarn --immutable | ||
shell: bash | ||
|
||
- name: Install Nargo | ||
uses: noir-lang/[email protected] | ||
with: | ||
toolchain: ${{ inputs.version }} | ||
|
||
- name: Use Nargo | ||
run: nargo --version | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
const { writeFileSync } = require('fs'); | ||
|
||
async function main() { | ||
const fetchOpts = { | ||
headers: {}, | ||
}; | ||
|
||
if (process.env.GITHUB_TOKEN) | ||
fetchOpts.headers = { Authorization: `token ${process.env.GITHUB_TOKEN}` }; | ||
|
||
const res = await fetch('https://api.github.com/repos/noir-lang/noir/releases', fetchOpts); | ||
|
||
const data = await res.json(); | ||
|
||
const filtered = data.filter( | ||
release => !release.tag_name.includes('aztec') && !release.tag_name.includes('nightly'), | ||
); | ||
|
||
const latestStable = filtered.find(release => !release.prerelease).tag_name; | ||
const latestPreRelease = filtered.find(release => release.prerelease).tag_name; | ||
|
||
// TODO: add the prerelease to this object! | ||
const workflowOutput = JSON.stringify({ stable: latestStable }); | ||
console.log(workflowOutput); // DON'T REMOVE, GITHUB WILL CAPTURE THIS OUTPUT | ||
} | ||
|
||
main(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
name: Nightly drift test | ||
|
||
on: | ||
# Giving ourselves a way to trigger this manually | ||
workflow_dispatch: | ||
schedule: | ||
# Run a nightly release at 2 AM UTC | ||
- cron: '0 2 * * *' | ||
|
||
jobs: | ||
setup: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
matrix: ${{ steps.set-matrix.outputs.matrix }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Get versions to test for drift | ||
id: versions_step | ||
run: | | ||
output=$(node ./.github/scripts/latest.js) | ||
echo "Output from Node.js script: $output" | ||
echo "::set-output name=versionArray::$output" | ||
|
||
- name: Set Up Matrix | ||
id: set-matrix | ||
run: | | ||
VERSIONS='${{ steps.versions_step.outputs.versionArray }}' | ||
echo "Versions for Matrix: $VERSIONS" | ||
MATRIX=$(echo "$VERSIONS" | jq -c '{versions: .} | .versions | to_entries | map({key: .key, value: (.value | sub("^v"; ""))})') | ||
echo "::set-output name=matrix::{\"include\":$MATRIX}" | ||
|
||
test-drift-vite-hardhat: | ||
needs: setup | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: vite-hardhat | ||
strategy: | ||
matrix: ${{fromJson(needs.setup.outputs.matrix)}} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up test environment | ||
uses: ./.github/actions/setup | ||
with: | ||
project: vite-hardhat | ||
version: ${{ matrix.value }} | ||
|
||
- name: Install test version | ||
run: | | ||
yarn add \ | ||
@noir-lang/noir_js@${{ matrix.value }} \ | ||
@noir-lang/backend_barretenberg@${{ matrix.value }} \ | ||
@noir-lang/noir_wasm@${{ matrix.value }} \ | ||
@noir-lang/types@${{ matrix.value }} | ||
|
||
- name: 'Create env file' | ||
run: | | ||
touch .env | ||
echo SEPOLIA_ALCHEMY_KEY="${{ secrets.SEPOLIA_ALCHEMY_KEY }}" >> .env | ||
echo SEPOLIA_DEPLOYER_PRIVATE_KEY="${{ secrets.SEPOLIA_DEPLOYER_PRIVATE_KEY }}" >> .env | ||
echo MUMBAI_ALCHEMY_KEY"=${{ secrets.MUMBAI_ALCHEMY_KEY }}" >> .env | ||
echo MUMBAI_DEPLOYER_PRIVATE_KEY="${{ secrets.MUMBAI_DEPLOYER_PRIVATE_KEY }}" >> .env | ||
|
||
- name: Generate verifier contract | ||
run: | | ||
nargo codegen-verifier | ||
working-directory: vite-hardhat/circuits | ||
|
||
- name: Run test | ||
run: yarn test | ||
continue-on-error: ${{ matrix.key == 'prerelease' }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: PR - vite-hardhat | ||
on: | ||
pull_request: | ||
paths: | ||
- 'vite-hardhat/**' | ||
|
||
jobs: | ||
test-vite-hardhat: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: vite-hardhat | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Enable Corepack before setting up Node | ||
run: corepack enable | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20.10.0 | ||
cache: 'yarn' | ||
|
||
- name: Install | ||
run: yarn --immutable | ||
shell: bash | ||
|
||
- name: 'Create env file' | ||
run: | | ||
touch .env | ||
echo SEPOLIA_ALCHEMY_KEY="${{ secrets.SEPOLIA_ALCHEMY_KEY }}" >> .env | ||
echo SEPOLIA_DEPLOYER_PRIVATE_KEY="${{ secrets.SEPOLIA_DEPLOYER_PRIVATE_KEY }}" >> .env | ||
echo MUMBAI_ALCHEMY_KEY"=${{ secrets.MUMBAI_ALCHEMY_KEY }}" >> .env | ||
echo MUMBAI_DEPLOYER_PRIVATE_KEY="${{ secrets.MUMBAI_DEPLOYER_PRIVATE_KEY }}" >> .env | ||
|
||
- name: Run test | ||
run: yarn test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,37 @@ | ||
# a github workflow that runs curl -L https://foundry.paradigm.xyz | bash then nargo codegen-verifier then nargo prove p | ||
|
||
name: Run Tests on PR | ||
name: PR - with-foundry | ||
on: | ||
pull_request: | ||
paths: | ||
- 'with-foundry/**' | ||
|
||
jobs: | ||
test: | ||
test-with-foundry: | ||
defaults: | ||
run: | ||
working-directory: with-foundry | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Install Nargo | ||
uses: noir-lang/[email protected] | ||
with: | ||
toolchain: 0.11.0 | ||
- name: Install Nargo | ||
uses: noir-lang/[email protected] | ||
with: | ||
toolchain: 0.11.0 | ||
|
||
- name: Install Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
- name: Install Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
|
||
- name: Generate verifier contract | ||
run: | | ||
nargo codegen-verifier | ||
working-directory: with-foundry/circuits | ||
- name: Generate verifier contract | ||
run: | | ||
nargo codegen-verifier | ||
working-directory: with-foundry/circuits | ||
|
||
- name: Generate proof | ||
run: | | ||
nargo prove | ||
working-directory: with-foundry/circuits | ||
- name: Generate proof | ||
run: | | ||
nargo prove | ||
working-directory: with-foundry/circuits | ||
|
||
- name: Test with Foundry | ||
run: | | ||
forge test --optimize --optimizer-runs 5000 --evm-version london | ||
- name: Test with Foundry | ||
run: | | ||
forge test --optimize --optimizer-runs 5000 --evm-version london |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,6 @@ | |
|
||
node_modules | ||
package-lock.json | ||
|
||
# To use with nektos/act | ||
.github/event.json |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @catmcgee as this may be a useful reference for seeing how to get the latest release info from an external repo.