Skip to content

Merge pull request #45 from dezswap/feat/col5-withdraw #109

Merge pull request #45 from dezswap/feat/col5-withdraw

Merge pull request #45 from dezswap/feat/col5-withdraw #109

Workflow file for this run

name: CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "*" ]
jobs:
tests:
runs-on: ubuntu-latest
services:
cosmwasm-etl-db:
image: postgres
env:
POSTGRES_USER: app
POSTGRES_PASSWORD: appPW
POSTGRES_DB: cosmwasm_etl
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.20.10
- name: golangci-lint
uses: golangci/golangci-lint-action@v4
with:
version: v1.57.1
skip-pkg-cache: true
args: --timeout=5m --enable=unparam --enable=misspell --enable=prealloc --tests=false
- name: Tests
shell: bash
run: |
touch config.yaml
make test
- name: Migration Tests
run: |
make parser-migrate-up
make parser-migrate-test
make parser-migrate-down
# Add if more needed
- name: Build all
run: make build-all
deploy-deps-image:
environment: production
runs-on: ubuntu-latest
needs: tests
name: build deps image
if: success() && github.ref == 'refs/heads/main'
steps:
- name: checkout
uses: actions/checkout@v3
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4.0.2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_DEPS_REGION }}
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2.0.1
- name: Build, tag, and push image to Amazon ECR
id: build-deps-image
working-directory: .
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: cosmwasm-etl
run: |
GIT_SHORT_COMMIT=`git rev-parse --short HEAD`
docker build --no-cache --target=deps -t $ECR_REGISTRY/$ECR_REPOSITORY:deps-${GIT_SHORT_COMMIT} .
docker image push -a $ECR_REGISTRY/$ECR_REPOSITORY