Skip to content

Enhance GitHub Actions workflow for performing releases #8

Enhance GitHub Actions workflow for performing releases

Enhance GitHub Actions workflow for performing releases #8

name: Run Tests on Pull Requests
on:
pull_request:
types:
- opened
- edited
- reopened
- synchronize
- ready_for_review
- unlocked
branches:
- main
paths-ignore:
- '.github/**'
- '.run/**'
- 'samples/**'
- .editorconfig
- .gitignore
- LICENSE
- README.adoc
jobs:
build-and-test:
name: Build and Run Tests
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: '17'
- name: Determine Home Directory
id: find-home
run: |
echo "home=$HOME" >> $GITHUB_OUTPUT
- name: Cache Maven Local Repo
uses: actions/cache@v3
with:
path: ${{ steps.find-home.outputs.home }}/.m2/repository
key: ${{ runner.os }}-${{ runner.arch }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-maven-
- name: Run Maven Build and Verify
run: >-
./mvnw
--batch-mode
clean
verify