Skip to content

Commit

Permalink
build: reduce build time by caching compiled dependencies #278 (#279)
Browse files Browse the repository at this point in the history
  • Loading branch information
nwittstruck authored Jun 14, 2024
1 parent e476d1c commit e79141c
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions .github/workflows/on_push_branch__execute_tests.yml
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -18,19 +16,21 @@ 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

# See https://github.com/actions/cache
- 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:
Expand Down Expand Up @@ -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

Expand All @@ -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

Expand All @@ -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
- run: mix format --check-formatted

0 comments on commit e79141c

Please sign in to comment.