workflows: Disable cache for inspircd + add version flavor to the cache key for others

This commit is contained in:
2021-07-06 21:34:56 +02:00
parent bfa183e37e
commit 7c32d47713
5 changed files with 30 additions and 40 deletions

View File

@ -37,7 +37,7 @@ jobs:
- name: Cache dependencies - name: Cache dependencies
uses: actions/cache@v2 uses: actions/cache@v2
with: with:
key: ${{ runner.os }}-ergo key: ${{ runner.os }}-ergo-devel
path: |- path: |-
~/.cache ~/.cache
$GITHUB_WORKSPACE/ergo $GITHUB_WORKSPACE/ergo
@ -73,13 +73,6 @@ jobs:
uses: actions/setup-python@v2 uses: actions/setup-python@v2
with: with:
python-version: 3.7 python-version: 3.7
- name: Cache dependencies
uses: actions/cache@v2
with:
key: ${{ runner.os }}-inspircd
path: |-
~/.cache
$GITHUB_WORKSPACE/inspircd
- name: Install dependencies - name: Install dependencies
run: |- run: |-
sudo apt-get install atheme-services sudo apt-get install atheme-services
@ -118,7 +111,7 @@ jobs:
- name: Cache dependencies - name: Cache dependencies
uses: actions/cache@v2 uses: actions/cache@v2
with: with:
key: ${{ runner.os }}-limnoria key: ${{ runner.os }}-limnoria-devel
path: |- path: |-
~/.cache ~/.cache
$GITHUB_WORKSPACE/placeholder $GITHUB_WORKSPACE/placeholder
@ -148,7 +141,7 @@ jobs:
- name: Cache dependencies - name: Cache dependencies
uses: actions/cache@v2 uses: actions/cache@v2
with: with:
key: ${{ runner.os }}-solanum key: ${{ runner.os }}-solanum-devel
path: |- path: |-
~/.cache ~/.cache
$GITHUB_WORKSPACE/solanum $GITHUB_WORKSPACE/solanum
@ -189,7 +182,7 @@ jobs:
- name: Cache dependencies - name: Cache dependencies
uses: actions/cache@v2 uses: actions/cache@v2
with: with:
key: ${{ runner.os }}-sopel key: ${{ runner.os }}-sopel-devel
path: |- path: |-
~/.cache ~/.cache
$GITHUB_WORKSPACE/placeholder $GITHUB_WORKSPACE/placeholder
@ -219,7 +212,7 @@ jobs:
- name: Cache dependencies - name: Cache dependencies
uses: actions/cache@v2 uses: actions/cache@v2
with: with:
key: ${{ runner.os }}-unrealircd key: ${{ runner.os }}-unrealircd-devel
path: |- path: |-
~/.cache ~/.cache
$GITHUB_WORKSPACE/unrealircd $GITHUB_WORKSPACE/unrealircd

View File

@ -25,13 +25,6 @@ jobs:
uses: actions/setup-python@v2 uses: actions/setup-python@v2
with: with:
python-version: 3.7 python-version: 3.7
- name: Cache dependencies
uses: actions/cache@v2
with:
key: ${{ runner.os }}-inspircd
path: |-
~/.cache
$GITHUB_WORKSPACE/inspircd
- name: Install dependencies - name: Install dependencies
run: |- run: |-
sudo apt-get install atheme-services sudo apt-get install atheme-services

View File

@ -34,7 +34,7 @@ jobs:
- name: Cache dependencies - name: Cache dependencies
uses: actions/cache@v2 uses: actions/cache@v2
with: with:
key: ${{ runner.os }}-charybdis key: ${{ runner.os }}-charybdis-stable
path: |- path: |-
~/.cache ~/.cache
$GITHUB_WORKSPACE/charybdis $GITHUB_WORKSPACE/charybdis
@ -79,7 +79,7 @@ jobs:
- name: Cache dependencies - name: Cache dependencies
uses: actions/cache@v2 uses: actions/cache@v2
with: with:
key: ${{ runner.os }}-ergo key: ${{ runner.os }}-ergo-stable
path: |- path: |-
~/.cache ~/.cache
$GITHUB_WORKSPACE/ergo $GITHUB_WORKSPACE/ergo
@ -115,13 +115,6 @@ jobs:
uses: actions/setup-python@v2 uses: actions/setup-python@v2
with: with:
python-version: 3.7 python-version: 3.7
- name: Cache dependencies
uses: actions/cache@v2
with:
key: ${{ runner.os }}-inspircd
path: |-
~/.cache
$GITHUB_WORKSPACE/inspircd
- name: Install dependencies - name: Install dependencies
run: |- run: |-
sudo apt-get install atheme-services sudo apt-get install atheme-services
@ -160,7 +153,7 @@ jobs:
- name: Cache dependencies - name: Cache dependencies
uses: actions/cache@v2 uses: actions/cache@v2
with: with:
key: ${{ runner.os }}-limnoria key: ${{ runner.os }}-limnoria-stable
path: |- path: |-
~/.cache ~/.cache
$GITHUB_WORKSPACE/placeholder $GITHUB_WORKSPACE/placeholder
@ -190,7 +183,7 @@ jobs:
- name: Cache dependencies - name: Cache dependencies
uses: actions/cache@v2 uses: actions/cache@v2
with: with:
key: ${{ runner.os }}-solanum key: ${{ runner.os }}-solanum-stable
path: |- path: |-
~/.cache ~/.cache
$GITHUB_WORKSPACE/solanum $GITHUB_WORKSPACE/solanum
@ -231,7 +224,7 @@ jobs:
- name: Cache dependencies - name: Cache dependencies
uses: actions/cache@v2 uses: actions/cache@v2
with: with:
key: ${{ runner.os }}-sopel key: ${{ runner.os }}-sopel-stable
path: |- path: |-
~/.cache ~/.cache
$GITHUB_WORKSPACE/placeholder $GITHUB_WORKSPACE/placeholder
@ -261,7 +254,7 @@ jobs:
- name: Cache dependencies - name: Cache dependencies
uses: actions/cache@v2 uses: actions/cache@v2
with: with:
key: ${{ runner.os }}-unrealircd key: ${{ runner.os }}-unrealircd-stable
path: |- path: |-
~/.cache ~/.cache
$GITHUB_WORKSPACE/unrealircd $GITHUB_WORKSPACE/unrealircd

View File

@ -84,6 +84,23 @@ def get_build_job(*, software_config, software_id, version_flavor):
if env: if env:
env += " " env += " "
if software_config.get("cache", True):
cache = [
{
"name": "Cache dependencies",
"uses": "actions/cache@v2",
"with": {
"path": script("~/.cache", f"$GITHUB_WORKSPACE/{path}"),
"key": "${{ runner.os }}-"
+ software_id
+ "-"
+ version_flavor.value,
},
}
]
else:
cache = []
return { return {
"runs-on": "ubuntu-latest", "runs-on": "ubuntu-latest",
"steps": [ "steps": [
@ -94,14 +111,7 @@ def get_build_job(*, software_config, software_id, version_flavor):
"with": {"python-version": 3.7}, "with": {"python-version": 3.7},
}, },
*software_config.get("pre_deps", []), *software_config.get("pre_deps", []),
{ *cache,
"name": "Cache dependencies",
"uses": "actions/cache@v2",
"with": {
"path": script("~/.cache", f"$GITHUB_WORKSPACE/{path}"),
"key": "${{ runner.os }}-" + software_id,
},
},
{ {
"name": "Install dependencies", "name": "Install dependencies",
"run": script( "run": script(

View File

@ -75,6 +75,7 @@ software:
devel: "PYTEST_ARGS=\"$PYTEST_ARGS -m 'not services'\"" devel: "PYTEST_ARGS=\"$PYTEST_ARGS -m 'not services'\""
path: inspircd path: inspircd
prefix: ~/.local/inspircd prefix: ~/.local/inspircd
cache: false # incremental compilation is frequently broken
build_script: | build_script: |
cd $GITHUB_WORKSPACE/inspircd/ cd $GITHUB_WORKSPACE/inspircd/
patch src/inspircd.cpp < $GITHUB_WORKSPACE/inspircd_mainloop.patch patch src/inspircd.cpp < $GITHUB_WORKSPACE/inspircd_mainloop.patch