diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 2de4b19de..fd435494f 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -51,6 +51,7 @@ jobs: env: UPLOAD_ARTIFACT: "false" ONLY_CACHE: "false" + PREPARE_PATH: "Telegram/build/prepare/prepare.py" steps: - name: Get repository name. @@ -78,14 +79,16 @@ jobs: uses: actions/cache@v2 with: path: ThirdParty - key: ${{ runner.OS }}-third-party + key: ${{ runner.OS }}-third-party-${{ hashFiles(format('{0}/{1}', env.REPO_NAME, env.PREPARE_PATH)) }} + restore-keys: ${{ runner.OS }}-third-party- - name: Libraries cache. id: cache-libs uses: actions/cache@v2 with: path: Libraries - key: ${{ runner.OS }}-libs + key: ${{ runner.OS }}-libs-${{ hashFiles(format('{0}/{1}', env.REPO_NAME, env.PREPARE_PATH)) }} + restore-keys: ${{ runner.OS }}-libs- - name: Libraries. run: | diff --git a/.github/workflows/win.yml b/.github/workflows/win.yml index d65db1c36..7490ae0ad 100644 --- a/.github/workflows/win.yml +++ b/.github/workflows/win.yml @@ -58,7 +58,6 @@ jobs: defaults: run: shell: cmd - working-directory: ${{ github.workspace }} steps: - name: Prepare directories. @@ -98,6 +97,8 @@ jobs: echo "C:\\Program Files\\NASM\\" >> $GITHUB_PATH echo "C:\\ProgramData\\chocolatey\\lib\\ninja\\tools\\" >> $GITHUB_PATH + echo "CACHE_KEY=$(sha256sum $TBUILD/$REPO_NAME/$PREPARE_PATH | awk '{ print $1 }')" >> $GITHUB_ENV + echo "Configurate git for cherry-picks." git config --global user.email "you@example.com" git config --global user.name "Sample" @@ -112,7 +113,8 @@ jobs: uses: actions/cache@v2 with: path: ${{ env.TBUILD }}/Libraries - key: ${{ runner.OS }}-libs + key: ${{ runner.OS }}-libs-${{ env.CACHE_KEY }} + restore-keys: ${{ runner.OS }}-libs- - name: Libraries. env: