Skip to content

Commit

Permalink
CI: QEMU Add caching
Browse files Browse the repository at this point in the history
  • Loading branch information
AfoHT committed Jan 14, 2024
1 parent 6256670 commit bb305d7
Showing 1 changed file with 42 additions and 6 deletions.
48 changes: 42 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,29 +179,53 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Cache QEMU build
id: cache-qemu
uses: actions/cache@v3
with:
path: |
- ~/qemu-${{ env.QEMU_VERSION }}/build
- ~/qemu-${{ env.QEMU_VERSION }}/qemu.tar
- ~/usr/local/bin
key: ${{ runner.OS }}-qemu-${{ env.QEMU_VERSION }}
restore-keys: |
${{ runner.OS }}-qemu-${{ env.QEMU_VERSION }}
${{ runner.OS }}-qemu-
- name: Install QEMU to get dependencies
run: |
sudo apt update
sudo apt install -y qemu-system-arm
sudo apt-get install git libglib2.0-dev libfdt-dev libpixman-1-dev zlib1g-dev ninja-build
- name: Download QEMU
- if: ${{ steps.cache-qemu.outputs.cache-hit != 'true' }}
name: No cache hit
continue-on-error: true
run: |
ls -l ~/qemu-${{ env.QEMU_VERSION }}/build
- if: ${{ steps.cache-qemu.outputs.cache-hit != 'true' }}
name: Download QEMU
run: wget "${{ env.QEMU_URL }}"

- name: Extract QEMU
- if: ${{ steps.cache-qemu.outputs.cache-hit != 'true' }}
name: Extract QEMU
run: tar xvJf qemu-${{ env.QEMU_VERSION }}.tar.xz

- name: Configure QEMU
- if: ${{ steps.cache-qemu.outputs.cache-hit != 'true' }}
name: Configure QEMU
run: |
cd qemu-${{ env.QEMU_VERSION }}
./configure --target-list=arm-softmmu,riscv32-softmmu
- name: Build QEMU
- if: ${{ steps.cache-qemu.outputs.cache-hit != 'true' }}
name: Build QEMU
run: |
cd qemu-${{ env.QEMU_VERSION }}
make -j$(nproc)
- name: Archive QEMU build
- if: ${{ steps.cache-qemu.outputs.cache-hit != 'true' }}
name: Archive QEMU build
run: |
cd qemu-${{ env.QEMU_VERSION }}/build
tar -cf ../qemu.tar *
Expand Down Expand Up @@ -251,12 +275,24 @@ jobs:
- name: Cache Dependencies
uses: Swatinem/rust-cache@v2

- name: Cache QEMU build
id: cache-qemu
uses: actions/cache@v3
with:
path: |
- ~/qemu.tar
key: ${{ runner.OS }}-qemu-${{ env.QEMU_VERSION }}
restore-keys: |
${{ runner.OS }}-qemu-${{ env.QEMU_VERSION }}
${{ runner.OS }}-qemu-
- name: Install QEMU to get dependencies
run: |
sudo apt update
sudo apt install -y qemu-system-arm
- name: Download built QEMU
- if: ${{ steps.cache-qemu.outputs.cache-hit != 'true' }}
name: Download built QEMU
uses: actions/download-artifact@v4
with:
name: qemu
Expand Down

0 comments on commit bb305d7

Please sign in to comment.