Skip to content

Merge pull request #31 from AztecProtocol/update-examples-to-v4.1.0-rc.2 #41

Merge pull request #31 from AztecProtocol/update-examples-to-v4.1.0-rc.2

Merge pull request #31 from AztecProtocol/update-examples-to-v4.1.0-rc.2 #41

name: Prediction Market Tests
on:
push:
branches:
- next
pull_request:
branches:
- next
paths:
- "prediction-market/**"
- ".github/workflows/prediction-market-tests.yml"
workflow_dispatch:
jobs:
prediction-market-tests:
name: Prediction Market Tests
runs-on: ubuntu-latest
env:
AZTEC_ENV: local-network
AZTEC_VERSION: 4.1.0-rc.2
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: 1.1.36
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
- name: Install Aztec CLI
run: |
INSTALL_URL="https://install.aztec.network/${{ env.AZTEC_VERSION }}/"
curl -sL $INSTALL_URL > tmp.sh
VERSION=${{ env.AZTEC_VERSION }} bash tmp.sh <<< yes "yes"
- name: Update path
run: |
echo "$HOME/.aztec/current/bin" >> $GITHUB_PATH
echo "$HOME/.aztec/current/node_modules/.bin" >> $GITHUB_PATH
echo "$HOME/.aztec/bin" >> $GITHUB_PATH
- name: Start local Aztec network
run: aztec start --local-network &
- name: Wait for local network to be ready
run: |
echo "Waiting for local network to start..."
for i in {1..30}; do
if curl -s http://localhost:8080/status >/dev/null 2>&1; then
echo "Local network is ready!"
break
fi
echo "Waiting... ($i/30)"
sleep 5
done
- name: Install project dependencies
working-directory: prediction-market
run: bun install
- name: Run Noir unit tests
working-directory: prediction-market
run: |
ulimit -s unlimited
script -e -c "aztec test"
timeout-minutes: 10
- name: Compile contract and generate artifacts
working-directory: prediction-market
run: |
ulimit -s unlimited
script -e -c "aztec compile"
script -e -c "aztec codegen target -o artifacts"
- name: Run end-to-end tests
working-directory: prediction-market
run: bun test
timeout-minutes: 15
- name: Upload test results if failed
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-logs
path: |
prediction-market/tests/**/*.log
retention-days: 7