[#65] Support included builds

Namespacing the build-conventions will solve issues with included build name conflicts.

Namespacing the lib will also prevent conflicts with included builds.
This commit is contained in:
Carter Jernigan 2022-06-14 08:30:12 -04:00 committed by GitHub
parent 1108fe1cdf
commit 8ca01777c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 23 additions and 26 deletions

View File

@ -20,42 +20,39 @@ runs:
echo "org.gradle.daemon=false" >> ~/.gradle/gradle.properties
- name: Gradle Wrapper Cache
id: gradle-wrapper-cache
uses: actions/cache@30f413bfed0a2bc738fdfd409e5a9e96b24545fd
uses: actions/cache@c3f1317a9e7b1ef106c153ac8c0f00fed3ddbc0d
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles(format('{0}{1}', github.workspace, '/gradle/wrapper/gradle-wrapper.properties')) }}
- name: Gradle Dependency Cache
id: gradle-dependency-cache
uses: actions/cache@30f413bfed0a2bc738fdfd409e5a9e96b24545fd
uses: actions/cache@c3f1317a9e7b1ef106c153ac8c0f00fed3ddbc0d
with:
path: ~/.gradle/caches/modules-2
key: ${{ runner.os }}-gradle-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/gradle.properties')) }}
key: ${{ runner.os }}-gradle-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/gradle.properties'), format('{0}{1}', github.workspace, '/gradle/libs.versions.toml')) }}
restore-keys: |
${{ runner.os }}-gradle-deps
# This tries to fall back to the build cache from the main branch, while ensuring that
# main branch builds repopulate the cache each time.
- name: Gradle Build Cache Main
id: gradle-build-cache-main
if: github.event.pull_request.head.sha == ''
uses: actions/cache@30f413bfed0a2bc738fdfd409e5a9e96b24545fd
${{ runner.os }}-gradle-deps-
- name: Kotlin Dependency Cache
id: kotlin-dependency-cache
uses: actions/cache@c3f1317a9e7b1ef106c153ac8c0f00fed3ddbc0d
with:
path: |
~/.konan
key: ${{ runner.os }}-kotlin-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/gradle.properties')) }}
# The build cache is doing two things:
# 1. Relying on the most recent main branch build to provide a partial cache for both main branch and PR builds.
# 2. Relying on the sha for an exact match so that the prime_cache job is re-used by all dependent jobs in a single workflow run
- name: Gradle Build Cache
id: gradle-build-cache
uses: actions/cache@c3f1317a9e7b1ef106c153ac8c0f00fed3ddbc0d
with:
path: |
~/.gradle/caches/build-cache-1
~/.gradle/caches/transforms-3
.gradle/configuration-cache
key: ${{ runner.os }}-gradle-build-${{ github.sha }}
restore-keys: |
${{ runner.os }}-gradle-build
- name: Gradle Build Cache Pull Request
id: gradle-build-cache-pr
if: github.event.pull_request.head.sha != ''
uses: actions/cache@30f413bfed0a2bc738fdfd409e5a9e96b24545fd
with:
path: |
~/.gradle/caches/build-cache-1
~/.gradle/caches/transforms-3
key: ${{ runner.os }}-gradle-build-${{ github.event.pull_request.base.sha }}
restore-keys: |
${{ runner.os }}-gradle-build
${{ runner.os }}-gradle-build-
- name: Download Gradle
if: steps.gradle-wrapper-cache.outputs.cache-hit != 'true'
shell: bash
@ -65,9 +62,9 @@ runs:
if: steps.gradle-dependency-cache.outputs.cache-hit != 'true'
shell: bash
run: |
./gradlew dependencies :lib:dependencies
./gradlew dependencies :bip39-lib:dependencies
- name: Compile
if: steps.gradle-build-cache-main.outputs.cache-hit != 'true' && steps.gradle-build-cache-pr.outputs.cache-hit != 'true'
if: steps.gradle-build-cache.outputs.cache-hit != 'true'
shell: bash
run: |
./gradlew assemble testClasses

View File

@ -16,6 +16,6 @@ dependencyResolutionManagement {
}
rootProject.name = "kotlin-bip39"
include(":lib")
include(":bip39-lib")
includeBuild("build-conventions")
includeBuild("build-conventions-bip39")