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..."