Skip to content

Manual Maven CI

Manual Maven CI #8

Workflow file for this run

name: Manual Maven CI
on:
workflow_dispatch: # This event allows triggering the workflow manually
jobs:
build:
runs-on: ubuntu-latest #container env called runner that runs our code
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up JDK 9
uses: actions/setup-java@v2
with:
java-version: '9'
distribution: 'adopt'
- name: Cache Maven dependencies
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
fail-on-cache-miss: false
- name: Debug Cache
run: |
ls -l ~/.m2/
echo "Cache directory contents:"
ls -l ~/.m2/
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Test with Maven
run: mvn test --file pom.xml