Skip to content

Merge pull request #76 from Layr-Labs/sm-syncTweaks #325

Merge pull request #76 from Layr-Labs/sm-syncTweaks

Merge pull request #76 from Layr-Labs/sm-syncTweaks #325

Workflow file for this run

name: build-container
on: push
jobs:
test:
runs-on: ubuntu-24.04
services:
postgres:
image: postgres:15
env:
POSTGRES_DB: sidecar
POSTGRES_USER: sidecar
POSTGRES_PASSWORD: sidecar
ports:
- 5432:5432
# Add health check to ensure postgres is ready before running tests
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
run: make deps
- name: Run tests
env: # Pass the database connection details to the tests
SIDECAR_DATABASE_HOST: localhost
SIDECAR_DATABASE_PORT: 5432
SIDECAR_DATABASE_USER: sidecar
SIDECAR_DATABASE_PASSWORD: sidecar
run: make ci-test
lint:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run linter
run: |
make deps
go env GOPATH
export PATH=$PATH:$(go env GOPATH)/bin
echo $PATH
make lint
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Login to Amazon ECR
id: login-ecr-public
uses: aws-actions/amazon-ecr-login@v2
with:
registry-type: public
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build, tag, and push docker image to Amazon ECR
env:
REGISTRY: "public.ecr.aws/z6g0f8n7"
REPOSITORY: ${{ github.event.repository.name }}
IMAGE_TAG: ${{ github.sha }}
PLATFORMS: "linux/amd64"
run: |
if [[ $GITHUB_REF == refs/heads/master ]]; then
docker buildx build --platform $PLATFORMS -t $REGISTRY/$REPOSITORY:$IMAGE_TAG -t $REGISTRY/$REPOSITORY:latest --push .
else
docker buildx build --platform $PLATFORMS -t $REGISTRY/$REPOSITORY:$IMAGE_TAG --push .
fi