Skip to content

Commit

Permalink
Setup conda cache and ccache (#82)
Browse files Browse the repository at this point in the history
The goal of the PR is to improve build times.
Currently the build steps take around > ~15 mins and most of the time is
spent building sparta and the other dependencies.
This should bring it down to roughly ~6 mins.

CCache is used to cache build files, the cache for each branch is unique
to prevent cache invalidation issues between different branches.

Conda dependencies are also cached although the time to build is not
affected as much roughly ~1 mins but would be higher if the network is
slow.Conda spends a lot of time checking the dependencies.

Cached action run
https://github.com/h0lyalg0rithm/riscv-perf-model/actions/runs/5987171626
  • Loading branch information
h0lyalg0rithm authored Aug 30, 2023
1 parent 7c0b051 commit d0c9002
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/ubuntu-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,26 @@ jobs:
with:
python-version: 3.8

# Cache the conda dependencies to
- name: Cache conda deps
uses: actions/cache@v3
with:
key: ${{ matrix.os }}-${{ matrix.BUILD_TYPE }}-conda-${{ hashFiles('conda/environment.yml') }}
path: /usr/share/miniconda/envs/riscv_perf_model # Default path for conda

# Setup CCache to cache builds
- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ matrix.os }}-${{ matrix.BUILD_TYPE }}-ccache-${{ github.ref_name }}
restore-keys: |
${{ matrix.os }}-${{ matrix.BUILD_TYPE }}-ccache-master
${{ matrix.os }}-${{ matrix.BUILD_TYPE }}-ccache
- name: Setup Conda Environment
run: |
# $CONDA is an environment variable pointing to the root of the miniconda directory
$CONDA/bin/conda config --set channel_priority strict
$CONDA/bin/conda env update --file ${{ github.workspace }}/conda/environment.yml
$CONDA/bin/conda init bash
Expand Down

0 comments on commit d0c9002

Please sign in to comment.