Skip to content

Opact Tickets

Opact Tickets #825

Workflow file for this run

name: CI
on: pull_request
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
check_build_and_tests:
runs-on: ubuntu-latest
outputs:
ACCOUNT_ID: ${{ steps.setup.outputs.account_id }}
PRIVATE_KEY: ${{ steps.setup.outputs.private_key }}
HYC_CONTRACT: ${{ steps.setup.outputs.hyc_contract }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Fetch circom
uses: dsaltares/fetch-gh-release-asset@master
with:
repo: "iden3/circom"
version: "tags/v2.1.3"
file: "circom-linux-amd64"
target: "circom"
token: ${{ secrets.GITHUB_TOKEN }}
- name: Give circom exec permissions
run: chmod +x circom
- name: Add circom to path
run: echo $(pwd) >> $GITHUB_PATH
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18.12.1
cache: "yarn"
- name: Install Rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source $HOME/.cargo/env
rustup component add rustfmt
rustup target add wasm32-unknown-unknown
- name: Install Yarn Globally
run: npm install -g yarn
- name: Installing Dependencies
run: yarn
- name: Compile circuits
run: yarn circuits circuit:setup:plonk
- name: Run test-ts setup and test SDK, Relayer and Denylist Bot
env:
CF_TOKEN: ${{ secrets.CF_API_TOKEN }}
CF_IDENTIFIER: ${{ secrets.CF_IDENTIFIER }}
run: |
yarn relayer test
echo "TESTNET_RELAYER_ACCOUNT_ID=$TESTNET_RELAYER_ACCOUNT_ID" >> $GITHUB_OUTPUT
echo "TESTNET_RELAYER_PRIVATE_KEY=$TESTNET_RELAYER_PRIVATE_KEY" >> $GITHUB_OUTPUT
echo "TESTNET_HYC_CONTRACT=$TESTNET_HYC_CONTRACT" >> $GITHUB_OUTPUT
- id: setup
run: |
echo "account_id=${{ env.TESTNET_RELAYER_ACCOUNT_ID }}" >> "$GITHUB_OUTPUT"
echo "private_key=${{ env.TESTNET_RELAYER_PRIVATE_KEY }}" >> "$GITHUB_OUTPUT"
echo "hyc_contract=${{ env.TESTNET_HYC_CONTRACT }}" >> "$GITHUB_OUTPUT"
# - name: Rust Tests
# run: yarn contracts test:rust
# - name: Lib Tests
# run: yarn contracts test:lib
- name: Front build
run: yarn front build
dev_deploy:
runs-on: ubuntu-latest
needs: check_build_and_tests
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
VITE_NEAR_NETWORK: testnet
VITE_GTM_ID: ${{ secrets.VITE_GTM_ID }}
VITE_NEAR_NODE_URL: https://rpc.testnet.near.org
VITE_RELAYER_NETWORK: test
VITE_RELAYER_URL: https://dev-relayer.hideyourcash.workers.dev
VITE_CONTRACT: ${{ needs.check_build_and_tests.outputs.HYC_CONTRACT }}
VITE_API_GRAPHQL_URL: https://api.thegraph.com/subgraphs/name/veigajoao/test_hyc2
VITE_TRACES_SAMPLE_RATE: 0
VITE_SENTRY_DSN: ${{ secrets.VITE_SENTRY_DSN }}
RELAYER_FEE: "0.10"
NEAR_NETWORK: "testnet"
ACCOUNT_ID: ${{ needs.check_build_and_tests.outputs.ACCOUNT_ID }}
PRIVATE_KEY: ${{ needs.check_build_and_tests.outputs.PRIVATE_KEY }}
HYC_CONTRACT: ${{ needs.check_build_and_tests.outputs.HYC_CONTRACT }}
RPC_URL: "https://rpc.testnet.near.org"
RELAYER_URL: "https://dev-relayer.hideyourcash.workers.dev"
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Fetch circom
uses: dsaltares/fetch-gh-release-asset@master
with:
repo: "iden3/circom"
version: "tags/v2.1.3"
file: "circom-linux-amd64"
target: "circom"
token: ${{ secrets.GITHUB_TOKEN }}
- name: Give circom exec permissions
run: chmod +x circom
- name: Add circom to path
run: echo $(pwd) >> $GITHUB_PATH
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18.12.1
cache: "yarn"
- name: Install Vercel CLI
run: npm install --global vercel@canary
- name: Install Yarn Globally
run: npm install -g yarn
- name: Installing Dependencies
run: yarn
- name: Building Relayer
run: yarn relayer build
- name: Publish Relayer
uses: cloudflare/wrangler-action@2.0.0
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
command: publish --name dev-relayer --keep-vars
workingDirectory: 'packages/relayer'
- name: Compile circuits
run: yarn circuits circuit:setup:plonk
- name: Pull vercel setup
run: vercel pull --yes --token=${{ secrets.VERCEL_TOKEN }}
- name: Build Project Artifacts
run: vercel build --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy Project Artifacts to Vercel
run: >
vercel
deploy
--prebuilt
--token=${{ secrets.VERCEL_TOKEN }}