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 #22

Merged
merged 8 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/[email protected]
with:
run-unit-tests: true
run-integration-tests: false
run-lint: true

docker_pipeline:
uses: babylonchain/.github/.github/workflows/[email protected]
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/[email protected]
with:
run-unit-tests: true
run-integration-tests: false
run-lint: true

docker_pipeline:
needs: ["lint_test"]
uses: babylonchain/.github/.github/workflows/[email protected]
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