Skip to content

Commit

Permalink
Merge pull request #19 from Jupeyy/pr_speedup_win_ci
Browse files Browse the repository at this point in the history
Try to speedup Windows CI with caching
  • Loading branch information
Jupeyy authored Jan 6, 2025
2 parents 59ccc4b + de2478c commit c71fda5
Showing 1 changed file with 25 additions and 6 deletions.
31 changes: 25 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ jobs:
run: |
export PATH="/c/users/$(whoami)/.cargo/bin:$PATH"
echo -e "export PATH=\"/c/users/$(whoami)/.cargo/bin:\$PATH\"\n" >> ~/.bash_profile
echo -e "export MINGW_ARCH=mingw64\n" >> ~/.bash_profile
- uses: actions/checkout@v4
with:
Expand All @@ -73,22 +74,38 @@ jobs:
# for ffmpeg
brew install ffmpeg || true
- name: Prepare msys
- name: Prepare msys dependencies
if: contains(matrix.os, 'windows')
run: |
set MINGW_ARCH=mingw64
# important detail: mingw-w64-x86_64-libx264 is installed for the package config files!
pacman --noconfirm -S git make mingw-w64-x86_64-libx264 mingw-w64-x86_64-toolchain mingw-w64-x86_64-clang mingw-w64-x86_64-gcc mingw-w64-x86_64-nasm mingw-w64-x86_64-opus
# self compile for now
# https://github.com/msys2/MINGW-packages/issues/8824
git clone https://github.com/mirror/x264 ~/x264
git clone --depth=1 https://github.com/mirror/x264 ~/x264
- name: Setup cache for x264 (Windows)
if: contains(matrix.os, 'windows')
uses: actions/cache@v4
id: x264-cache-compiled
with:
path: ~/build-x264
key: ${{ runner.os }}-build-${{ hashFiles('~/x264') }}

- name: Compile x264 (Windows)
if: contains(matrix.os, 'windows') && steps.x264-cache-compiled.outputs.cache-hit != 'true'
run: |
(
cd ~/x264
./configure --enable-static
mkdir ~/build-x264
cd ~/build-x264
../x264/configure --enable-static
make -j$(nproc)
)
- name: Prepare msys
if: contains(matrix.os, 'windows')
run: |
rm /mingw64/lib/libx264.dll.a
mv ~/x264/libx264.a /mingw64/lib/libx264.a
mv ~/build-x264/libx264.a /mingw64/lib/libx264.a
rustup target add x86_64-pc-windows-gnu
rustup update stable
rustup set default-host x86_64-pc-windows-gnu
Expand All @@ -97,6 +114,8 @@ jobs:
- uses: Swatinem/rust-cache@v2

- name: Build debug
# disable windows for now, since it's the slowest build
if: contains(matrix.os, 'windows') == false
run: cargo build --verbose --features ${{ matrix.features-debug }}

- name: Build release
Expand Down

0 comments on commit c71fda5

Please sign in to comment.