First try on internal/global cache

This commit is contained in:
Xargon Wan 2022-05-01 22:43:26 +09:00
parent 34ddfd9e63
commit 09972b9bb9

View file

@ -15,41 +15,38 @@ on:
# Allows you to run this workflow manually from the Actions tab # Allows you to run this workflow manually from the Actions tab
workflow_dispatch: workflow_dispatch:
jobs: jobs:
# Job1_-_Prepearing_enviornment: Job1_-_Prepearing_enviornment:
# runs-on: ubuntu-latest runs-on: ubuntu-latest
# steps: steps:
# # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it+++++++++++++++++++++++++++++++++++
# - uses: actions/checkout@v3
# - name: Prepearing enviornment
# run: |
# git submodule init
# git submodule update
# sudo add-apt-repository ppa:alexlarsson/flatpak
# sudo apt-get update
# sudo apt install flatpak flatpak-builder p7zip-full
# sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
# sudo flatpak install -y org.kde.Sdk//5.15-21.08 org.kde.Platform//5.15-21.08 io.qt.qtwebengine.BaseApp/x86_64/5.15-21.08 org.freedesktop.Sdk.Extension.llvm13
# - name: cache-cooker - name: Get date for artifacts
# id: cache-cooker id: date
# uses: actions/cache@v2 run: echo "::set-output name=date::$(date +'%Y%m%d_%H%M%S')"
# with:
# path: /home/runner/work/RetroDECK - name: Extract branch name
# key: ${{ runner.os }}-cooker-cache shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- name: Generating build ID
id: buildID
run: echo "${{ steps.extract_branch.outputs.branch }}-${{ steps.date.outputs.date }}"
Job2_-_Downloading_Sources: Job2_-_Downloading_Sources:
runs-on: ubuntu-latest runs-on: ubuntu-latest
#needs: [Job1_-_Prepearing_enviornment] needs: [Job1_-_Prepearing_enviornment]
steps: steps:
- name: cache-cooker - name: Retrieve previous cache
id: cache-cooker id: global-cache
uses: actions/cache@v2 uses: actions/cache@v2
with: with:
path: /home/runner/work/RetroDECK path: /home/runner/work/RetroDECK
key: ${{ runner.os }}-cooker-cache key: cooker-global-cache
- uses: actions/checkout@v3 - uses: actions/checkout@v3
@ -66,6 +63,13 @@ jobs:
sudo flatpak install -y org.kde.Sdk//5.15-21.08 org.kde.Platform//5.15-21.08 io.qt.qtwebengine.BaseApp/x86_64/5.15-21.08 org.freedesktop.Sdk.Extension.llvm13 sudo flatpak install -y org.kde.Sdk//5.15-21.08 org.kde.Platform//5.15-21.08 io.qt.qtwebengine.BaseApp/x86_64/5.15-21.08 org.freedesktop.Sdk.Extension.llvm13
sudo flatpak-builder --download-only --user --install --force-clean --repo=local retrodeck-flatpak net.retrodeck.retrodeck.yml sudo flatpak-builder --download-only --user --install --force-clean --repo=local retrodeck-flatpak net.retrodeck.retrodeck.yml
- name: Generating build specific cache
id: intenral-cache
uses: actions/cache@v2
with:
path: /home/runner/work/RetroDECK
key: jobs.Job1_-_Prepearing_enviornment.steps.buildID
# - name: Continuing with previous worklow cache # - name: Continuing with previous worklow cache
# if: steps.cache-cooker.outputs.cache-hit == 'true' # if: steps.cache-cooker.outputs.cache-hit == 'true'
# run: | # run: |
@ -87,11 +91,11 @@ jobs:
#- uses: actions/checkout@v3 #- uses: actions/checkout@v3
- name: cache-cooker - name: cache-cooker
id: cache-cooker id: internal-cache
uses: actions/cache@v2 uses: actions/cache@v2
with: with:
path: /home/runner/work/RetroDECK path: /home/runner/work/RetroDECK
key: ${{ runner.os }}-cooker-cache key: jobs.Job1_-_Prepearing_enviornment.steps.buildID
- name: Initializing enviornment - name: Initializing enviornment
#if: steps.cache-cooker.outputs.cache-hit != 'true' #if: steps.cache-cooker.outputs.cache-hit != 'true'
@ -117,11 +121,11 @@ jobs:
#- uses: actions/checkout@v3 #- uses: actions/checkout@v3
- name: cache-cooker - name: cache-cooker
id: cache-cooker id: internal-cache
uses: actions/cache@v2 uses: actions/cache@v2
with: with:
path: /home/runner/work/RetroDECK path: /home/runner/work/RetroDECK
key: ${{ runner.os }}-cooker-cache key: jobs.Job1_-_Prepearing_enviornment.steps.buildID
- name: Initializing enviornment - name: Initializing enviornment
#if: steps.cache-cooker.outputs.cache-hit != 'true' #if: steps.cache-cooker.outputs.cache-hit != 'true'
@ -147,11 +151,11 @@ jobs:
#- uses: actions/checkout@v3 #- uses: actions/checkout@v3
- name: cache-cooker - name: cache-cooker
id: cache-cooker id: internal-cache
uses: actions/cache@v2 uses: actions/cache@v2
with: with:
path: /home/runner/work/RetroDECK path: /home/runner/work/RetroDECK
key: ${{ runner.os }}-cooker-cache key: jobs.Job1_-_Prepearing_enviornment.steps.buildID
- name: Initializing enviornment - name: Initializing enviornment
#if: steps.cache-cooker.outputs.cache-hit != 'true' #if: steps.cache-cooker.outputs.cache-hit != 'true'
@ -177,11 +181,11 @@ jobs:
#- uses: actions/checkout@v3 #- uses: actions/checkout@v3
- name: cache-cooker - name: cache-cooker
id: cache-cooker id: internal-cache
uses: actions/cache@v2 uses: actions/cache@v2
with: with:
path: /home/runner/work/RetroDECK path: /home/runner/work/RetroDECK
key: ${{ runner.os }}-cooker-cache key: jobs.Job1_-_Prepearing_enviornment.steps.buildID
- name: Initializing enviornment - name: Initializing enviornment
#if: steps.cache-cooker.outputs.cache-hit != 'true' #if: steps.cache-cooker.outputs.cache-hit != 'true'
@ -206,11 +210,11 @@ jobs:
steps: steps:
- name: cache-cooker - name: cache-cooker
id: cache-cooker id: internal-cache
uses: actions/cache@v2 uses: actions/cache@v2
with: with:
path: /home/runner/work/RetroDECK path: /home/runner/work/RetroDECK
key: ${{ runner.os }}-cooker-cache key: jobs.Job1_-_Prepearing_enviornment.steps.buildID
- name: Get date for artifacts - name: Get date for artifacts
id: date id: date
@ -240,6 +244,13 @@ jobs:
token: ${{ secrets.TRIGGER_BUILD_TOKEN }} token: ${{ secrets.TRIGGER_BUILD_TOKEN }}
repo: RetroDECK-cooker repo: RetroDECK-cooker
- name: Regenerate global cache
id: global-cache
uses: actions/cache@v2
with:
path: /home/runner/work/RetroDECK
key: cooker-global-cache
# Job8_-_Uploading_cache: # Job8_-_Uploading_cache:
# runs-on: ubuntu-latest # runs-on: ubuntu-latest
# needs: [Job7_-_Publishing_flatpak] # needs: [Job7_-_Publishing_flatpak]