From e95b072f5684857ffd3d3c95c3369f83cdba0dee Mon Sep 17 00:00:00 2001 From: Grazfather Date: Fri, 2 Jul 2021 20:43:25 -0400 Subject: [PATCH] Fix caching in CI tests Cache was being used, but we were only caching the .wheel files. We still need to `pip install` in order to use the cache. --- .github/workflows/run-tests.yml | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 752a47937..a78e105dd 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -24,7 +24,7 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Refresh environment + - name: Install python and toolchain run: | sudo apt-get update sudo apt-get install -y gdb-multiarch python3-dev python3-pip python3-wheel python3-setuptools git cmake gcc g++ pkg-config libglib2.0-dev @@ -33,29 +33,27 @@ jobs: - name: Get pip cache dir id: pip-cache run: | - echo "::set-output name=dir::$(pip cache dir)" + echo "::set-output name=dir::$(python3 -m pip cache dir)" - - name: Cache trinity libs + - name: Cache dependencies uses: actions/cache@v2 - id: cache-libs + id: cache-deps env: - cache-name: cache-trinity-libs-and-python-modules + cache-name: cache-deps with: key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} path: | ${{ steps.pip-cache.outputs.dir }} - ~/.cache/pip restore-keys: ${{ runner.os }}-pip-${{ env.cache-name }}- ${{ runner.os }}-pip- ${{ runner.os }}-${{ env.cache-name }}- ${{ runner.os }}- - - name: Compile Capstone/Keystone/Unicorn and install Python modules - if: steps.cache-libs.outputs.cache-hit != 'true' + - name: Install Python modules (Capstone, Keystone, Unicorn, Ropper) run: | - mkdir -p ~/.cache/pip || echo ok - python3 -c 'import capstone, keystone, unicorn' || python3 -m pip install --user --upgrade -r ./requirements.txt + mkdir -p ${{ steps.pip-cache.outputs.dir }} + python3 -m pip install --user --upgrade -r ./requirements.txt - name: Setup GEF run: |