Skip to content

Commit

Permalink
Cache LLVM mingw-w64
Browse files Browse the repository at this point in the history
  • Loading branch information
mati865 committed Aug 5, 2022
1 parent 6217679 commit 4f214d8
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions .github/workflows/cross-compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:

env:
RUSTFLAGS: -Dwarnings
LLVM-MINGW-TOOLCHAIN-NAME: llvm-mingw-20220323-ucrt-ubuntu-18.04-x86_64

jobs:
test:
Expand Down Expand Up @@ -52,13 +53,25 @@ jobs:
run: brew install mingw-w64
if: startsWith(matrix.image, 'macos-') && matrix.target == 'x86_64-pc-windows-gnu'

- name: LLVM MinGW toolchain cache configuration
id: cache-llvm-mingw-toolchain
uses: actions/cache@v3
if: startsWith(matrix.image, 'ubuntu-') && contains(matrix.target, 'gnullvm') && matrix.version == 'nightly'
with:
path: ${{ env.LLVM-MINGW-TOOLCHAIN-NAME }}
key: ${{ env.LLVM-MINGW-TOOLCHAIN-NAME }}

- name: Install LLVM MinGW toolchain
if: startsWith(matrix.image, 'ubuntu-') && contains(matrix.target, 'gnullvm') && matrix.version == 'nightly' && steps.cache-llvm-mingw-toolchain.outputs.cache-hit != 'true'
run: |
name='llvm-mingw-20220323-ucrt-ubuntu-18.04-x86_64'
curl -L -o $name.tar.xz https://github.com/mstorsjo/llvm-mingw/releases/download/20220323/$name.tar.xz
tar -xf $name.tar.xz
echo "$name/bin" >> $GITHUB_PATH
curl -L -o ${{ env.LLVM-MINGW-TOOLCHAIN-NAME }}.tar.xz https://github.com/mstorsjo/llvm-mingw/releases/download/20220323/${{ env.LLVM-MINGW-TOOLCHAIN-NAME }}.tar.xz
tar -xf ${{ env.LLVM-MINGW-TOOLCHAIN-NAME }}.tar.xz
echo "${{ env.LLVM-MINGW-TOOLCHAIN-NAME }}/bin" >> $GITHUB_PATH
- name: Add LLVM MinGW toolchain to PATH
if: startsWith(matrix.image, 'ubuntu-') && contains(matrix.target, 'gnullvm') && matrix.version == 'nightly'
run: |
echo "${{ env.LLVM-MINGW-TOOLCHAIN-NAME }}/bin" >> $GITHUB_PATH
- name: Test
shell: pwsh
Expand Down

0 comments on commit 4f214d8

Please sign in to comment.