From e79141c70dd48c6d6bbc007f6efaff62805ace4a Mon Sep 17 00:00:00 2001 From: Nicholas Date: Fri, 14 Jun 2024 17:29:07 +0200 Subject: [PATCH] build: reduce build time by caching compiled dependencies #278 (#279) --- .../on_push_branch__execute_tests.yml | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/.github/workflows/on_push_branch__execute_tests.yml b/.github/workflows/on_push_branch__execute_tests.yml index fb7cf3a..33c2e11 100644 --- a/.github/workflows/on_push_branch__execute_tests.yml +++ b/.github/workflows/on_push_branch__execute_tests.yml @@ -1,10 +1,8 @@ name: on_push_branch__execute_tests -on: - [push, pull_request] +on: [push, pull_request] jobs: - build_deps: runs-on: ubuntu-latest # Currently, this need to be synced manually with the Dockerfile. In the future, the workflow should be changed, @@ -18,7 +16,7 @@ jobs: # we need cmake for fast_sanitize: - run: apt-get -y update && apt-get -y install build-essential cmake - + # install hex: - run: mix local.hex --force && mix local.rebar --force @@ -26,11 +24,13 @@ jobs: - uses: actions/cache@v4 id: cache with: - path: deps + path: | + deps + _build key: ${{ runner.os }}-mix-v4-${{ hashFiles('**/mix.lock') }} restore-keys: ${{ runner.os }}-mix-v4 - - run: mix deps.get + - run: mix deps.get && mix deps.compile if: steps.cache.outputs.cache-hit != 'true' check_mix_test: @@ -78,10 +78,12 @@ jobs: - uses: actions/cache@v4 with: - path: deps + path: | + deps + _build key: ${{ runner.os }}-mix-v4-${{ hashFiles('**/mix.lock') }} restore-keys: ${{ runner.os }}-mix-v4 - + # install hex: - run: mix local.hex --force && mix local.rebar --force @@ -101,7 +103,7 @@ jobs: steps: - name: Check out repository code uses: actions/checkout@v4 - + # install hex: - run: mix local.hex --force && mix local.rebar --force @@ -110,8 +112,10 @@ jobs: - uses: actions/cache@v4 with: - path: deps + path: | + deps + _build key: ${{ runner.os }}-mix-v4-${{ hashFiles('**/mix.lock') }} restore-keys: ${{ runner.os }}-mix-v4 - - run: mix format --check-formatted \ No newline at end of file + - run: mix format --check-formatted