1- name : Run Tests and Scripts
1+ name : Sandbox Tests
22
33on :
44 push :
55 branches :
66 - main
7+ - dev
78 pull_request :
89 branches :
910 - main
1011 - dev
12+ workflow_dispatch :
1113
1214jobs :
13- setup-and-run :
15+ sandbox-tests :
16+ name : Sandbox Tests
1417 runs-on : ubuntu-latest
18+ env :
19+ AZTEC_ENV : sandbox
1520
1621 steps :
1722 - name : Checkout repository
@@ -21,10 +26,10 @@ jobs:
2126 uses : actions/setup-node@v4
2227 with :
2328 node-version : " 22"
24- cache : " yarn" # Optional: cache dependencies for faster builds
29+ cache : " yarn"
2530
2631 - name : Set up Docker
27- uses : docker/setup-buildx-action@v2
32+ uses : docker/setup-buildx-action@v3
2833
2934 - name : Install Aztec CLI
3035 run : |
@@ -39,28 +44,43 @@ jobs:
3944 VERSION=2.0.2 aztec-up
4045 aztec start --sandbox &
4146
47+ - name : Wait for sandbox to be ready
48+ run : |
49+ echo "Waiting for sandbox to start..."
50+ for i in {1..30}; do
51+ if curl -s http://localhost:8080/status >/dev/null 2>&1; then
52+ echo "✅ Sandbox is ready!"
53+ break
54+ fi
55+ echo "Waiting... ($i/30)"
56+ sleep 5
57+ done
58+
4259 - name : Install project dependencies
4360 run : yarn
4461
45- - name : Compile, generate code, and run tests
62+ - name : Compile contracts
4663 run : script -e -c "${AZTEC_NARGO:-aztec-nargo} compile"
4764
48- - name : Codegen
65+ - name : Generate contract artifacts
4966 run : script -e -c "aztec codegen target --outdir src/artifacts && aztec-postprocess-contract"
5067
51- - name : Change ownership # to get around Docker issues
68+ - name : Change ownership for nargo files
5269 run : sudo chown -R $(whoami) ~/nargo && sudo chown -R $(whoami) ~/nargo/github.com
5370
54- - name : Run tests
55- run : script -e -c "NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --no-cache --runInBand --config jest.integration.config.json && aztec test"
71+ - name : Run JavaScript tests
72+ run : |
73+ script -e -c "rm -rf store/pxe"
74+ script -e -c "NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --no-cache --runInBand --config jest.integration.config.json"
75+
76+ - name : Run Aztec tests
77+ run : script -e -c "aztec test"
5678
57- - name : Deploy account and capture SECRET/SIGNING_KEY/SALT
79+ - name : Deploy account and capture credentials
5880 run : |
5981 script -e -c "yarn clear-store"
60- # Create a temporary file to store the output
6182 TEMP_OUTPUT=$(mktemp)
6283
63- # Run deploy-account script and capture both stdout and stderr
6484 if script -e -c "yarn deploy-account" > "$TEMP_OUTPUT" 2>&1; then
6585 echo "✅ Deploy account script completed successfully"
6686 else
@@ -70,40 +90,28 @@ jobs:
7090 exit 1
7191 fi
7292
73- # Show the full output for debugging
7493 cat "$TEMP_OUTPUT"
7594
76- # Extract SECRET, SIGNING_KEY, and SALT from the output
7795 SECRET_KEY=$(grep -o "🔑 Secret key generated: 0x[a-fA-F0-9]*" "$TEMP_OUTPUT" | head -1 | sed 's/🔑 Secret key generated: //' || echo "")
7896 SIGNING_KEY=$(grep -o "🖊️ Signing key generated: 0x[a-fA-F0-9]*" "$TEMP_OUTPUT" | head -1 | sed 's/🖊️ Signing key generated: //' || echo "")
7997 SALT_VALUE=$(grep -o "🧂 Salt generated: 0x[a-fA-F0-9]*" "$TEMP_OUTPUT" | head -1 | sed 's/🧂 Salt generated: //' || echo "")
8098
81- # Clean up temp file
8299 rm "$TEMP_OUTPUT"
83100
84- # Validate and create .env file
85101 if [ -n "$SECRET_KEY" ] && [ -n "$SIGNING_KEY" ] && [ -n "$SALT_VALUE" ]; then
86-
87- # Create .env file with all necessary values
88102 echo "SECRET=\"$SECRET_KEY\"" >> .env
89103 echo "SIGNING_KEY=\"$SIGNING_KEY\"" >> .env
90104 echo "SALT=\"$SALT_VALUE\"" >> .env
91- echo "📋 Current .env file contents:"
92- cat .env
105+ echo "📋 Saved credentials to .env file"
93106 else
94- echo "❌ Failed to extract SECRET, SIGNING_KEY and/or SALT from deploy output"
95- echo "🔍 SECRET_KEY: '$SECRET_KEY'"
96- echo "🔍 SIGNING_KEY: '$SIGNING_KEY'"
97- echo "🔍 SALT_VALUE: '$SALT_VALUE'"
107+ echo "❌ Failed to extract SECRET, SIGNING_KEY, and/or SALT from deploy output"
98108 exit 1
99109 fi
100110
101111 - name : Deploy contract and capture address
102112 run : |
103- # Create a temporary file to store the output
104113 TEMP_OUTPUT=$(mktemp)
105114
106- # Run deploy script and capture both stdout and stderr
107115 if script -e -c "yarn deploy" > "$TEMP_OUTPUT" 2>&1; then
108116 echo "✅ Deploy script completed successfully"
109117 else
@@ -112,28 +120,23 @@ jobs:
112120 exit 1
113121 fi
114122
115- # Show the full output for debugging
116123 cat "$TEMP_OUTPUT"
117124
118- # Try multiple extraction patterns in order of preference
119125 VOTING_CONTRACT_ADDRESS=""
120-
121- # Look for "Contract address:" pattern
122126 if [ -z "$VOTING_CONTRACT_ADDRESS" ]; then
123127 VOTING_CONTRACT_ADDRESS=$(grep -o "Contract address: 0x[a-fA-F0-9]*" "$TEMP_OUTPUT" | head -1 | sed 's/Contract address: //' || echo "")
124128 fi
125129
126- # Clean up temp file
127130 rm "$TEMP_OUTPUT"
128131
129- # Validate and save the address
130132 if [ -n "$VOTING_CONTRACT_ADDRESS" ]; then
131133 echo "VOTING_CONTRACT_ADDRESS=\"$VOTING_CONTRACT_ADDRESS\"" >> .env
134+ echo "📋 Saved contract address to .env file"
132135 fi
133136
134- - name : Run other scripts
137+ - name : Run sandbox scripts
135138 run : |
136139 script -e -c "yarn fees"
137140 script -e -c "yarn multiple-pxe"
138141 script -e -c "yarn profile"
139- script -e -c "yarn interaction-existing-contract"
142+ script -e -c "yarn interaction-existing-contract"
0 commit comments