ci: Added build cache to workflow
This commit is contained in:
parent
d09fc02078
commit
6b0de66cf6
2 changed files with 30 additions and 20 deletions
13
.github/workflows/build_pull_request.yml
vendored
13
.github/workflows/build_pull_request.yml
vendored
|
@ -13,7 +13,7 @@ concurrency:
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
env:
|
env:
|
||||||
CI_CHUNK_SIZE: 288
|
CI_CHUNK_SIZE: 65
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
prepare:
|
prepare:
|
||||||
|
@ -75,6 +75,17 @@ jobs:
|
||||||
with:
|
with:
|
||||||
cache-read-only: true
|
cache-read-only: true
|
||||||
|
|
||||||
|
- name: Restore build cache
|
||||||
|
uses: https://github.com/actions/cache/restore@v3
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
src/**/build
|
||||||
|
!src/**/build/outputs
|
||||||
|
key: build-cache-${{ github.event.pull_request.base.sha }}-${{ matrix.chunk }}
|
||||||
|
restore-keys: |
|
||||||
|
build-cache-${{ github.event.pull_request.base.sha }}-
|
||||||
|
build-cache-
|
||||||
|
|
||||||
- name: Build extensions (chunk ${{ matrix.chunk }})
|
- name: Build extensions (chunk ${{ matrix.chunk }})
|
||||||
env:
|
env:
|
||||||
CI_CHUNK_NUM: ${{ matrix.chunk }}
|
CI_CHUNK_NUM: ${{ matrix.chunk }}
|
||||||
|
|
37
.github/workflows/build_push.yml
vendored
37
.github/workflows/build_push.yml
vendored
|
@ -31,27 +31,22 @@ jobs:
|
||||||
ref: main
|
ref: main
|
||||||
token: ${{ secrets.BOT_PAT }}
|
token: ${{ secrets.BOT_PAT }}
|
||||||
|
|
||||||
- name: Find lib changes
|
|
||||||
id: modified-libs
|
|
||||||
uses: https://github.com/tj-actions/changed-files@90a06d6ba9543371ab4df8eeca0be07ca6054959 #v42
|
|
||||||
with:
|
|
||||||
files: lib/
|
|
||||||
files_ignore: lib/**.md
|
|
||||||
files_separator: " "
|
|
||||||
safe_output: false
|
|
||||||
|
|
||||||
# This step is going to commit, but this will not trigger another workflow.
|
|
||||||
- name: Bump extensions that uses a modified lib
|
|
||||||
if: steps.modified-libs.outputs.any_changed == 'true'
|
|
||||||
run: |
|
|
||||||
chmod +x ./.github/scripts/bump-versions.py ${{ steps.modified-libs.outputs.all_changed_files }}
|
|
||||||
|
|
||||||
- name: Get number of modules
|
- name: Get number of modules
|
||||||
run: |
|
run: |
|
||||||
set -x
|
set -x
|
||||||
projects=(src/*/*)
|
projects=(src/*/*)
|
||||||
echo "NUM_INDIVIDUAL_MODULES=${#projects[@]}" >> "$GITHUB_ENV"
|
echo "NUM_INDIVIDUAL_MODULES=${#projects[@]}" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
|
# Temporary pause because of leak of tj-actions/changed-files
|
||||||
|
# - name: Find lib changes
|
||||||
|
# id: modified-libs
|
||||||
|
# uses: tj-actions/changed-files@90a06d6ba9543371ab4df8eeca0be07ca6054959 #v42
|
||||||
|
# with:
|
||||||
|
# files: lib/
|
||||||
|
# files_ignore: lib/**.md
|
||||||
|
# files_separator: " "
|
||||||
|
# safe_output: false
|
||||||
|
|
||||||
- name: Import GPG key
|
- name: Import GPG key
|
||||||
uses: https://github.com/crazy-max/ghaction-import-gpg@v6 # v6.1.0
|
uses: https://github.com/crazy-max/ghaction-import-gpg@v6 # v6.1.0
|
||||||
with:
|
with:
|
||||||
|
@ -119,6 +114,14 @@ jobs:
|
||||||
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
|
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
|
||||||
run: chmod +x ./gradlew && ./gradlew -p src assembleRelease
|
run: chmod +x ./gradlew && ./gradlew -p src assembleRelease
|
||||||
|
|
||||||
|
- name: Cache build directories
|
||||||
|
uses: https://github.com/actions/cache/save@v3
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
src/**/build
|
||||||
|
!src/**/build/outputs
|
||||||
|
key: build-cache-${{ github.sha }}-${{ matrix.chunk }}
|
||||||
|
|
||||||
- name: Upload APKs
|
- name: Upload APKs
|
||||||
uses: https://code.forgejo.org/forgejo/upload-artifact@16871d9e8cfcf27ff31822cac382bbb5450f1e1e # v4-patch
|
uses: https://code.forgejo.org/forgejo/upload-artifact@16871d9e8cfcf27ff31822cac382bbb5450f1e1e # v4-patch
|
||||||
if: "github.repository == 'Kohi-den/extensions-source'"
|
if: "github.repository == 'Kohi-den/extensions-source'"
|
||||||
|
@ -184,10 +187,6 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
rsync -a --delete --exclude .git --exclude .gitignore main/repo/ repo --exclude README.md --exclude repo.json
|
rsync -a --delete --exclude .git --exclude .gitignore main/repo/ repo --exclude README.md --exclude repo.json
|
||||||
|
|
||||||
- name: Increase buffer size
|
|
||||||
run: |
|
|
||||||
git config --global http.postBuffer 157286400
|
|
||||||
|
|
||||||
- name: Deploy repo
|
- name: Deploy repo
|
||||||
uses: https://github.com/EndBug/add-and-commit@v9
|
uses: https://github.com/EndBug/add-and-commit@v9
|
||||||
with:
|
with:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue