Skip to content

Introduce environment variables #9

Introduce environment variables

Introduce environment variables #9

# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven
name: Build and Deployment Test
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout main branch from repository
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Build the project with Maven
run: mvn -B package --file pom.xml -DskipTests
# -B: Runs in batch mode (non-interactive)
# package: Creates JAR/WAR file
- name: Run unit tests with Maven
run: mvn test -DskipTests # -DskipTests skips running tests during build
# # Optional: Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
# - name: Update dependency graph
# uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6