Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates to the build-mythtv-core workflow and add F40 #51

Merged
merged 2 commits into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ansible.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ jobs:
- desc: 'Fedora 39'
image: 'quay.io/fedora/fedora:39'
ansibleopts: '--limit localhost'
- desc: 'Fedora 40'
image: 'quay.io/fedora/fedora:40'
ansibleopts: '--limit localhost'
- desc: 'Fedora Rawhide'
image: 'quay.io/fedora/fedora:rawhide'
ansibleopts: '--limit localhost'
Expand Down
17 changes: 11 additions & 6 deletions .github/workflows/build-mythtv-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ name: Build MythTV core variants
#

on: # yamllint disable-line rule:truthy
workflow_run:
workflows: ["Run ansible-playbook"]
types:
- completed
push:

pull_request:

workflow_dispatch:

permissions:
contents: read
Expand All @@ -39,7 +40,7 @@ jobs:
MYTHTV_CONFIG_EXTRA:
CCACHE_DIR: $HOME/.ccache
CCACHE_COMPRESS: true
CCACHE_MAXSIZE: 1200M
CCACHE_MAXSIZE: 250M

strategy:
matrix:
Expand Down Expand Up @@ -77,6 +78,10 @@ jobs:
image: 'quay.io/fedora/fedora:39'
ansibleopts: '--limit localhost'
configureopts: ''
- desc: 'Fedora 40'
image: 'quay.io/fedora/fedora:40'
ansibleopts: '--limit localhost'
configureopts: ''

branch:
- desc: 'MythTV master'
Expand Down Expand Up @@ -158,7 +163,7 @@ jobs:

- name: Configure core
working-directory: mythtv/mythtv
run: ./configure --prefix=${{ env.MYTHTV_CONFIG_PREFIX }} ${{ env.MYTHTV_CONFIG_EXTRA }} ${{ matrix.container.configureopts }} ${{ matrix.branch.configureopts }}
run: ./configure --compile-type=release --enable-debug=0 --disable-debug --prefix=${{ env.MYTHTV_CONFIG_PREFIX }} ${{ env.MYTHTV_CONFIG_EXTRA }} ${{ matrix.container.configureopts }} ${{ matrix.branch.configureopts }}

- name: Make core
working-directory: mythtv/mythtv
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/cleanup-pr-caches.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---

#
# Cleanup caches after PR closed
#
# Caches are scoped, and after a PR
# is closed, any caches associated
# with that branch are no longer
# useful. Delete them.
#
# Code copied from: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#force-deleting-cache-entries
# modified based on: https://github.com/actions/gh-actions-cache/issues/85
#

name: Cleanup caches after PR closed

on: # yamllint disable-line rule:truthy
pull_request:
types:
- closed

jobs:
cleanup:
runs-on: ubuntu-latest
permissions:
actions: write
steps:
- name: Cleanup
run: |
gh extension install actions/gh-actions-cache

echo "Fetching list of cache key"
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH -L 100 | cut -f 1 )

## Setting this to not fail the workflow while deleting cache keys.
set +e
echo "Deleting caches..."
for cacheKey in $cacheKeysForPR
do
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm
done
echo "Done"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
BRANCH: refs/pull/${{ github.event.pull_request.number }}/merge