Add GitHub Actions automation and JitPack configuration #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up JDK 21 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '21' | |
distribution: 'temurin' | |
- name: Cache Maven dependencies | |
uses: actions/cache@v4 | |
with: | |
path: ~/.m2 | |
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | |
restore-keys: ${{ runner.os }}-m2 | |
- name: Run tests - Main Library | |
run: mvn clean test | |
- name: Run tests - Integration Tests | |
run: | | |
cd integration-tests | |
mvn clean test | |
- name: Build library | |
run: mvn clean compile | |
- name: Build integration tests | |
run: | | |
cd integration-tests | |
mvn clean compile | |
jitpack-test: | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
steps: | |
- name: Trigger JitPack build for main branch | |
run: | | |
echo "Triggering JitPack build for main-SNAPSHOT" | |
curl -s "https://jitpack.io/com/github/wassertim/dynamodb-toolkit/main-SNAPSHOT" || true |