attempt to cache deps in non tag/PR actions for CI
This commit is contained in:
parent
95e2bdafaf
commit
8f9dae8350
47
.github/workflows/build-linux.yml
vendored
47
.github/workflows/build-linux.yml
vendored
@ -25,8 +25,52 @@ env:
|
|||||||
THIRD_PARTY_BASE_DIR: 'third-party'
|
THIRD_PARTY_BASE_DIR: 'third-party'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
# this helps in manual runs, if build fails, then deps are saved
|
||||||
|
dependencies:
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
# cache but not for tags or PRs
|
||||||
|
# !tag && !pull_request
|
||||||
|
# also you could use this: github.event_name != 'pull_request'
|
||||||
|
if: |
|
||||||
|
!startsWith(github.ref, 'refs/tags/') &&
|
||||||
|
!startsWith(github.ref, 'refs/pull/')
|
||||||
|
|
||||||
|
steps:
|
||||||
|
# we need branch because it has build scripts
|
||||||
|
- name: Checkout branch
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Lookup cache for deps
|
||||||
|
id: emu-deps-cache-step
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
key: ${{ env.DEPS_CACHE_KEY }}
|
||||||
|
path: ${{ env.DEPS_CACHE_DIR }}
|
||||||
|
lookup-only: true # don't restore cache if found
|
||||||
|
|
||||||
|
- name: Clone third-party deps (deps/linux)
|
||||||
|
if: steps.emu-deps-cache-step.outputs.cache-hit != 'true'
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: 'third-party/deps/linux'
|
||||||
|
path: "${{env.THIRD_PARTY_BASE_DIR}}/deps/linux"
|
||||||
|
|
||||||
|
- name: Clone third-party deps (deps/common)
|
||||||
|
if: steps.emu-deps-cache-step.outputs.cache-hit != 'true'
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: 'third-party/deps/common'
|
||||||
|
path: "${{env.THIRD_PARTY_BASE_DIR}}/deps/common"
|
||||||
|
|
||||||
|
- name: Build deps
|
||||||
|
if: steps.emu-deps-cache-step.outputs.cache-hit != 'true'
|
||||||
|
shell: bash
|
||||||
|
run: sudo chmod 777 build_linux_deps.sh && sudo ./build_linux_deps.sh
|
||||||
|
|
||||||
|
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
|
needs: [ dependencies ]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout branch
|
- name: Checkout branch
|
||||||
@ -40,13 +84,12 @@ jobs:
|
|||||||
if: |
|
if: |
|
||||||
!startsWith(github.ref, 'refs/tags/') &&
|
!startsWith(github.ref, 'refs/tags/') &&
|
||||||
!startsWith(github.ref, 'refs/pull/')
|
!startsWith(github.ref, 'refs/pull/')
|
||||||
|
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
key: ${{ env.DEPS_CACHE_KEY }}
|
key: ${{ env.DEPS_CACHE_KEY }}
|
||||||
path: ${{ env.DEPS_CACHE_DIR }}
|
path: ${{ env.DEPS_CACHE_DIR }}
|
||||||
lookup-only: true
|
|
||||||
|
|
||||||
|
# attempt to download again because in tags/PRs no cache is created
|
||||||
- name: Clone third-party deps (deps/linux)
|
- name: Clone third-party deps (deps/linux)
|
||||||
if: steps.emu-deps-cache-step.outputs.cache-hit != 'true'
|
if: steps.emu-deps-cache-step.outputs.cache-hit != 'true'
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
53
.github/workflows/build-win.yml
vendored
53
.github/workflows/build-win.yml
vendored
@ -24,8 +24,60 @@ env:
|
|||||||
THIRD_PARTY_BASE_DIR: 'third-party'
|
THIRD_PARTY_BASE_DIR: 'third-party'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
# this helps in manual runs, if build fails, then deps are saved
|
||||||
|
dependencies:
|
||||||
|
runs-on: windows-2022
|
||||||
|
# cache but not for tags or PRs
|
||||||
|
# !tag && !pull_request
|
||||||
|
# also you could use this: github.event_name != 'pull_request'
|
||||||
|
if: |
|
||||||
|
!startsWith(github.ref, 'refs/tags/') &&
|
||||||
|
!startsWith(github.ref, 'refs/pull/')
|
||||||
|
|
||||||
|
steps:
|
||||||
|
# we need branch because it has build scripts
|
||||||
|
- name: Checkout branch
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Lookup cache for deps
|
||||||
|
id: emu-deps-cache-step
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
key: ${{ env.DEPS_CACHE_KEY }}
|
||||||
|
path: ${{ env.DEPS_CACHE_DIR }}
|
||||||
|
lookup-only: true # don't restore cache if found
|
||||||
|
|
||||||
|
- name: Clone third-party deps (deps/win)
|
||||||
|
if: steps.emu-deps-cache-step.outputs.cache-hit != 'true'
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: 'third-party/deps/win'
|
||||||
|
path: "${{env.THIRD_PARTY_BASE_DIR}}/deps/win"
|
||||||
|
|
||||||
|
- name: Clone third-party deps (deps/common)
|
||||||
|
if: steps.emu-deps-cache-step.outputs.cache-hit != 'true'
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: 'third-party/deps/common'
|
||||||
|
path: "${{env.THIRD_PARTY_BASE_DIR}}/deps/common"
|
||||||
|
|
||||||
|
- name: Clone third-party deps (common/win)
|
||||||
|
if: steps.emu-deps-cache-step.outputs.cache-hit != 'true'
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: 'third-party/common/win'
|
||||||
|
path: "${{env.THIRD_PARTY_BASE_DIR}}/common/win"
|
||||||
|
|
||||||
|
- name: Build deps
|
||||||
|
if: steps.emu-deps-cache-step.outputs.cache-hit != 'true'
|
||||||
|
shell: cmd
|
||||||
|
working-directory: ${{ github.workspace }}
|
||||||
|
run: build_win_deps.bat
|
||||||
|
|
||||||
|
|
||||||
build:
|
build:
|
||||||
runs-on: windows-2022
|
runs-on: windows-2022
|
||||||
|
needs: [ dependencies ]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout branch
|
- name: Checkout branch
|
||||||
@ -44,6 +96,7 @@ jobs:
|
|||||||
key: ${{ env.DEPS_CACHE_KEY }}
|
key: ${{ env.DEPS_CACHE_KEY }}
|
||||||
path: ${{ env.DEPS_CACHE_DIR }}
|
path: ${{ env.DEPS_CACHE_DIR }}
|
||||||
|
|
||||||
|
# attempt to download again because in tags/PRs no cache is created
|
||||||
- name: Clone third-party deps (deps/win)
|
- name: Clone third-party deps (deps/win)
|
||||||
if: steps.emu-deps-cache-step.outputs.cache-hit != 'true'
|
if: steps.emu-deps-cache-step.outputs.cache-hit != 'true'
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
Loading…
x
Reference in New Issue
Block a user