Skip to content

Create separate test.yml workflow file as requested #326

Create separate test.yml workflow file as requested

Create separate test.yml workflow file as requested #326

Workflow file for this run

name: Run on Push
on:
push:
workflow_dispatch:
jobs:
test:
environment: Test
name: Unit Test
runs-on: ubuntu-latest
strategy:
matrix:
test:
- aggregator
- core/taskengine
- core/taskengine/trigger
- core/taskengine/macros
- pkg/timekeeper
- pkg/graphql
- pkg/byte4
# Temp disable until we fix the sepolia bundler
# - pkg/erc4337/preset
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Run Go test
env:
RPC_URL: "${{ secrets.RPC_URL }}"
BUNDLER_RPC: "${{ secrets.BUNDLER_RPC }}"
FACTORY_ADDRESS: "${{ vars.FACTORY_ADDRESS }}"
BASE_SEPOLIA_RPC_URL: "${{ secrets.BASE_SEPOLIA_RPC_URL }}"
BASE_SEPOLIA_BUNDLER_RPC: "${{ secrets.BASE_SEPOLIA_BUNDLER_RPC }}"
CONTROLLER_PRIVATE_KEY: "${{ secrets.CONTROLLER_PRIVATE_KEY }}"
run: |
cd ./${{ matrix.test }}
go test . -v
publish-dev-build:
name: Publish dev build docker image to dockerhub
runs-on: 'ubuntu-latest'
if: ${{ github.event_name != 'pull_request' }}
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
go_src:
- '**.go'
- '!**/*_test.go'
- '!**.yaml'
- '!**.yml'
- name: Skip message
if: steps.filter.outputs.go_src != 'true'
run: echo "Skipping Docker build - no source code changes detected"
- name: Login to Docker Hub
uses: docker/login-action@v3
if: steps.filter.outputs.go_src == 'true'
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up QEMU
if: steps.filter.outputs.go_src == 'true'
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
if: steps.filter.outputs.go_src == 'true'
uses: docker/setup-buildx-action@v3
- name: Docker meta
if: steps.filter.outputs.go_src == 'true'
id: meta
uses: docker/metadata-action@v5
with:
# This is a dedicated repository to house the development/preview build
images: |
avaprotocol/avs-dev
tags: |
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
type=raw,value={{sha}}
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Build and push avs-dev docker image
if: steps.filter.outputs.go_src == 'true'
uses: docker/build-push-action@v6
with:
build-args: |
RELEASE_TAG=${{ inputs.tag || github.sha || github.head_ref || github.ref_name }}
COMMIT_SHA=${{ github.sha }}
platforms: linux/amd64,linux/arm64
context: .
file: dockerfiles/operator.Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}