summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authortaichan <40626578+tai-cha@users.noreply.github.com>2025-06-26 19:08:47 +0900
committerGitHub <noreply@github.com>2025-06-26 19:08:47 +0900
commit01a94eaecb9ecdbeabd156a2f34382f0c7f63e20 (patch)
treef367436fe7511fe2a6c21b02c7281a0c2b584f83 /.github
parentrefactor(frontend/pref): refactor preferences manager (diff)
downloadmisskey-01a94eaecb9ecdbeabd156a2f34382f0c7f63e20.tar.gz
misskey-01a94eaecb9ecdbeabd156a2f34382f0c7f63e20.tar.bz2
misskey-01a94eaecb9ecdbeabd156a2f34382f0c7f63e20.zip
chore(CI): cache ffmpeg (#16223)
* ci: use daily cache for ffmpeg * fix(ci): input type * Fix current date * Just use Daily cache * fix condition
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/test-backend.yml23
-rw-r--r--.github/workflows/test-federation.yml22
2 files changed, 45 insertions, 0 deletions
diff --git a/.github/workflows/test-backend.yml b/.github/workflows/test-backend.yml
index 9d611c9964..0c40f2c52a 100644
--- a/.github/workflows/test-backend.yml
+++ b/.github/workflows/test-backend.yml
@@ -18,6 +18,14 @@ on:
- packages/misskey-js/**
- .github/workflows/test-backend.yml
- .github/misskey/test.yml
+ workflow_dispatch:
+ inputs:
+ force_ffmpeg_cache_update:
+ description: 'Force update ffmpeg cache'
+ required: false
+ default: false
+ type: boolean
+
jobs:
unit:
name: Unit tests (backend)
@@ -47,7 +55,22 @@ jobs:
submodules: true
- name: Setup pnpm
uses: pnpm/action-setup@v4.1.0
+ - name: Get current date
+ id: current-date
+ run: echo "today=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
+ - name: Setup and Restore ffmpeg/ffprobe Cache
+ id: cache-ffmpeg
+ uses: actions/cache@v4
+ with:
+ path: |
+ /usr/local/bin/ffmpeg
+ /usr/local/bin/ffprobe
+ # daily cache
+ key: ${{ runner.os }}-ffmpeg-${{ steps.current-date.outputs.today }}
+ restore-keys: |
+ ${{ runner.os }}-ffmpeg-${{ steps.current-date.outputs.today }}
- name: Install FFmpeg
+ if: steps.cache-ffmpeg.outputs.cache-hit != 'true' || github.event.inputs.force_ffmpeg_cache_update == true
run: |
for i in {1..3}; do
echo "Attempt $i: Installing FFmpeg..."
diff --git a/.github/workflows/test-federation.yml b/.github/workflows/test-federation.yml
index 737b543a73..873396f622 100644
--- a/.github/workflows/test-federation.yml
+++ b/.github/workflows/test-federation.yml
@@ -14,6 +14,13 @@ on:
- packages/backend/**
- packages/misskey-js/**
- .github/workflows/test-federation.yml
+ workflow_dispatch:
+ inputs:
+ force_ffmpeg_cache_update:
+ description: 'Force update ffmpeg cache'
+ required: false
+ default: false
+ type: boolean
jobs:
test:
@@ -30,7 +37,22 @@ jobs:
submodules: true
- name: Setup pnpm
uses: pnpm/action-setup@v4.1.0
+ - name: Get current date
+ id: current-date
+ run: echo "today=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
+ - name: Setup and Restore ffmpeg/ffprobe Cache
+ id: cache-ffmpeg
+ uses: actions/cache@v4
+ with:
+ path: |
+ /usr/local/bin/ffmpeg
+ /usr/local/bin/ffprobe
+ # daily cache
+ key: ${{ runner.os }}-ffmpeg-${{ steps.current-date.outputs.today }}
+ restore-keys: |
+ ${{ runner.os }}-ffmpeg-${{ steps.current-date.outputs.today }}
- name: Install FFmpeg
+ if: steps.cache-ffmpeg.outputs.cache-hit != 'true' || github.event.inputs.force_ffmpeg_cache_update == true
run: |
for i in {1..3}; do
echo "Attempt $i: Installing FFmpeg..."