Skip to content
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
56 changes: 56 additions & 0 deletions .github/workflows/clean-up-cache-cron.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Cleanup Caches by Cron

on:
schedule:
- cron: '0 3 * * *' # Runs daily at 03:00 UTC
workflow_dispatch: # Allows manual triggering if needed

permissions:
contents: write


jobs:
cleanup:
runs-on: ubuntu-latest
steps:
- name: Set Up GitHub CLI
run: |
sudo apt-get update && sudo apt-get install -y gh
gh extension install actions/gh-actions-cache || echo "Extension already installed"

- name: Cleanup Caches
env:
GH_TOKEN: ${{ secrets.PAT_TOKEN || secrets.GITHUB_TOKEN }}
run: |
REPO=${{ github.repository }}
BRANCH="master" # Only focus on the master branch

echo "Fetching list of cache keys for branch: $BRANCH"
cacheKeysForMaster=$(gh actions-cache list -R $REPO -B $BRANCH --json key | jq -r '.[].key')

if [ -z "$cacheKeysForMaster" ]; then
echo "No caches found for branch: $BRANCH"
exit 0
fi

echo "Deleting caches..."
for cacheKey in $cacheKeysForMaster; do
echo "Deleting cache: $cacheKey"
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm
done
echo "Cleanup completed."

- name: Verify Remaining Caches
run: |
echo "Checking for remaining caches in branch: $BRANCH"
remainingCaches=$(gh actions-cache list -R ${{ github.repository }} -B $BRANCH --json key | jq -r '.[].key')

if [ -z "$remainingCaches" ]; then
echo "All caches successfully cleared."
else
echo "Remaining caches detected:"
echo "$remainingCaches"
exit 1
fi
env:
GH_TOKEN: ${{ secrets.PAT_TOKEN || secrets.GITHUB_TOKEN }}
56 changes: 44 additions & 12 deletions .github/workflows/clean-up-cache.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: cleanup caches by a branch
name: Cleanup Caches by Branch
on:
pull_request:
types:
Expand All @@ -14,20 +14,52 @@ jobs:
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Cleanup
- name: Setup GitHub CLI
run: |
# Ensure the latest version of GitHub CLI is installed
sudo apt-get update && sudo apt-get install -y gh
# Install the actions-cache extension
gh extension install actions/gh-actions-cache || echo "Extension already installed"

- name: Check Token Permissions
run: gh auth status
env:
GH_TOKEN: ${{ secrets.PAT_TOKEN || secrets.GITHUB_TOKEN }}

- name: Cleanup Caches
run: |
gh extension install actions/gh-actions-cache
REPO=${{ github.repository }}
# Adjust branch reference if necessary
BRANCH="refs/pull/${{ github.event.pull_request.number }}/merge"
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 "Fetching list of cache keys for branch: $BRANCH"
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH --json key | jq -r '.[].key')

if [ -z "$cacheKeysForPR" ]; then
echo "No caches found for branch: $BRANCH"
exit 0
fi

echo "Deleting caches..."
for cacheKey in $cacheKeysForPR
do
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm
for cacheKey in $cacheKeysForPR; do
echo "Deleting cache: $cacheKey"
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm
done
echo "Done"
echo "Cleanup completed."
env:
GH_TOKEN: ${{ secrets.PAT_TOKEN || secrets.GITHUB_TOKEN }}

- name: Verify Remaining Caches
run: |
echo "Checking for remaining caches in branch: $BRANCH"
remainingCaches=$(gh actions-cache list -R ${{ github.repository }} -B $BRANCH --json key | jq -r '.[].key')

if [ -z "$remainingCaches" ]; then
echo "All caches successfully cleared."
else
echo "Remaining caches detected:"
echo "$remainingCaches"
exit 1
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.PAT_TOKEN || secrets.GITHUB_TOKEN }}
130 changes: 65 additions & 65 deletions .github/workflows/of.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,19 @@ jobs:
- uses: actions/checkout@v4
- name: Docker Step
run: "docker run -di --name emscripten -v $PWD:/src emscripten/emsdk:3.1.74 bash"
- name: Determine Release
id: vars
shell: bash
run: |
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
echo "RELEASE=${{ github.ref_name }}" >> $GITHUB_ENV
elif [[ "${{ github.ref }}" == "refs/heads/master" ]]; then
echo "RELEASE=nightly" >> $GITHUB_ENV
elif [[ "${{ github.ref }}" == "refs/heads/bleeding" ]]; then
echo "RELEASE=latest" >> $GITHUB_ENV
else
echo "RELEASE=latest" >> $GITHUB_ENV
fi
# - name: Determine Release
# id: vars
# shell: bash
# run: |
# if [[ "${{ github.ref }}" == refs/tags/* ]]; then
# echo "RELEASE=${{ github.ref_name }}" >> $GITHUB_ENV
# elif [[ "${{ github.ref }}" == "refs/heads/master" ]]; then
# echo "RELEASE=nightly" >> $GITHUB_ENV
# elif [[ "${{ github.ref }}" == "refs/heads/bleeding" ]]; then
# echo "RELEASE=latest" >> $GITHUB_ENV
# else
# echo "RELEASE=latest" >> $GITHUB_ENV
# fi
- name: Download libs
run: ./scripts/$TARGET/download_libs.sh -t $RELEASE
- name: Install dependencies
Expand Down Expand Up @@ -131,19 +131,19 @@ jobs:
install: >-
git
unzip
- name: Determine Release
id: vars
shell: bash
run: |
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
echo "RELEASE=${{ github.ref_name }}" >> $GITHUB_ENV
elif [[ "${{ github.ref }}" == "refs/heads/master" ]]; then
echo "RELEASE=nightly" >> $GITHUB_ENV
elif [[ "${{ github.ref }}" == "refs/heads/bleeding" ]]; then
echo "RELEASE=latest" >> $GITHUB_ENV
else
echo "RELEASE=latest" >> $GITHUB_ENV
fi
# - name: Determine Release
# id: vars
# shell: bash
# run: |
# if [[ "${{ github.ref }}" == refs/tags/* ]]; then
# echo "RELEASE=${{ github.ref_name }}" >> $GITHUB_ENV
# elif [[ "${{ github.ref }}" == "refs/heads/master" ]]; then
# echo "RELEASE=nightly" >> $GITHUB_ENV
# elif [[ "${{ github.ref }}" == "refs/heads/bleeding" ]]; then
# echo "RELEASE=latest" >> $GITHUB_ENV
# else
# echo "RELEASE=latest" >> $GITHUB_ENV
# fi
- name: Install dependencies
shell: msys2 {0}
run: ./scripts/ci/vs/install.sh
Expand Down Expand Up @@ -257,19 +257,19 @@ jobs:
uses: hendrikmuhs/[email protected]
with:
key: ${{ matrix.cfg.libs }}
- name: Determine Release
id: vars
shell: bash
run: |
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
echo "RELEASE=${{ github.ref_name }}" >> $GITHUB_ENV
elif [[ "${{ github.ref }}" == "refs/heads/master" ]]; then
echo "RELEASE=nightly" >> $GITHUB_ENV
elif [[ "${{ github.ref }}" == "refs/heads/bleeding" ]]; then
echo "RELEASE=latest" >> $GITHUB_ENV
else
echo "RELEASE=latest" >> $GITHUB_ENV
fi
# - name: Determine Release
# id: vars
# shell: bash
# run: |
# if [[ "${{ github.ref }}" == refs/tags/* ]]; then
# echo "RELEASE=${{ github.ref_name }}" >> $GITHUB_ENV
# elif [[ "${{ github.ref }}" == "refs/heads/master" ]]; then
# echo "RELEASE=nightly" >> $GITHUB_ENV
# elif [[ "${{ github.ref }}" == "refs/heads/bleeding" ]]; then
# echo "RELEASE=latest" >> $GITHUB_ENV
# else
# echo "RELEASE=latest" >> $GITHUB_ENV
# fi
- name: Download libs
run: ./scripts/linux/download_libs.sh -t $RELEASE -a ${{matrix.cfg.libs}}
- name: Install dependencies
Expand Down Expand Up @@ -297,19 +297,19 @@ jobs:
uses: hendrikmuhs/[email protected]
with:
key: ${{ matrix.cfg.target }}-${{ matrix.cfg.libs }}
- name: Determine Release
id: vars
shell: bash
run: |
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
echo "RELEASE=${{ github.ref_name }}" >> $GITHUB_ENV
elif [[ "${{ github.ref }}" == "refs/heads/master" ]]; then
echo "RELEASE=nightly" >> $GITHUB_ENV
elif [[ "${{ github.ref }}" == "refs/heads/bleeding" ]]; then
echo "RELEASE=latest" >> $GITHUB_ENV
else
echo "RELEASE=latest" >> $GITHUB_ENV
fi
# - name: Determine Release
# id: vars
# shell: bash
# run: |
# if [[ "${{ github.ref }}" == refs/tags/* ]]; then
# echo "RELEASE=${{ github.ref_name }}" >> $GITHUB_ENV
# elif [[ "${{ github.ref }}" == "refs/heads/master" ]]; then
# echo "RELEASE=nightly" >> $GITHUB_ENV
# elif [[ "${{ github.ref }}" == "refs/heads/bleeding" ]]; then
# echo "RELEASE=latest" >> $GITHUB_ENV
# else
# echo "RELEASE=latest" >> $GITHUB_ENV
# fi
- name: Download libs
run: ./scripts/${{matrix.cfg.libs}}/download_libs.sh -t $RELEASE
- name: install
Expand Down Expand Up @@ -340,19 +340,19 @@ jobs:
with:
packages: aptitude aptitude-common libboost-iostreams1.83.0 libcwidget4 libsigc++-2.0-0v5 libxapian30 fonts-wine{a} libasound2-plugins{a} libcapi20-3t64{a} libosmesa6{a} libpcsclite1{a} libspeexdsp1{a} libwine{a} libxkbregistry0{a} libz-mingw-w64{a} wine{a} wine64 wget2 make libjack-jackd2-0 libjack-jackd2-dev freeglut3-dev libasound2-dev libxmu-dev libxxf86vm-dev g++ libgl1-mesa-dev libglu1-mesa-dev libraw1394-dev libudev-dev libdrm-dev libglew-dev libopenal-dev libsndfile1-dev libfreeimage-dev libcairo2-dev libfreetype6-dev libpulse-dev libusb-1.0-0-dev libgtk2.0-dev libopencv-dev libassimp-dev librtaudio-dev gdb libglfw3-dev liburiparser-dev libpugixml-dev libgconf-2-4 libgtk2.0-0 libpoco-dev libxcursor-dev libxi-dev libxinerama-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-libav gstreamer1.0-pulseaudio gstreamer1.0-x gstreamer1.0-plugins-bad gstreamer1.0-alsa gstreamer1.0-plugins-base gstreamer1.0-plugins-good
version: 1.0
- name: Determine Release
id: vars
shell: bash
run: |
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
echo "RELEASE=${{ github.ref_name }}" >> $GITHUB_ENV
elif [[ "${{ github.ref }}" == "refs/heads/master" ]]; then
echo "RELEASE=nightly" >> $GITHUB_ENV
elif [[ "${{ github.ref }}" == "refs/heads/bleeding" ]]; then
echo "RELEASE=latest" >> $GITHUB_ENV
else
echo "RELEASE=latest" >> $GITHUB_ENV
fi
# - name: Determine Release
# id: vars
# shell: bash
# run: |
# if [[ "${{ github.ref }}" == refs/tags/* ]]; then
# echo "RELEASE=${{ github.ref_name }}" >> $GITHUB_ENV
# elif [[ "${{ github.ref }}" == "refs/heads/master" ]]; then
# echo "RELEASE=nightly" >> $GITHUB_ENV
# elif [[ "${{ github.ref }}" == "refs/heads/bleeding" ]]; then
# echo "RELEASE=latest" >> $GITHUB_ENV
# else
# echo "RELEASE=latest" >> $GITHUB_ENV
# fi
- uses: actions/checkout@v4
- name: ccache
uses: hendrikmuhs/[email protected]
Expand Down
Loading