mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-19 10:32:05 +01:00
4f72eca21c
I am not happy with the concept of a build system wrapper, not to say that I despise it. There is no reason why a single machine couldn't have multiple versions of a build system-wide installed, and there is no reason why each developer should download an individual copy of a build system into the developers home directory. But here we are…
87 lines
2.2 KiB
YAML
87 lines
2.2 KiB
YAML
name: CI
|
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
build:
|
|
name: Build Smack
|
|
|
|
runs-on: ubuntu-20.04
|
|
strategy:
|
|
matrix:
|
|
java:
|
|
- 11
|
|
- 15
|
|
env:
|
|
PRIMARY_JAVA_VERSION: 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 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
|
|
run: ./gradlew check --stacktrace
|
|
|
|
# Test local publish
|
|
- name: Gradle publish
|
|
run: ./gradlew publishToMavenLocal --stacktrace
|
|
|
|
# Javadoc
|
|
- name: Javadoc
|
|
if: ${{ matrix.java == env.PRIMARY_JAVA_VERSION }}
|
|
run: ./gradlew javadocAll --stacktrace
|
|
|
|
# Test Coverage Report
|
|
- name: Jacoco Test Coverage
|
|
if: ${{ matrix.java == env.PRIMARY_JAVA_VERSION }}
|
|
run: ./gradlew jacocoRootReport coveralls
|
|
env:
|
|
COVERALLS_REPO_TOKEN: S2ecSJja2cKJa9yv45C8ZFPohXuRrTXKd
|
|
|
|
# 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
|