Skip to content

Commit

Permalink
feat: add start/stop vm process
Browse files Browse the repository at this point in the history
  • Loading branch information
wshino committed Dec 12, 2024
1 parent dc0435f commit cc30c02
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 2 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/build-fmt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,30 @@ name: Build and Format
on: [push]

jobs:
jobs:
start-spot-vm:
name: Start Spot VM
runs-on: ubuntu-latest

steps:
- name: Authenticate with GCP
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }}

- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v2'
with:
version: '>= 363.0.0'

- name: Start Spot VM
run: gcloud compute instances start email-tx-builder-runner-spot --zone=us-central1-c

- name: Wait for Spot VM to initialize
run: |
echo "Waiting for Spot VM to initialize..."
sleep 60
build-and-format:
runs-on: self-hosted

Expand Down Expand Up @@ -48,3 +72,21 @@ jobs:

- name: Run clippy
run: cargo clippy -- -D warnings

stop-spot-vm:
name: Stop Spot VM
needs: [circuits, contracts, relayer]
runs-on: ubuntu-latest
steps:
- name: Authenticate with GCP
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }}

- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v2'
with:
version: '>= 363.0.0'

- name: Stop Spot VM
run: gcloud compute instances stop email-tx-builder-runner-spot --zone=us-central1-c
4 changes: 2 additions & 2 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ jobs:

stop-spot-vm:
name: Stop Spot VM
needs: [circuits, contracts]
needs: [circuits, contracts, relayer]
runs-on: ubuntu-latest
steps:
- name: Authenticate with GCP
Expand All @@ -138,4 +138,4 @@ jobs:
version: '>= 363.0.0'

- name: Stop Spot VM
run: gcloud compute instances stop email-tx-builder-runner-spot --zone=us-central1-c
run: gcloud compute instances stop email-tx-builder-runner-spot --zone=us-central1-c

0 comments on commit cc30c02

Please sign in to comment.