Skip to content

Frontend CI

Frontend CI #689

Workflow file for this run

name: Frontend CI
on:
push:
branches: [ main, develop ]
pull_request:
paths: [ "frontend/**", ".github/frontend.yaml" ]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
frontend-test:
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v4
- name: Setup build dependencies
run: |
sudo apt update
sudo apt install -y protobuf-compiler
- name: Setup Rust
run: |
rustup default 1.80
rustup component add rustfmt
# NOTE: the cache just hangs if the pipeline is completed, probably due to the node running in the background.
# Dissable for now
# - name: Setup Rust Cache
# uses: Swatinem/rust-cache@v2
# with:
# prefix-key: "v0"
- name: Release build
run: |
cargo build --release --bin openmina
# NOTE: IIRC the circuits are handled automatically by the node now
# - name: Setup circuits
# run: |
# git clone --depth 1 https://github.com/openmina/circuit-blobs.git
# ln -s -b $PWD/circuit-blobs/* ledger/
- name: Run openmina node
env:
MINA_PRIVKEY_PASS: ${{ secrets.FRONTEND_PRODUCER_PASSWORD }}
run: |
echo "${{ secrets.FRONTEND_PRODUCER_KEY }}" > ~/producer_key
nohup ./target/release/openmina node --producer-key ~/producer_key > node.out &
sleep 5
- name: Wait for node to sync up
run: |
echo "Waiting for the node to be ready and synced..."
sleep 10
start_time=$(date +%s)
timeout=600 # 10 mins
while true; do
response=$(curl --silent http://localhost:3000/status)
status=$(echo $response | jq -r '.transition_frontier.sync.status')
echo $status
if [ "$status" == "Synced" ]; then
echo "Node is up and synced"
break
else
sleep 3
fi
current_time=$(date +%s)
elapsed_time=$((current_time - start_time))
if [ $elapsed_time -ge $timeout ]; then
echo ""
echo "Timeout reached. Node is not synced."
exit 1
fi
done
- name: Run tests
uses: cypress-io/github-action@v6
with:
working-directory: frontend
start: npm start
wait-on: http://localhost:4200
wait-on-timeout: 180s