Skip to content

Infernet Node E2E Tests #50

Infernet Node E2E Tests

Infernet Node E2E Tests #50

# pre-commit workflow
#
# Ensures the codebase passes the pre-commit stack.
name: Infernet Node E2E Tests
on:
schedule:
- cron: '0 0 * * 2-6' # every day at midnight, Tue-Sat
pull_request:
workflow_dispatch:
inputs:
docker-tag:
description: 'Infernet Node Docker tag'
required: true
type: string
default: '1.3.0'
jobs:
infernet-node-tests:
runs-on: buildjet-8vcpu-ubuntu-2204
timeout-minutes: 15
steps:
- uses: webfactory/ssh-agent@v0.9.0
with:
ssh-private-key: ${{ secrets.SSH_GH_ACTIONS }}
- name: Checkout
uses: actions/checkout@v4
# pull submodules manually since some are private
- run: |
git submodule sync --recursive
git -c protocol.version=2 submodule update --init --force --recursive
- name: Set up Cloud SDK
uses: 'google-github-actions/setup-gcloud@v2'
- name: init repo
run: |
echo '${{ secrets.SECRETS_SA }}' > secrets-sa-key.json
gcloud auth activate-service-account --key-file=secrets-sa-key.json
make init-repo
env:
CI: true
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Print Docker Tag
run: |
echo "Docker tag: ${{ github.event.inputs.docker-tag }}"
- name: Pull service images
env:
# use default Docker tag if it's not specified
INFERNET_NODE_TAG: ${{ github.event.inputs.docker-tag || '1.3.0' }}
run: |
docker compose -f infernet_services/deploy/docker-compose.yaml pull
docker pull "ritualnetwork/infernet-anvil:0.0.0"
- name: Build the container
env:
service_dir: infernet_services/test_services
service: echo
CI: true
run: make build-service
- name: Install UV
run: python -m pip install uv
# Can't install from uv with the --system flag much like what we do in our
# dockerfiles, because we'd have to run it as root.
- name: Create virtual environment
run: uv venv -p 3.11
- name: Activate virtual environment
run: |
. .venv/bin/activate
echo PATH=$PATH >> $GITHUB_ENV
- name: Get UV env file
run: make generate-uv-env-file export_prefix="" && cat uv.env >> $GITHUB_ENV
- name: Install dependencies
run: uv pip install --extra-index-url `make get-index-url` -r infernet_services/requirements-e2e-tests.lock
- name: Run tests
env:
CI: true
service: infernet_node
service_dir: infernet_services/test_services
# use default Docker tag if it's not specified
INFERNET_NODE_TAG: ${{ github.event.inputs.docker-tag || '1.3.0' }}
run: make test-service
- name: Cleanup Secrets
run: rm secrets-sa-key.json
if: always()