Skip to content

Commit

Permalink
[FEATURE] Added GitHub actions to project. (#64)
Browse files Browse the repository at this point in the history
Added "GitHub actions" that runs on each PR and merge request to master branch. 
Implementation of  #63
  • Loading branch information
justJavaProgrammer authored Jul 27, 2024
1 parent 4c980a0 commit e81e29d
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 1 deletion.
20 changes: 20 additions & 0 deletions .github/workflows/github.actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: sonata-connect

on:
push:
branches:
- master
pull_request:
branches:
- master
env:
GH_USERNAME: ${{ secrets.GH_USERNAME }}
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run tests
run: bash run-tests.sh
7 changes: 7 additions & 0 deletions Dockerfile.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM maven:3.9.2-amazoncorretto-20

WORKDIR sonata-connect

COPY . .

ENTRYPOINT mvn -s settings.xml install
10 changes: 10 additions & 0 deletions docker-compose.test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: '2.9'
services:
sonata-connect:
build:
context: .
dockerfile: Dockerfile.test
container_name: sonata-connect-tests-container
environment:
GITHUB_USERNAME: ${GH_USERNAME}
ACCESS_TOKEN: ${ACCESS_TOKEN}
5 changes: 5 additions & 0 deletions run-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

source sonata-connect-build.test.sh

source sonata-connect-run.test.sh
2 changes: 1 addition & 1 deletion sonata-connect-build.local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ export IMAGE_NAME=sonata-connect

echo "Starting building image with name: $IMAGE_NAME"

docker image build -f Dockerfile.test -t $IMAGE_NAME .
docker image build -f Dockerfile.local -t $IMAGE_NAME .

echo "Image $IMAGE_NAME has been successfully built"
9 changes: 9 additions & 0 deletions sonata-connect-build.test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

export IMAGE_NAME=sonata-connect-test

echo "Starting building image with name: $IMAGE_NAME"

docker image build -f Dockerfile.test -t $IMAGE_NAME .

echo "Image $IMAGE_NAME has been successfully built"
3 changes: 3 additions & 0 deletions sonata-connect-run.test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

docker-compose -f docker-compose.test.yml up --abort-on-container-exit

0 comments on commit e81e29d

Please sign in to comment.