Skip to content
Snippets Groups Projects
Commit d1b27648 authored by Birk Øvstetun Narvhus's avatar Birk Øvstetun Narvhus
Browse files

Update .gitlab-ci.yml file

parent 5ef7c7bc
Branches Pipe-and-Filter
No related tags found
No related merge requests found
#Workflow name image: maven:3.9.0-eclipse-temurin-19-focal
name: CI/CD Pipeline
on: variables:
#Manually trigger workflow runs SPRING_PROFILES_ACTIVE: gitlab-ci
workflow_dispatch:
#Trigger the workflow on push from the main branch stages:
push: - build
branches: - test
- main - deploy
jobs:
#Test's job maven-build:
tests: stage: build
name: Unit tests script:
#Run on Ubuntu using the latest version - mvn -v
runs-on: ubuntu-latest - mvn package
#Job's steps
steps:
#Check-out your repository under $GITHUB_WORKSPACE, so your workflow can access it run-tests:
- uses: actions/checkout@v1 stage: test
#Set up JDK 11 script:
- name: Set up JDK - mvn install
uses: actions/setup-java@v1 - mvn test
with:
java-version: '20' deploy-jar:
#Set up Maven cache stage: deploy
- name: Cache Maven packages script:
#This action allows caching dependencies and build outputs to improve workflow execution time. - mvn install
uses: actions/cache@v1 artifacts:
with: paths:
path: ~/.m2 - target/*.jar
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} \ No newline at end of file
restore-keys: ${{ runner.os }}-m2
#Run Tests
- name: Run Tests
run: mvn -B test
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment