From e2300fb003a7b10590debaba89d216e1efe589ca Mon Sep 17 00:00:00 2001 From: Liangbin Lian <1129525450@qq.com> Date: Tue, 21 Jan 2025 21:23:47 +0800 Subject: [PATCH] ci: cache build state (#448) * ci: cache build state * Update ci.yml * Update ci.yml * Update ci.yml --- .github/workflows/ci.yml | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index de1ceca3..9e710608 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,12 +23,6 @@ jobs: runs-on: ubuntu-latest name: Build Meta steps: - - name: Checkout - uses: actions/checkout@main - with: - path: 'meta' - fetch-depth: 5 - - name: Initialization environment env: DEBIAN_FRONTEND: noninteractive @@ -42,6 +36,23 @@ jobs: sudo timedatectl set-timezone "$TZ" # curl -fsSL https://raw.githubusercontent.com/P3TERX/dotfiles/master/.bashrc >> ~/.bashrc + - name: 'Restore state from cache' + id: build-cache + uses: actions/cache@v3 + with: + path: | + meta/.git + cache + key: meta-build-cache-v1-${{ github.ref_name }}-${{ github.run_id }} + restore-keys: | + meta-build-cache-v1-${{ github.ref_name }}- + enableCrossOsArchive: true + + - name: Checkout + uses: actions/checkout@main + with: + path: 'meta' + - name: 'Restore SDK from cache' id: sdk-cache uses: actions/cache@v3 @@ -95,6 +106,8 @@ jobs: - name: Update feeds run: | + [ -d cache/feeds ] || mkdir -p cache/feeds + ln -s `pwd`/cache/feeds ${SDK_NAME}/feeds cd ${SDK_NAME} && ./scripts/feeds update compat meta ./scripts/feeds install -a -p compat -d y ./scripts/feeds install -a -p meta -d y