Repository navigation
feat(witness): add -stats_assets_mapping to count users by asset count #13
This file contains hidden or 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
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.22" | |
| - name: Build | |
| run: go build ./... | |
| test-utils: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.22" | |
| - name: Run utils tests | |
| run: | | |
| go test ./src/utils/ -v -run "TestComputeUserAssetsCommitment|TestParseUserDataSet|TestParseCexAssetInfoFromFile|TestParseTiers" -timeout 120s | |
| test-merkletree: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.22" | |
| - name: Run merkle tree tests | |
| run: | | |
| go test ./src/utils/merkletree/ -v -run "^Test" -timeout 120s | |
| test-circuit: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.22" | |
| - name: Run circuit tests | |
| run: | | |
| go test ./circuit/ -v -run "TestBatchCreateUserCircuit$|TestSetBatchCreateUserCircuitWitness|TestGetAndCheckTierRatiosQueryResultsEdgeCases|TestGetAndCheckTierRatiosQueryResultsMultiAssetOffsetIsolation|TestCollateralFlagBypassShouldFail|TestMockRandomLinearCombinationCircuit" -timeout 1200s | |
| test-integration: | |
| runs-on: ubuntu-latest | |
| services: | |
| mysql: | |
| image: mysql:8.0 | |
| env: | |
| MYSQL_ROOT_PASSWORD: root | |
| MYSQL_DATABASE: zkpos | |
| MYSQL_USER: zkpos | |
| MYSQL_PASSWORD: "zkpos@123" | |
| ports: | |
| - 3306:3306 | |
| options: >- | |
| --health-cmd="mysqladmin ping -h 127.0.0.1" | |
| --health-interval=10s | |
| --health-timeout=5s | |
| --health-retries=10 | |
| redis: | |
| image: redis:7 | |
| ports: | |
| - 6379:6379 | |
| options: >- | |
| --health-cmd="redis-cli ping" | |
| --health-interval=10s | |
| --health-timeout=5s | |
| --health-retries=5 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.22" | |
| - name: Wait for MySQL to be ready | |
| run: | | |
| for i in $(seq 1 30); do | |
| if mysqladmin ping -h 127.0.0.1 -u zkpos -p"zkpos@123" --silent 2>/dev/null; then | |
| echo "MySQL is ready" | |
| break | |
| fi | |
| echo "Waiting for MySQL... ($i)" | |
| sleep 2 | |
| done | |
| - name: Run integration tests | |
| env: | |
| TEST_MYSQL_DSN: "zkpos:zkpos@123@tcp(127.0.0.1:3306)/zkpos?parseTime=true" | |
| TEST_REDIS_ADDR: "127.0.0.1:6379" | |
| run: | | |
| go test ./src/prover/prover/ -v -run TestMockProver -timeout 300s |