Skip to content

Merge pull request #4 from Martin7-1/github-actions #1

Merge pull request #4 from Martin7-1/github-actions

Merge pull request #4 from Martin7-1/github-actions #1

Workflow file for this run

name: Java CI
on:
push:
branches:
- main
paths-ignore:
- '.gitignore'
- '*.md'
- 'LICENSE'
- '.github/*.md'
- '.github/*.yaml'
- '.github/ISSUE_TEMPLATE/*.md'
pull_request:
branches:
- main
paths-ignore:
- '.gitignore'
- '*.md'
- 'LICENSE'
- '.github/*.md'
- '.github/*.yaml'
- '.github/ISSUE_TEMPLATE/*.md'
jobs:
java_build:
strategy:
matrix:
java_version:
- 17
- 21
include:
- java_version: '17'
maven_opts: ''
- java_version: '21'
maven_opts: ''
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Create branch from commit by event name
run: |
if [[ '${{ github.event_name }}' == 'push' ]]; then
git branch __branch_before ${{ github.event.before }}
elif [[ "${{ github.event_name }}" == 'pull_request' ]]; then
git branch __branch_before ${{ github.event.pull_request.base.sha }}
fi
- name: Set up JDK ${{ matrix.java_version }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java_version }}
distribution: 'temurin'
cache: 'maven'
- name: Compile and test with JDK ${{ matrix.java_version }}
run: |
mvn -B -U -T4C test javadoc:aggregate \
-Dgib.disable=false -Dgib.referenceBranch=__branch_before \
${{ matrix.maven_opts }}
- name: Integration test with JDK ${{ matrix.java_version }}
if: ${{ github.repository == 'langchain4j/langchain4j-community' }}
run: |
mvn -B -U verify \
-Dgib.disable=false -Dgib.referenceBranch=__branch_before \
${{ matrix.maven_opts }}
# For checking some compliance things (require a recent JDK due to plugins so in a separate step)
compliance:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'maven'
# Check we only rely on permissive licenses in the main parts of the library:
- name: License Compliance
run: mvn -P compliance org.honton.chas:license-maven-plugin:compliance