faster waitForClusterRunning #274
This file contains 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
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | |
name: fast-zk-rollup-ci | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
jobs: | |
run_tests: | |
runs-on: ubuntu-latest | |
env: | |
LOCAL_HADOOP_IMAGE_NAME: ycryptx/mina:hadoop | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Use Node.js | |
uses: actions/[email protected] | |
with: | |
node-version: 18.12 | |
- uses: docker/setup-buildx-action@v1 | |
- name: Docker login | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} # Docker Hub username stored in GitHub Secrets | |
password: ${{ secrets.DOCKER_PASSWORD }} # Docker Hub password stored in GitHub Secrets | |
- uses: docker/build-push-action@v2 | |
with: | |
context: accumulator/infra/hadoop-single-node-cluster | |
tags: ${{ env.LOCAL_HADOOP_IMAGE_NAME }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
push: true | |
- name: Spin up local accumulator | |
run: make up-local-accumulator | |
- name: Sleep for 15s seconds | |
run: sleep 15s | |
shell: bash | |
- name: add test config | |
working-directory: ./sequencer | |
run: cp .env.example .env | |
- name: install dependencies | |
run: yarn install | |
# - name: run integration tests | |
# run: yarn sequencer test | |
publish: | |
runs-on: ubuntu-latest | |
needs: run_tests | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dorny/paths-filter@v2 | |
id: changes | |
with: | |
filters: | | |
rollup: | |
- 'rollup/src/**' | |
- id: install-aws-cli | |
uses: unfor19/install-aws-cli-action@v1 | |
with: | |
version: 2 | |
verbose: false | |
arch: amd64 | |
rootdir: "" | |
workdir: "" | |
- name: install yarn dependencies | |
run: yarn install && yarn rollup build | |
- name: re-build mapper/reducer scripts | |
run: make build-map-reduce-scripts | |
- name: Push EMR Mapper/Reducer/Bootstrap to S3 | |
run: | | |
aws s3 cp ./sequencer/scripts/mapper.js s3://${{ env.DATA_BUCKET_NAME }}/mapper.js | |
aws s3 cp ./sequencer/scripts/reducer.js s3://${{ env.DATA_BUCKET_NAME }}/reducer.js | |
aws s3 cp ./accumulator/infra/emr_bootstrap_script.sh s3://${{ env.DATA_BUCKET_NAME }}/emr_bootstrap_script.sh | |
env: | |
DATA_BUCKET_NAME: mina-fast-zk-rollup-emr-data | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_DEFAULT_REGION: eu-central-1 | |
- name: Push contract compilation cache to S3 (only if changes were made in rollup/src/*) | |
if: steps.changes.outputs.rollup == 'true' | |
run: | | |
yarn sequencer compile:zkapp && yarn sequencer compile:zkapp | |
aws s3 cp ./sequencer/compilation s3://${{ env.DATA_BUCKET_NAME }}/compilation/ --recursive | |
env: | |
DATA_BUCKET_NAME: mina-fast-zk-rollup-emr-data | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_DEFAULT_REGION: eu-central-1 | |
- name: ECR Registry login | |
uses: docker/login-action@v1 | |
with: | |
registry: public.ecr.aws | |
username: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
password: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
env: | |
AWS_REGION: "us-east-1" | |
- name: Push to sequencer server image to ECR registry | |
uses: docker/build-push-action@v2 | |
with: | |
tags: public.ecr.aws/y6u2m5w7/zk-rollup-docker-registry:latest | |
push: true |