-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add pytest ci * feat: add pytest docker build ci and refactor pytest ci * refac: docker pull all necessary images and update ci
- Loading branch information
1 parent
64ae1d2
commit 287567e
Showing
4 changed files
with
125 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
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 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: "[Nethermind] Taiko Preconf AVS Stack - Pytest" | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [master] | ||
|
||
env: | ||
TARGET_MACHINE_IP: 178.79.141.170 | ||
jobs: | ||
build: | ||
name: Set and run pytest | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Setup SSH Key | ||
run: | | ||
mkdir -p ~/.ssh | ||
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa | ||
chmod 600 ~/.ssh/id_rsa | ||
ssh-keyscan -H ${{ env.TARGET_MACHINE_IP }} >> ~/.ssh/known_hosts | ||
- name: SSH into target machine | ||
run: | | ||
ssh -o StrictHostKeyChecking=no -o ServerAliveInterval=60 -o ServerAliveCountMax=30 root@${{ env.TARGET_MACHINE_IP }} << 'EOF' | ||
docker pull nethswitchboard/taiko-protocol-dev:latest | ||
docker pull nethswitchboard/taiko-client-dev:latest | ||
docker pull nethswitchboard/taiko-preconf-avs-dev:latest | ||
docker pull nethswitchboard/taiko-preconf-avs-protocol-dev:latest | ||
docker pull nethswitchboard/taiko-preconf-avs-pytest-dev:latest | ||
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 | ||
EOF | ||
- name: Summary | ||
run: | | ||
echo "## Pytest completed :green_circle:" >> $GITHUB_STEP_SUMMARY |
This file contains 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
This file contains 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
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"] |