Skip to content

Commit

Permalink
CI - introduce gradle back build
Browse files Browse the repository at this point in the history
  • Loading branch information
lwih committed Jan 19, 2024
1 parent 3d030d7 commit d4cf39e
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 23 deletions.
45 changes: 25 additions & 20 deletions .github/workflows/build-and-test-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
# branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
schedule:
- cron: "0 3 * * *" # 3am every night

Expand All @@ -13,33 +14,37 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: "Setup Java JDK"
uses: actions/setup-java@v2
- uses: actions/setup-java@v4
with:
distribution: "zulu"
java-version: "17"
java-package: jdk # optional (jdk or jre) - defaults to jdk
distribution: temurin
java-version: 17

## Set up Maven Cache
- name: Cache Maven packages
uses: actions/cache@v1
- uses: gradle/gradle-build-action@v2
id: setup-gradle
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
gradle-version: wrapper

- name: "Analyse dependencies"
run: make back-check-dependencies
# - name: Dry run
# run: gradle build --dry-run # just test build configuration

- name: "Tests"
env:
CI: true
run: make back-test
- Name: Version
run: echo "The release-candidate version was ${{ steps.setup-gradle.outputs.gradle-version }}"

- name: "Build & test"
run: make back-build

# - name: "Analyse dependencies"
# run: make back-check-dependencies

# - name: "Tests"
# env:
# CI: true
# run: make back-test

# - name: "Check clean architecture"
# run: make check-clean-archi

- name: "Build"
run: make back-build-mvn
# - name: "Build"
# run: make back-build-mvn
1 change: 1 addition & 0 deletions .github/workflows/build-and-test-frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
# branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
schedule:
- cron: "0 3 * * *" # 3am every night

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: "Release"

on:
push:
branches: [ "main" ]
# push:
# branches: [ "main" ]
release:
types: [ published ]

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/trivy-db.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
# pull_request:
# # The branches below must be a subset of the branches above
# branches: [ "main" ]
workflow_dispatch:
schedule:
- cron: "0 3 * * *" # 3am every night

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/trivy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ on:
# pull_request:
# # The branches below must be a subset of the branches above
# branches: [ "main" ]
workflow_dispatch:
schedule:
- cron: "0 3 * * *" # 3am every night

Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,14 @@ front-visualize-bundle:
BACKEND_DIR := backend
BACKEND_CONFIGURATION_FOLDER=$(shell pwd)/infra/configurations/backend/

.PHONY: back-show-dependencies back-local
.PHONY: back-show-dependencies back-build back-local

back-show-dependencies:
cd $(BACKEND_DIR) && ./gradlew dependencies

back-build:
cd $(BACKEND_DIR) && ./gradlew build

back-start-local:
cd $(BACKEND_DIR) && ./gradlew bootRun --args='--spring.profiles.active=local --spring.config.additional-location=$(BACKEND_CONFIGURATION_FOLDER)'

Expand Down

0 comments on commit d4cf39e

Please sign in to comment.