name: E2E Setup description: Setup environment for E2E tests inputs: infura_api_key: description: 'Infura API Key for EVM interactions' required: true evm_private_key: description: 'EVM Private Key for transactions' required: true eth_rpc_url: description: 'Ethereum RPC URL' required: true runs: using: composite steps: - name: Setup EVM environment file shell: bash run: | cd evm cp .env.example .env sed -i "s/INFURA_API_KEY=/INFURA_API_KEY=${{ inputs.infura_api_key }}/" .env sed -i "s/EVM_PRIVATE_KEY=/EVM_PRIVATE_KEY=${{ inputs.evm_private_key }}/" .env - name: Setup E2E testing tools environment file shell: bash run: | cd e2e-testing/tools cp .env.example .env sed -i "s/INFURA_API_KEY=/INFURA_API_KEY=${{ inputs.infura_api_key }}/" .env sed -i "s/EVM_PRIVATE_KEY=/EVM_PRIVATE_KEY=${{ inputs.evm_private_key }}/" .env sed -i "s|ETH_RPC_URL=|ETH_RPC_URL=${{ inputs.eth_rpc_url }}|" .env - name: Setup Bridge SDK config shell: bash run: | cd e2e-testing cp bridge-sdk-config.example.json bridge-sdk-config.json sed -i "s//${{ inputs.evm_private_key }}/" bridge-sdk-config.json sed -i "s||${{ inputs.eth_rpc_url }}/${{ inputs.infura_api_key }}|" bridge-sdk-config.json - name: Set up Node.js uses: actions/setup-node@v3 with: node-version: '18' - name: Install Yarn shell: bash run: sudo npm install -g yarn - name: Install Node.js dependencies shell: bash run: | cd evm && yarn install cd ../e2e-testing/tools && yarn install - name: Install optional additional packages shell: bash run: | sudo apt-get update sudo apt-get install -y jq libudev-dev - name: Setup Rust toolchain uses: dtolnay/rust-toolchain@stable with: toolchain: 1.85.0 target: wasm32-unknown-unknown - name: Cache Rust dependencies uses: Swatinem/rust-cache@v2 with: shared-key: "e2e-setup-cache" cache-on-failure: true cache-all-crates: true cache-directories: | ~/.cargo/registry/index/ ~/.cargo/registry/cache/ ~/.cargo/git/db/ target/ - name: Install Bridge SDK uses: taiki-e/cache-cargo-install-action@v2 with: tool: bridge-cli git: https://github.com/Near-One/bridge-sdk-rs/ rev: 8f1a290c162a91b0314f363759fdc0e210e48d89 - name: Install NEAR CLI uses: taiki-e/cache-cargo-install-action@v2 with: tool: near-cli-rs@0.18.0 - name: Install Cargo Near uses: taiki-e/cache-cargo-install-action@v2 with: tool: cargo-near - name: Cache Solana CLI and Anchor uses: actions/cache@v3 id: solana-cache with: path: | ~/.local/share/solana ~/.cargo/bin/anchor key: ${{ runner.os }}-solana-anchor-v0.30.1 - name: Install Solana CLI and Anchor if: steps.solana-cache.outputs.cache-hit != 'true' shell: bash run: | sh -c "$(curl -sSfL https://release.anza.xyz/stable/install)" export PATH="/home/runner/.local/share/solana/install/active_release/bin:$PATH" cargo install --git https://github.com/coral-xyz/anchor --tag v0.30.1 anchor-cli - name: Set up Docker uses: docker/setup-buildx-action@v2 - name: Set up Conda environment and Snakemake uses: conda-incubator/setup-miniconda@v3 with: auto-update-conda: true python-version: 3.12.8 activate-environment: snakemake environment-file: e2e-testing/environment.yml