Skip to content
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
40 changes: 36 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
push:
branches:
- develop
- main
tags:
- 'v*'


env:
DOCKERHUB_USERNAME: threeamigoscoding
Expand All @@ -28,8 +32,29 @@ jobs:
- name: Build with Gradle
run: ./gradlew clean build

- name: Display build success
run: echo "Build completed successfully!"
- name: Run tests
run: ./gradlew test

- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: build-artifact
path: build/libs/*.jar
retention-days: 1

publish:
needs: build
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: build-artifact
path: build/libs

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand All @@ -43,8 +68,15 @@ jobs:
- name: Generate version tag
id: version
run: |
SHORT_SHA=$(git rev-parse --short HEAD)
VERSION_TAG="develop-${SHORT_SHA}"
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION_TAG=${GITHUB_REF#refs/tags/v}
elif [[ $GITHUB_REF == refs/heads/main ]]; then
SHORT_SHA=$(git rev-parse --short HEAD)
VERSION_TAG="main-${SHORT_SHA}"
else
SHORT_SHA=$(git rev-parse --short HEAD)
VERSION_TAG="develop-${SHORT_SHA}"
fi
echo "tag=$VERSION_TAG" >> $GITHUB_OUTPUT
echo "Generated version tag: $VERSION_TAG"

Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
pull_request:
branches:
- develop
- master
- main

jobs:
build-and-test:
Expand All @@ -24,7 +24,4 @@ jobs:
uses: gradle/actions/setup-gradle@v4

- name: Build with Gradle
run: ./gradlew clean build

- name: Run unit tests
run: ./gradlew test
run: ./gradlew clean build
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,9 @@ class BackendPocApplicationTests {
void contextLoads() {
}

@Test
void notFailingTest() {
System.out.println( "Not failing test");
}

}