Skip to content

[MESA] Complete Cairo removal + updated branches #1686

[MESA] Complete Cairo removal + updated branches

[MESA] Complete Cairo removal + updated branches #1686

Workflow file for this run

name: Checks
on:
push:
branches:
- main
- develop
- v1
- v3
pull_request: {}
workflow_dispatch:
inputs:
proof_systems_commit:
description: 'proof_systems commit to use'
required: false
default: ''
workflow_call:
inputs:
proof_systems_commit:
description: 'proof_systems commit to use'
required: false
type: string
default: ''
target_repo:
required: false
type: string
target_ref:
required: false
type: string
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: write
jobs:
Prepare:
runs-on: ubuntu-latest
steps:
- name: Free space on runner
run: |
df -h
sudo rm -rf /usr/local/lib/android \
/usr/share/dotnet \
/opt/ghc \
"$AGENT_TOOLSDIRECTORY" || true
docker system prune -af --volumes || true
df -h
- name: Checkout repository with submodules
uses: actions/checkout@v4
with:
submodules: recursive
repository: ${{ inputs.target_repo || github.repository }}
ref: ${{ inputs.target_ref || github.ref }}
- name: Build
uses: ./.github/actions/build
with:
repository: ${{ inputs.target_repo || github.repository }}
ref: ${{ inputs.target_ref || github.ref }}
proof_systems_commit: ${{ inputs.proof_systems_commit }}
Lint-and-Format:
strategy:
matrix:
node: [22]
if: github.event.pull_request.labels.*.name != 'skip-lint'
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
repository: ${{ inputs.target_repo || github.repository }}
ref: ${{ inputs.target_ref || github.ref }}
- name: Setup Node.JS ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: Install Dependencies
run: npm ci
- name: Get Changed Files (Compare with Main)
id: get_changed_files
run: |
git fetch origin main --depth=1
# TODO ideally lint the non-generated files in src/bindings/
CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.ref }} | grep -E '\.(ts|js)$' | grep -v 'src/bindings/*' || true)
if [ -n "$CHANGED_FILES" ]; then
echo "Files changed:"
echo "$CHANGED_FILES"
echo "$CHANGED_FILES" > changed_files.txt
echo "files_changed=true" >> $GITHUB_OUTPUT
else
echo "No relevant files changed."
echo "files_changed=false" >> $GITHUB_OUTPUT
fi
- name: Run Prettier Check
if: steps.get_changed_files.outputs.files_changed == 'true'
run: xargs npm run format:check < changed_files.txt
- name: Run Oxlint
if: steps.get_changed_files.outputs.files_changed == 'true'
run: xargs npm run lint:strict < changed_files.txt
- name: Run Markdown Format Check
run: npm run format:md:check
Upload-bindings:
name: upload bindings artifact
if: ${{ inputs.proof_systems_commit == '' }}
runs-on: ubuntu-latest
steps:
- name: Free space on runner
run: |
df -h
sudo rm -rf /usr/local/lib/android \
/usr/share/dotnet \
/opt/ghc \
"$AGENT_TOOLSDIRECTORY" || true
docker system prune -af --volumes || true
df -h
- uses: actions/checkout@v4
with:
submodules: recursive
repository: ${{ inputs.target_repo || github.repository }}
ref: ${{ inputs.target_ref || github.ref }}
- name: upload
uses: ./.github/actions/upload
with:
cache_id: ${{ secrets.NIX_CACHE_GCP_ID }}
nar_secret: ${{ secrets.NIX_CACHE_NAR_SECRET }}
gcp_secret: ${{ secrets.NIX_CACHE_GCP_SECRET }}
Build-And-Test-Server:
needs: [Prepare]
timeout-minutes: 210
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
test_type:
[
'Simple integration tests',
'Reducer integration tests',
'DEX integration tests',
'DEX integration test with proofs',
'Voting integration tests',
'Verification Key Regression Check 1',
'Verification Key Regression Check 2',
'CommonJS test',
'Cache Regression',
'Performance Regression',
]
steps:
- name: Checkout repository with submodules
uses: actions/checkout@v4
with:
submodules: recursive
repository: ${{ inputs.target_repo || github.repository }}
ref: ${{ inputs.target_ref || github.ref }}
- name: build
uses: ./.github/actions/build
with:
repository: ${{ inputs.target_repo || github.repository }}
ref: ${{ inputs.target_ref || github.ref }}
proof_systems_commit: ${{ inputs.proof_systems_commit }}
- uses: 'google-github-actions/auth@v3'
name: Setup gcloud authentication
with:
credentials_json: '${{ secrets.GCP_O1JS_CI_BUCKET_SERVICE_ACCOUNT_KEY }}'
- name: Prepare for tests
run: touch profiling.md
- name: Execute tests
env:
TEST_TYPE: ${{ matrix.test_type }}
run: sh run-ci-tests.sh
- name: Add to job summary
if: always()
run: |
echo "### Test Results for ${{ matrix.test_type }}" >> $GITHUB_STEP_SUMMARY
cat profiling.md >> $GITHUB_STEP_SUMMARY
Run-Unit-Tests:
needs: [Prepare]
name: Run unit tests parallel
timeout-minutes: 210
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
chunk: [1, 2, 3, 4, 5, 6, 7, 8]
steps:
- name: Checkout repository with submodules
uses: actions/checkout@v4
with:
submodules: recursive
repository: ${{ inputs.target_repo || github.repository }}
ref: ${{ inputs.target_ref || github.ref }}
- name: build
uses: ./.github/actions/build
with:
repository: ${{ inputs.target_repo || github.repository }}
ref: ${{ inputs.target_ref || github.ref }}
proof_systems_commit: ${{ inputs.proof_systems_commit }}
- name: Count tests
id: count_tests
run: |
TEST_COUNT=$(find ./dist/node -name "*.unit-test.js" | wc -l)
echo "test_count=${TEST_COUNT}" >> $GITHUB_OUTPUT
echo "Total test count: ${TEST_COUNT}"
- name: Run unit tests
env:
TOTAL_TESTS: ${{ steps.count_tests.outputs.test_count }}
CHUNK: ${{ matrix.chunk }}
CHUNKS: 8
shell: bash
run: |
echo "Total tests: $TOTAL_TESTS"
echo "Current chunk: $CHUNK"
echo "Total chunks: $CHUNKS"
if [ -z "$TOTAL_TESTS" ] || [ "$TOTAL_TESTS" -eq 0 ]; then
echo "Error: TOTAL_TESTS is not set or is zero. Exiting."
exit 1
fi
start_index=$(( (TOTAL_TESTS * (CHUNK - 1) / CHUNKS) ))
end_index=$(( (TOTAL_TESTS * CHUNK / CHUNKS) ))
echo "Running tests from index $start_index to $end_index"
shopt -s globstar
test_files=(./dist/node/**/*.unit-test.js)
set -o pipefail
for ((i=start_index; i<end_index && i<${#test_files[@]}; i++)); do
echo "Running test: ${test_files[$i]}"
node --enable-source-maps "${test_files[$i]}" | tee -a profiling.md
done
continue-on-error: false
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results-${{ matrix.chunk }}
path: profiling.md
- name: Add to job summary
if: always()
shell: bash
run: |
echo "### Test Results for Unit Tests Chunk ${{ matrix.chunk }}" >> $GITHUB_STEP_SUMMARY
cat profiling.md >> $GITHUB_STEP_SUMMARY
Build-And-Test-Server-Unit-Tests:
name: Build-And-Test-Server (Unit tests)
needs: [Run-Unit-Tests]
runs-on: ubuntu-latest
steps:
- run: echo "All unit tests completed successfully"
Build-And-Test-Web:
needs: [Prepare]
timeout-minutes: 90
runs-on: ubuntu-latest
steps:
- name: Restore repository
uses: actions/cache@v4
with:
path: .
key: repo-${{ github.sha }}
- name: Setup Node.JS ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: 22
- name: Restore npm cache
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
- name: Cache Playwright browsers
uses: actions/cache@v4
id: playwright-cache
with:
path: ~/.cache/ms-playwright
key: ${{ runner.OS }}-playwright-${{ hashFiles('**/package-lock.json') }}
- name: Install Playwright browsers
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: npm run e2e:install
- name: Build o1js and prepare the web server
run: |
npm run build:web
npm run e2e:prepare-server
- name: Execute E2E tests
run: npm run test:e2e
- name: Upload E2E test artifacts
uses: actions/upload-artifact@v4
continue-on-error: true
if: always()
with:
if-no-files-found: ignore
name: e2e-tests-report
path: tests/report/
retention-days: 30
master:
needs: [Prepare]
timeout-minutes: 45
runs-on: ubuntu-latest
if: github.event.pull_request.base.ref == 'develop'
services:
mina-local-network:
image: o1labs/mina-local-network:master-latest-lightnet
env:
NETWORK_TYPE: 'single-node'
PROOF_LEVEL: 'none'
ports:
- 3085:3085
- 5432:5432
- 8080:8080
- 8181:8181
- 8282:8282
volumes:
- /tmp:/root/logs
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
repository: ${{ inputs.target_repo || github.repository }}
ref: ${{ inputs.target_ref || github.ref }}
- name: build
uses: ./.github/actions/build
with:
repository: ${{ inputs.target_repo || github.repository }}
ref: ${{ inputs.target_ref || github.ref }}
proof_systems_commit: ${{ inputs.proof_systems_commit }}
- name: Use shared steps for live testing jobs
uses: ./.github/actions/live-tests-shared
with:
mina-branch-name: master
compatible:
needs: [Prepare]
timeout-minutes: 45
runs-on: ubuntu-latest
if: github.event.pull_request.base.ref == 'main'
services:
mina-local-network:
image: o1labs/mina-local-network:compatible-latest-lightnet
env:
NETWORK_TYPE: 'single-node'
PROOF_LEVEL: 'none'
ports:
- 3085:3085
- 5432:5432
- 8080:8080
- 8181:8181
- 8282:8282
volumes:
- /tmp:/root/logs
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
repository: ${{ inputs.target_repo || github.repository }}
ref: ${{ inputs.target_ref || github.ref }}
- name: build
uses: ./.github/actions/build
with:
repository: ${{ inputs.target_repo || github.repository }}
ref: ${{ inputs.target_ref || github.ref }}
proof_systems_commit: ${{ inputs.proof_systems_commit }}
- name: Use shared steps for live testing jobs
uses: ./.github/actions/live-tests-shared
with:
mina-branch-name: compatible
develop:
needs: [Prepare]
timeout-minutes: 45
runs-on: ubuntu-latest
if: github.event.pull_request.base.ref == 'develop'
services:
mina-local-network:
image: o1labs/mina-local-network:develop-latest-lightnet
env:
NETWORK_TYPE: 'single-node'
PROOF_LEVEL: 'none'
ports:
- 3085:3085
- 5432:5432
- 8080:8080
- 8181:8181
- 8282:8282
volumes:
- /tmp:/root/logs
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
repository: ${{ inputs.target_repo || github.repository }}
ref: ${{ inputs.target_ref || github.ref }}
- name: build
uses: ./.github/actions/build
with:
repository: ${{ inputs.target_repo || github.repository }}
ref: ${{ inputs.target_ref || github.ref }}
proof_systems_commit: ${{ inputs.proof_systems_commit }}
- name: Use shared steps for live testing jobs
uses: ./.github/actions/live-tests-shared
with:
mina-branch-name: develop
mesa:
needs: [Prepare]
timeout-minutes: 45
runs-on: ubuntu-latest
if: github.event.pull_request.base.ref == 'develop-3.0'
services:
mina-local-network:
image: o1labs/mina-local-network:mesa-latest-lightnet
env:
NETWORK_TYPE: 'single-node'
PROOF_LEVEL: 'none'
ports:
- 3085:3085
- 5432:5432
- 8080:8080
- 8181:8181
- 8282:8282
volumes:
- /tmp:/root/logs
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
repository: ${{ inputs.target_repo || github.repository }}
ref: ${{ inputs.target_ref || github.ref }}
- name: build
uses: ./.github/actions/build
with:
repository: ${{ inputs.target_repo || github.repository }}
ref: ${{ inputs.target_ref || github.ref }}
proof_systems_commit: ${{ inputs.proof_systems_commit }}
- name: Use shared steps for live testing jobs
uses: ./.github/actions/live-tests-shared
with:
mina-branch-name: mesa