Skip to content

Commit

Permalink
feat: add pytest docker build ci and refactor pytest ci
Browse files Browse the repository at this point in the history
  • Loading branch information
nmjustinchan committed Jan 24, 2025
1 parent b4629e0 commit a80c585
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 3 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/avs_pytest_docker_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: "[Nethermind] Taiko Preconf AVS Pytest - Docker build and push"

on:
workflow_dispatch:
push:
branches: [master]
tags:
- "taiko-preconf-avs-v*"
paths:
- "e2e_tests/**"

env:
DOCKER_REGISTRY: docker.io
DOCKER_USERNAME: nethswitchboard
DOCKER_REPOSITORY_DEV: taiko-preconf-avs-pytest-dev

jobs:
build:
name: Build and push docker image
runs-on: ubuntu-latest
if: github.repository == 'NethermindEth/Taiko-Preconf-AVS'
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- uses: docker/login-action@v3
with:
registry: ${{ env.DOCKER_REGISTRY }}
username: ${{ env.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_USERNAME }}/${{ env.DOCKER_REPOSITORY_DEV }}
tags: |
type=raw,value=latest
type=ref,event=branch
type=ref,event=pr
type=ref,event=tag
type=sha
- name: Build and push by digest
id: build
uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64
context: ./e2e_tests
file: ./e2e_tests/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Summary
run: |
echo "## Docker build completed :green_circle:" >> $GITHUB_STEP_SUMMARY
echo "### Tags" >> $GITHUB_STEP_SUMMARY
echo "${{ steps.meta.outputs.tags }}" | while IFS= read -r TAG; do
echo "- $TAG" >> $GITHUB_STEP_SUMMARY
done
echo "### Notes" >> $GITHUB_STEP_SUMMARY
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
kurtosis enclave rm taiko-preconf-devnet --force
kurtosis clean -a
cd ~/preconfirm-devnet-package
git pull
kurtosis run --enclave taiko-preconf-devnet . --args-file network_params.yaml
cd ~/Taiko-Preconf-AVS/e2e_tests
Expand Down
6 changes: 3 additions & 3 deletions SmartContracts/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ RUN apt-get update && apt-get install -y jq

RUN git init && \
curl -L https://foundry.paradigm.xyz | bash && \
npm install -g pnpm && \
. ~/.bashrc && \
foundryup && \
forge install && \
pnpm install
forge install

RUN chmod +x /app/scripts/deployment/*.sh

ENV PATH="/root/.foundry/bin:$PATH"

Expand Down
15 changes: 15 additions & 0 deletions e2e_tests/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Use Python base image
FROM python:3.9-slim

# Set working directory
WORKDIR /app

# Copy requirements and install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy test files
COPY . .

# Command to run tests
CMD ["sleep", "infinity"]

0 comments on commit a80c585

Please sign in to comment.