Skip to content

Commit

Permalink
feat: Add github actions (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
hiepmai-babylonchain authored Jul 24, 2024
1 parent f2cec60 commit cde3a4e
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 108 deletions.
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@v0.1.0
with:
run-unit-tests: true
run-integration-tests: false
run-lint: true

docker_pipeline:
uses: babylonchain/.github/.github/workflows/reusable_docker_pipeline.yml@v0.1.0
secrets: inherit
with:
publish: false
dockerfile: ./contrib/images/staking-expiry-checker/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@v0.1.0
with:
run-unit-tests: true
run-integration-tests: false
run-lint: true

docker_pipeline:
needs: ["lint_test"]
uses: babylonchain/.github/.github/workflows/reusable_docker_pipeline.yml@v0.1.0
secrets: inherit
with:
publish: true
dockerfile: ./contrib/images/staking-expiry-checker/Dockerfile
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ generate-mock-interface:
cd internal/db && mockery --name=DbInterface --output=../../tests/mocks --outpkg=mocks --filename=mock_db_client.go
cd internal/btcclient && mockery --name=BtcInterface --output=../../tests/mocks --outpkg=mocks --filename=mock_btc_client.go

tests:
test:
./bin/local-startup.sh;
go test -v -cover ./...
6 changes: 4 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,7 @@ 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
# Wait for RabbitMQ to start
sleep 10
fi

0 comments on commit cde3a4e

Please sign in to comment.