Skip to content

Commit

Permalink
update toolchain build
Browse files Browse the repository at this point in the history
  • Loading branch information
dyphire committed May 3, 2024
1 parent 7394e0b commit c60f252
Showing 1 changed file with 50 additions and 14 deletions.
64 changes: 50 additions & 14 deletions .github/workflows/toolchain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ jobs:
run: |
sudo echo -e "[multilib]\nInclude = /etc/pacman.d/mirrorlist" >> /etc/pacman.conf
sudo pacman -Syu --noconfirm
sudo pacman -S --noconfirm --needed git ninja cmake meson libc++ wget mimalloc
sudo pacman -S --noconfirm --needed git ninja cmake meson wget mimalloc
mkdir -p /home/opt/7zip
wget -qO - https://www.7-zip.org/a/7z2301-linux-x64.tar.xz | tar -xJf - -C /home/opt/7zip 7zzs
sudo ln -s /home/opt/7zip/7zzs /usr/bin/7z
Expand All @@ -108,6 +108,7 @@ jobs:
git config --global rebase.autoStash true
git config --global fetch.prune true
- uses: actions/checkout@v4

- name: Checkout toolchain
uses: actions/checkout@v4
with:
Expand All @@ -117,7 +118,7 @@ jobs:

- name: Restore llvm cache
if: ${{ inputs.compiler =='clang' }}
uses: actions/cache/restore@v4.0.0
uses: actions/cache/restore@v4.0.2
with:
fail-on-cache-miss: true
path: |
Expand All @@ -132,36 +133,30 @@ jobs:
with:
bit: "${{ matrix.bit }}"
compiler: "gcc"
command: "ninja -C $buildroot/build$bit gcc && ninja -C $buildroot/build$bit rustup && ninja -C $buildroot/build$bit cargo-clean"
command: "ninja -C $buildroot/build$bit gcc"

- name: Build Clang Toolchain
uses: ./action/build_toolchain
if: ${{ inputs.compiler =='clang' }}
with:
bit: "${{ matrix.bit }}"
compiler: "clang"
command: "ninja -C $buildroot/build$bit rebuild_cache && cmake --build $buildroot/build$bit --target llvm-download && ninja -C $buildroot/build$bit llvm-clang && ninja -C $buildroot/build$bit rustup && ninja -C $buildroot/build$bit cargo-clean"
command: "ninja -C $buildroot/build$bit rebuild_cache && cmake --build $buildroot/build$bit --target llvm-download && ninja -C $buildroot/build$bit llvm-clang"

- name: Save Toolchain Cache
if: ${{ inputs.no_save_cache != true }}
uses: actions/cache/save@v4.0.0
uses: actions/cache/save@v4.0.2
with:
path: ${{ github.workspace }}/mpv-winbuild-cmake/build${{ matrix.bit }}
key: toolchain-${{ inputs.compiler }}-build${{ matrix.bit }}-${{ needs.params.outputs.cache_suffix }}

- name: Save clang_root cache
if: ${{ inputs.compiler =='clang' && inputs.no_save_cache != true }}
uses: actions/cache/save@v4.0.0
uses: actions/cache/save@v4.0.2
with:
path: ${{ github.workspace }}/mpv-winbuild-cmake/clang_root
key: ${{ matrix.bit }}-clang_root-${{ needs.params.outputs.cache_suffix }}
- name: Save Rust Cache
if: ${{ inputs.no_save_cache != true }}
uses: actions/cache/save@v4.0.0
with:
path: ${{ github.workspace }}/mpv-winbuild-cmake/install_rustup
key: rust-${{ needs.params.outputs.cache_suffix }}


- name: Collect logs
if: ${{ always() }}
run: |
Expand All @@ -173,11 +168,52 @@ jobs:
name: ${{ matrix.bit }}_logs
path: logs.7z

rust:
name: Install Rust Toolchain
needs: [params]
runs-on: ubuntu-latest
container:
image: archlinux/archlinux:base-devel
continue-on-error: true

steps:
- name: Install Dependencies
run: |
sudo pacman -Syu --noconfirm
sudo pacman -S --noconfirm --needed git ninja cmake meson wget
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global pull.rebase true
git config --global rebase.autoStash true
git config --global fetch.prune true
- uses: actions/checkout@v4

- name: Checkout toolchain
uses: actions/checkout@v4
with:
repository: shinchiro/mpv-winbuild-cmake
path: mpv-winbuild-cmake
fetch-depth: 0

- name: Install Rust Toolchain
uses: ./action/build_toolchain
with:
bit: "64-v3"
command: "ninja -C $buildroot/build$bit rustup && ninja -C $buildroot/build$bit cargo-clean"

- name: Save Rust Cache
if: ${{ inputs.no_save_cache != true }}
uses: actions/cache/save@v4.0.2
with:
path: ${{ github.workspace }}/mpv-winbuild-cmake/install_rustup
key: rust-${{ needs.params.outputs.cache_suffix }}

trigger:
needs: [build,params]
needs: [build,params,rust]
if: ${{ always() && inputs.trigger_build != false && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') }}
runs-on: ubuntu-latest
permissions:
actions: write

steps:
- name: Trigger mpv build workflow
Expand Down

0 comments on commit c60f252

Please # to comment.