Parallelize CI builds
This commit is contained in:
parent
8e0fe086c2
commit
0064d8bd96
|
@ -4,6 +4,8 @@ shopt -s globstar nullglob extglob
|
||||||
|
|
||||||
TOOLS="$(ls -d ${ANDROID_HOME}/build-tools/* | tail -1)"
|
TOOLS="$(ls -d ${ANDROID_HOME}/build-tools/* | tail -1)"
|
||||||
|
|
||||||
|
# Get APKs from previous jobs' artifacts
|
||||||
|
cp -R ~/apk-artifacts/ $PWD
|
||||||
APKS=( **/*".apk" )
|
APKS=( **/*".apk" )
|
||||||
|
|
||||||
# Fail if too little extensions seem to have been built
|
# Fail if too little extensions seem to have been built
|
||||||
|
|
|
@ -16,16 +16,108 @@ jobs:
|
||||||
- name: Validate Gradle Wrapper
|
- name: Validate Gradle Wrapper
|
||||||
uses: gradle/wrapper-validation-action@v1
|
uses: gradle/wrapper-validation-action@v1
|
||||||
|
|
||||||
build:
|
build_multisrc:
|
||||||
name: Build extension repo
|
name: Build multisrc modules
|
||||||
needs: check_wrapper
|
needs: check_wrapper
|
||||||
if: "!startsWith(github.event.head_commit.message, '[SKIP CI]')"
|
if: "!startsWith(github.event.head_commit.message, '[SKIP CI]')"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
lang: [all, en, ar, ca, de, es, fr, id, it, ja, ko, pt, ru, th, tr, vi, zh]
|
||||||
steps:
|
steps:
|
||||||
- name: Cancel previous runs
|
- name: Checkout master branch
|
||||||
uses: styfle/cancel-workflow-action@0.8.0
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set up JDK
|
||||||
|
uses: actions/setup-java@v1
|
||||||
with:
|
with:
|
||||||
access_token: ${{ github.token }}
|
java-version: 1.8
|
||||||
|
|
||||||
|
- name: Copy CI gradle.properties
|
||||||
|
run: |
|
||||||
|
mkdir -p ~/.gradle
|
||||||
|
cp .github/runner-files/ci-gradle.properties ~/.gradle/gradle.properties
|
||||||
|
|
||||||
|
- name: Generate sources from the multi-source library
|
||||||
|
uses: eskatos/gradle-command-action@v1
|
||||||
|
env:
|
||||||
|
CI_MULTISRC: "true"
|
||||||
|
with:
|
||||||
|
arguments: :multisrc:generateExtensions
|
||||||
|
wrapper-cache-enabled: true
|
||||||
|
dependencies-cache-enabled: true
|
||||||
|
configuration-cache-enabled: true
|
||||||
|
|
||||||
|
- name: Build "${{ matrix.lang }}" extensions
|
||||||
|
uses: eskatos/gradle-command-action@v1
|
||||||
|
env:
|
||||||
|
CI_MULTISRC: "true"
|
||||||
|
CI_MATRIX_LANG: ${{ matrix.lang }}
|
||||||
|
with:
|
||||||
|
arguments: assembleRelease
|
||||||
|
wrapper-cache-enabled: true
|
||||||
|
dependencies-cache-enabled: true
|
||||||
|
configuration-cache-enabled: true
|
||||||
|
|
||||||
|
- name: Upload "${{ matrix.lang }}" APKs
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: "multisrc-${{ matrix.lang }}-apks"
|
||||||
|
path: "**/*.apk"
|
||||||
|
retention-days: 1
|
||||||
|
|
||||||
|
build_individual:
|
||||||
|
name: Build individual modules
|
||||||
|
needs: check_wrapper
|
||||||
|
if: "!startsWith(github.event.head_commit.message, '[SKIP CI]')"
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
lang: [all, en, ar, ca, de, es, fr, id, it, ja, ko, pt, ru, th, tr, vi, zh]
|
||||||
|
steps:
|
||||||
|
- name: Checkout master branch
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set up JDK
|
||||||
|
uses: actions/setup-java@v1
|
||||||
|
with:
|
||||||
|
java-version: 1.8
|
||||||
|
|
||||||
|
- name: Copy CI gradle.properties
|
||||||
|
run: |
|
||||||
|
mkdir -p ~/.gradle
|
||||||
|
cp .github/runner-files/ci-gradle.properties ~/.gradle/gradle.properties
|
||||||
|
|
||||||
|
- name: Build "${{ matrix.lang }}" extensions
|
||||||
|
uses: eskatos/gradle-command-action@v1
|
||||||
|
env:
|
||||||
|
CI_MULTISRC: "false"
|
||||||
|
CI_MATRIX_LANG: ${{ matrix.lang }}
|
||||||
|
with:
|
||||||
|
arguments: assembleRelease
|
||||||
|
wrapper-cache-enabled: true
|
||||||
|
dependencies-cache-enabled: true
|
||||||
|
configuration-cache-enabled: true
|
||||||
|
|
||||||
|
- name: Upload "${{ matrix.lang }}" APKs
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: "individual-${{ matrix.lang }}-apks"
|
||||||
|
path: "**/*.apk"
|
||||||
|
retention-days: 1
|
||||||
|
|
||||||
|
publish_repo:
|
||||||
|
name: Publish repo
|
||||||
|
needs:
|
||||||
|
- build_multisrc
|
||||||
|
- build_individual
|
||||||
|
if: "github.repository == 'tachiyomiorg/tachiyomi-extensions'"
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Download APK artifacts
|
||||||
|
uses: actions/download-artifact@v2
|
||||||
|
with:
|
||||||
|
path: ~/apk-artifacts
|
||||||
|
|
||||||
- name: Checkout master branch
|
- name: Checkout master branch
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
|
@ -33,43 +125,7 @@ jobs:
|
||||||
ref: master
|
ref: master
|
||||||
path: master
|
path: master
|
||||||
|
|
||||||
- name: Set up JDK 1.8
|
|
||||||
uses: actions/setup-java@v1
|
|
||||||
with:
|
|
||||||
java-version: 1.8
|
|
||||||
|
|
||||||
- name: Copy CI gradle.properties
|
|
||||||
run: |
|
|
||||||
cd master
|
|
||||||
mkdir -p ~/.gradle
|
|
||||||
cp .github/runner-files/ci-gradle.properties ~/.gradle/gradle.properties
|
|
||||||
|
|
||||||
- name: Generate sources from the multi-source library
|
|
||||||
uses: eskatos/gradle-command-action@v1
|
|
||||||
env:
|
|
||||||
CI_PUSH: "true"
|
|
||||||
with:
|
|
||||||
build-root-directory: master
|
|
||||||
wrapper-directory: master
|
|
||||||
arguments: :multisrc:generateExtensions
|
|
||||||
wrapper-cache-enabled: true
|
|
||||||
dependencies-cache-enabled: true
|
|
||||||
configuration-cache-enabled: true
|
|
||||||
|
|
||||||
- name: Build extensions
|
|
||||||
uses: eskatos/gradle-command-action@v1
|
|
||||||
env:
|
|
||||||
CI_PUSH: "true"
|
|
||||||
with:
|
|
||||||
build-root-directory: master
|
|
||||||
wrapper-directory: master
|
|
||||||
arguments: assembleRelease
|
|
||||||
wrapper-cache-enabled: true
|
|
||||||
dependencies-cache-enabled: true
|
|
||||||
configuration-cache-enabled: true
|
|
||||||
|
|
||||||
- name: Sign APKs
|
- name: Sign APKs
|
||||||
if: github.repository == 'tachiyomiorg/tachiyomi-extensions'
|
|
||||||
run: |
|
run: |
|
||||||
cd master
|
cd master
|
||||||
./.github/scripts/sign-apks.sh \
|
./.github/scripts/sign-apks.sh \
|
||||||
|
@ -79,20 +135,17 @@ jobs:
|
||||||
${{ secrets.KEY_PASSWORD }}
|
${{ secrets.KEY_PASSWORD }}
|
||||||
|
|
||||||
- name: Create repo artifacts
|
- name: Create repo artifacts
|
||||||
if: github.repository == 'tachiyomiorg/tachiyomi-extensions'
|
|
||||||
run: |
|
run: |
|
||||||
cd master
|
cd master
|
||||||
./.github/scripts/create-repo.sh
|
./.github/scripts/create-repo.sh
|
||||||
|
|
||||||
- name: Checkout repo branch
|
- name: Checkout repo branch
|
||||||
if: github.repository == 'tachiyomiorg/tachiyomi-extensions'
|
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
ref: repo
|
ref: repo
|
||||||
path: repo
|
path: repo
|
||||||
|
|
||||||
- name: Deploy repo
|
- name: Deploy repo
|
||||||
if: github.repository == 'tachiyomiorg/tachiyomi-extensions'
|
|
||||||
run: |
|
run: |
|
||||||
cd repo
|
cd repo
|
||||||
../master/.github/scripts/commit-repo.sh
|
../master/.github/scripts/commit-repo.sh
|
||||||
|
|
|
@ -10,8 +10,8 @@ project(":duktape-stub").projectDir = File("lib/duktape-stub")
|
||||||
include(":lib-dataimage")
|
include(":lib-dataimage")
|
||||||
project(":lib-dataimage").projectDir = File("lib/dataimage")
|
project(":lib-dataimage").projectDir = File("lib/dataimage")
|
||||||
|
|
||||||
if (System.getenv("CI") == null || System.getenv("CI_PUSH") == "true") {
|
if (System.getenv("CI") == null) {
|
||||||
// Local development or full build for push
|
// Local development (full project build)
|
||||||
|
|
||||||
include(":multisrc")
|
include(":multisrc")
|
||||||
project(":multisrc").projectDir = File("multisrc")
|
project(":multisrc").projectDir = File("multisrc")
|
||||||
|
|
Loading…
Reference in New Issue