Merge pull request #473 from kennethshackleton/prepare-0.20.0 #1675
Workflow file for this run
This file contains 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: 'Continuous Integration' | |
on: [pull_request, push] | |
permissions: read-all | |
jobs: | |
ci-pipeline: | |
name: 'Continuous Integration' | |
runs-on: ubuntu-latest | |
timeout-minutes: 60 | |
steps: | |
- name: 'Set environment' | |
run: | | |
if [[ ${GITHUB_REF} == 'refs/heads/main' ]]; then | |
echo 'SCAN=--scan' >> ${GITHUB_ENV} | |
fi | |
- name: 'Install system packages' | |
run: sudo apt-get install -y --no-install-recommends clang gcc make sed tcl | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 2 | |
submodules: true | |
- uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: 17 | |
- name: 'Build cache' | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.gradle/caches | |
~/.gradle/wrapper | |
~/OpenSSL/build | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
restore-keys: | | |
${{ runner.os }}-gradle- | |
- name: 'ccache' | |
uses: hendrikmuhs/[email protected] | |
- name: 'Gradle configuration' | |
run: | | |
echo 'org.gradle.caching=true' >> gradle.properties | |
echo 'plugins {' >> settings.gradle.kts | |
echo ' id("com.gradle.enterprise").version("3.6.3")' >> settings.gradle.kts | |
echo '}' >> settings.gradle.kts | |
echo 'gradleEnterprise {' >> settings.gradle.kts | |
echo ' buildScan {' >> settings.gradle.kts | |
echo ' termsOfServiceUrl = "https://gradle.com/terms-of-service"' >> settings.gradle.kts | |
echo ' termsOfServiceAgree = "yes"' >> settings.gradle.kts | |
echo ' }' >> settings.gradle.kts | |
echo '}' >> settings.gradle.kts | |
- name: 'Licenses' | |
run: ./gradlew licensee --no-configuration-cache | |
- name: 'Analyse' | |
run: ./gradlew detekt ktlintCheck lintDebug ${{ env.SCAN }} | |
- uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: 'Analyses' | |
path: | | |
**/build/reports/detekt | |
- name: 'Unit tests' | |
run: ./gradlew :selekt-android:testDebugUnitTest :selekt-java:test :koverHtmlReport -x integrationTest ${{ env.SCAN }} | |
- uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: 'Unit test and coverage reports' | |
path: | | |
build/reports/kover/html | |
selekt-android/build/reports/tests/testDebugUnitTest | |
selekt-java/build/reports/tests/test | |
- name: 'Build Selekt' | |
run: | | |
./gradlew assembleRelease ${{ env.SCAN }} | |
- name: 'Verify coverage' | |
run: | |
./gradlew :koverVerify -x integrationTest | |
- name: 'Build others' | |
run: | | |
./gradlew assembleAndroidTest :AndroidCLI:assembleDebug :selekt-android-lint:assemble jmhClasses | |
- name: 'Tear down' | |
if: always() | |
run: | | |
./gradlew --stop |