Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add github actions #205

Closed
wants to merge 10 commits into from
105 changes: 0 additions & 105 deletions .circleci/config.yml

This file was deleted.

21 changes: 21 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: ci

on:
pull_request:
branches:
- '**'

jobs:
lint_test:
uses: babylonchain/.github/.github/workflows/reusable_go_lint_test.yml@hiep/add-reusable-workflows
with:
run-unit-tests: true
run-integration-tests: false
run-lint: false

docker_pipeline:
uses: babylonchain/.github/.github/workflows/reusable_docker_pipeline.yml@hiep/add-reusable-workflows
secrets: inherit
with:
publish: false
dockerfile: ./contrib/images/staking-api-service/Dockerfile
25 changes: 25 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: docker_publish

on:
push:
branches:
- 'main'
- 'dev'
tags:
- '*'

jobs:
lint_test:
uses: babylonchain/.github/.github/workflows/reusable_go_lint_test.yml@hiep/add-reusable-workflows
with:
run-unit-tests: true
run-integration-tests: false
run-lint: false

docker_pipeline:
needs: ["lint_test"]
uses: babylonchain/.github/.github/workflows/reusable_docker_pipeline.yml@hiep/add-reusable-workflows
secrets: inherit
with:
publish: true
dockerfile: ./contrib/images/staking-api-service/Dockerfile
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ run-unprocessed-events-replay-local:
generate-mock-interface:
cd internal/db && mockery --name=DBClient --output=../../tests/mocks --outpkg=dbmock --filename=mock_db_client.go

tests:
test:
./bin/local-startup.sh;
go test -v -cover -p 1 ./... -count=1

Expand Down
5 changes: 3 additions & 2 deletions bin/local-startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if [ $(docker ps -q -f name=^/${MONGO_CONTAINER_NAME}$) ]; then
else
echo "Starting MongoDB"
# Start MongoDB
docker-compose up mongodb -d
docker-compose up -d mongodb
fi

# Check if the RabbitMQ container is already running
Expand All @@ -17,5 +17,6 @@ if [ $(docker ps -q -f name=^/${RABBITMQ_CONTAINER_NAME}$) ]; then
else
echo "Starting RabbitMQ"
# Start RabbitMQ
docker-compose up rabbitmq -d
docker-compose up -d rabbitmq
sleep 10
fi
Loading