80->8000 #7
This file contains hidden or 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
| name: OLD_ACTION | |
| on: | |
| schedule: | |
| # Runs at 00:00 UTC every day | |
| - cron: "0 0 * * *" | |
| push: | |
| branches: | |
| - main | |
| - fix-failing-tests | |
| workflow_dispatch: | |
| inputs: | |
| environment: | |
| description: "Environment to test" | |
| required: true | |
| type: string | |
| workflow_call: | |
| inputs: | |
| environment: | |
| description: "Environment to test" | |
| required: true | |
| type: string | |
| # # ✅ Cancel previous runs on same branch or PR when a new run starts | |
| # concurrency: | |
| # group: ${{ github.workflow }}-${{ github.ref }} | |
| # cancel-in-progress: true | |
| permissions: | |
| id-token: write | |
| contents: write | |
| env: | |
| AWS_ECR_STS_ROLE: arn:aws:iam::688567264391:role/DojoApiCIRole | |
| jobs: | |
| validate-environment: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| environment: ${{ steps.validate.outputs.environment }} | |
| steps: | |
| - name: Validate environment input | |
| id: validate | |
| run: | | |
| if [[ "${{ github.event_name }}" == "workflow_dispatch" || "${{ github.event_name }}" == "workflow_call" ]]; then | |
| ENVIRONMENT="${{ inputs.environment }}" | |
| else | |
| ENVIRONMENT="local" | |
| fi | |
| if [[ "$ENVIRONMENT" != "staging" && "$ENVIRONMENT" != "prod" && "$ENVIRONMENT" != "local" ]]; then | |
| echo "❌ Error: Invalid environment '$ENVIRONMENT'. Must be 'staging' or 'prod' or 'local'." | |
| exit 1 | |
| fi | |
| echo "✅ Environment '$ENVIRONMENT' is valid" | |
| echo "environment=staging" >> $GITHUB_OUTPUT | |
| set-versions: | |
| needs: [validate-environment] | |
| runs-on: ubuntu-latest | |
| outputs: | |
| npm_package_version: ${{ steps.set-versions.outputs.npm_package_version }} | |
| uv_package_version: ${{ steps.set-versions.outputs.uv_package_version }} | |
| steps: | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: "20" | |
| - name: Install uv | |
| run: curl -LsSf https://astral.sh/uv/install.sh | sh | |
| - name: Set versions | |
| id: set-versions | |
| run: | | |
| if [[ "${{ needs.validate-environment.outputs.environment }}" == "staging" ]]; then | |
| NPM_PACKAGE_VERSION=$(npm view @compass-labs/api-sdk versions --json | jq -r '.[]' | grep -E 'rc|alpha|beta' | sort -V | tail -1) | |
| UV_PACKAGE_VERSION="$(curl -s https://pypi.org/pypi/compass-api-sdk/json | jq -r '.releases | keys | .[]' | grep -E 'rc|a|b|dev' | sort -V | tail -1)" | |
| else | |
| NPM_PACKAGE_VERSION="latest" | |
| UV_PACKAGE_VERSION="latest" | |
| fi | |
| echo "npm_package_version=$NPM_PACKAGE_VERSION" >> $GITHUB_OUTPUT | |
| echo "uv_package_version=$UV_PACKAGE_VERSION" >> $GITHUB_OUTPUT | |
| print-context: | |
| needs: [validate-environment, set-versions] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Show resolved values | |
| run: | | |
| echo "environment: ${{ needs.validate-environment.outputs.environment }}" | |
| echo "uv_package_version: ${{ needs.set-versions.outputs.uv_package_version }}" | |
| run-python----basic-examples-deposit-on-morpho: # | |
| needs: [validate-environment, set-versions] | |
| runs-on: ubuntu-latest | |
| env: | |
| COMPASS_API_KEY: ${{ secrets.COMPASS_API_KEY }} | |
| PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }} | |
| BASE_RPC_URL: http://localhost:8546 | |
| #BASE_RPC_URL: ${{ secrets.BASE_MAINNET_RPC_URL }} | |
| SERVER_URL: http://localhost:8000 | |
| #SERVER_URL: https://api.compasslabs.ai # uncomment this to test against staging api | |
| NPM_PACKAGE_VERSION: ${{ needs.set-versions.outputs.npm_package_version }} | |
| UV_PACKAGE_VERSION: ${{ needs.set-versions.outputs.uv_package_version }} | |
| #API_KEY: | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Install uv | |
| run: curl -LsSf https://astral.sh/uv/install.sh | sh | |
| - name: Start up full local API and anvil | |
| uses: ./.github/actions/old_anvil_and_api | |
| id: old_anvil_and_api | |
| with: | |
| ethereum_rpc_url: ${{ secrets.ETHEREUM_MAINNET_RPC_URL }} | |
| arbitrum_rpc_url: ${{ secrets.ARBITRUM_MAINNET_RPC_URL }} | |
| base_rpc_url: ${{ secrets.BASE_MAINNET_RPC_URL }} | |
| private_key: ${{ secrets.PRIVATE_KEY }} | |
| mono_app_id: ${{ secrets.MONOREPOAPP_ID }} | |
| mono_app_private_key: ${{ secrets.MONOREPOAPP_PRIVATE_KEY }} | |
| fund_amount_eth: "10" | |
| environment: ${{ needs.validate-environment.outputs.environment }} | |
| aws_ecr_sts_role: ${{ env.AWS_ECR_STS_ROLE }} | |
| ecr_image_uri: 688567264391.dkr.ecr.eu-west-2.amazonaws.com/dojo_api | |
| - name: Install dependencies | |
| working-directory: v1/basic_examples/deposit_on_morpho/python | |
| run: | | |
| if [[ "$UV_PACKAGE_VERSION" != "latest" ]]; then | |
| echo "Installing compass-api-sdk==$UV_PACKAGE_VERSION" | |
| uv add compass-api-sdk==$UV_PACKAGE_VERSION | |
| fi | |
| uv sync | |
| uv pip freeze | |
| - name: Show pyproject.toml | |
| working-directory: v1/basic_examples/deposit_on_morpho/python | |
| run: cat pyproject.toml | |
| - name: Show compass-api-sdk version | |
| working-directory: v1/basic_examples/deposit_on_morpho/python | |
| run: uv pip show compass-api-sdk || echo "compass-api-sdk not installed" | |
| - name: Run example | |
| working-directory: v1/basic_examples/deposit_on_morpho/python | |
| run: ./.venv/bin/python main.py #src/main.py # | |