2021-01-12 09:06:24 +01:00
|
|
|
name: CI
|
2020-10-28 18:31:32 +01:00
|
|
|
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: Build Smack
|
|
|
|
|
2023-03-10 09:16:52 +01:00
|
|
|
runs-on: ubuntu-22.04
|
2020-10-28 18:31:32 +01:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2021-02-14 19:42:27 +01:00
|
|
|
java:
|
|
|
|
- 11
|
2021-05-22 13:18:13 +02:00
|
|
|
env:
|
|
|
|
PRIMARY_JAVA_VERSION: 11
|
2020-10-28 18:31:32 +01:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-03-10 09:16:52 +01:00
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
2020-10-28 18:31:32 +01:00
|
|
|
- name: Set up JDK ${{ matrix.java }}
|
2023-03-10 09:16:52 +01:00
|
|
|
uses: actions/setup-java@v3
|
2020-10-28 18:31:32 +01:00
|
|
|
with:
|
|
|
|
java-version: ${{ matrix.java }}
|
2023-03-10 09:16:52 +01:00
|
|
|
distribution: temurin
|
2020-10-28 18:31:32 +01:00
|
|
|
|
|
|
|
# Caches
|
|
|
|
- name: Cache Maven
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: ~/.m2/repository
|
|
|
|
key: maven-${{ hashFiles('**/build.gradle') }}
|
|
|
|
restore-keys: |
|
|
|
|
maven-
|
|
|
|
- name: Cache Gradle
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: ~/.gradle/caches
|
|
|
|
key: gradle-caches-${{ hashFiles('**/build.gradle') }}
|
|
|
|
restore-keys:
|
|
|
|
gradle-caches
|
|
|
|
- name: Cache Android SDK
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.android/sdk
|
|
|
|
key: android-${{ hashFiles('build.gradle') }}
|
|
|
|
restore-keys: |
|
|
|
|
android-
|
|
|
|
|
|
|
|
# Pre-reqs
|
|
|
|
- name: Install GraphViz
|
|
|
|
run: sudo apt update && sudo apt install graphviz
|
|
|
|
- name: Install Android SDK Manager
|
|
|
|
uses: android-actions/setup-android@v2
|
|
|
|
- name: Install Android SDK
|
|
|
|
run: |
|
|
|
|
sdkmanager "platforms;android-19"
|
|
|
|
|
|
|
|
# Testing
|
|
|
|
- name: Gradle Check
|
2022-06-06 15:53:53 +02:00
|
|
|
run: ./gradlew check --stacktrace
|
2020-10-28 18:31:32 +01:00
|
|
|
|
|
|
|
# Test local publish
|
|
|
|
- name: Gradle publish
|
2022-06-06 15:53:53 +02:00
|
|
|
run: ./gradlew publishToMavenLocal --stacktrace
|
2020-10-28 18:31:32 +01:00
|
|
|
|
|
|
|
# Javadoc
|
|
|
|
- name: Javadoc
|
2021-05-22 13:18:13 +02:00
|
|
|
if: ${{ matrix.java == env.PRIMARY_JAVA_VERSION }}
|
2022-06-06 15:53:53 +02:00
|
|
|
run: ./gradlew javadocAll --stacktrace
|
2020-10-28 18:31:32 +01:00
|
|
|
|
|
|
|
# Test Coverage Report
|
|
|
|
- name: Jacoco Test Coverage
|
2021-05-22 13:18:13 +02:00
|
|
|
if: ${{ matrix.java == env.PRIMARY_JAVA_VERSION }}
|
2022-06-06 15:53:53 +02:00
|
|
|
run: ./gradlew jacocoRootReport coveralls
|
2021-01-12 12:43:10 +01:00
|
|
|
env:
|
|
|
|
COVERALLS_REPO_TOKEN: S2ecSJja2cKJa9yv45C8ZFPohXuRrTXKd
|
2020-10-28 18:31:32 +01:00
|
|
|
|
|
|
|
# Upload build artifacts
|
|
|
|
- name: Upload build artifacts
|
2024-09-12 11:53:56 +02:00
|
|
|
uses: actions/upload-artifact@v4
|
2020-10-28 18:31:32 +01:00
|
|
|
with:
|
|
|
|
name: smack-java-${{ matrix.java }}
|
|
|
|
path: |
|
|
|
|
smack-*/build/libs/*.jar
|
|
|
|
!**/*-test-fixtures.jar
|
|
|
|
!**/*-tests.jar
|