mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-12-23 02:58:00 +01:00
8cc4ba0a42
This also renames the CI workflow from "Smack CI" to just "CI".
95 lines
2.5 KiB
YAML
95 lines
2.5 KiB
YAML
name: CI
|
|
|
|
env:
|
|
GRADLE_VERSION: 6.7.1
|
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
build:
|
|
name: Build Smack
|
|
|
|
runs-on: ubuntu-20.04
|
|
strategy:
|
|
matrix:
|
|
java: [ 1.8, 11 ]
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
- name: Set up JDK ${{ matrix.java }}
|
|
uses: actions/setup-java@v1
|
|
with:
|
|
java-version: ${{ matrix.java }}
|
|
|
|
# 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 Gradle Binary
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: |
|
|
~/gradle-bin-${GRADLE_VERSION}/
|
|
key: gradle-bin-${GRADLE_VERSION}
|
|
- name: Cache Android SDK
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: |
|
|
~/.android/sdk
|
|
key: android-${{ hashFiles('build.gradle') }}
|
|
restore-keys: |
|
|
android-
|
|
|
|
# Pre-reqs
|
|
- name: Grab gradle wrapper
|
|
run: |
|
|
wget https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-all.zip
|
|
unzip gradle-${GRADLE_VERSION}-all.zip
|
|
echo "PATH_TO_GRADLE=./gradle-${GRADLE_VERSION}/bin/gradle" >> $GITHUB_ENV
|
|
- 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
|
|
run: ${PATH_TO_GRADLE} check --stacktrace
|
|
|
|
# Test local publish
|
|
- name: Gradle publish
|
|
run: ${PATH_TO_GRADLE} publishToMavenLocal --stacktrace
|
|
|
|
# Javadoc
|
|
- name: Javadoc
|
|
if: ${{ matrix.java == 11 }}
|
|
run: ${PATH_TO_GRADLE} javadocAll --stacktrace
|
|
|
|
# Test Coverage Report
|
|
- name: Jacoco Test Coverage
|
|
if: ${{ matrix.java == 1.8 }}
|
|
run: ${PATH_TO_GRADLE} jacocoRootReport coveralls
|
|
|
|
# Upload build artifacts
|
|
- name: Upload build artifacts
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: smack-java-${{ matrix.java }}
|
|
path: |
|
|
smack-*/build/libs/*.jar
|
|
!**/*-test-fixtures.jar
|
|
!**/*-tests.jar
|