Skip to content

Instantly share code, notes, and snippets.

@speeddragon
Created April 23, 2019 14:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save speeddragon/1317e7c63d4585953cd5bd1ffdebfb07 to your computer and use it in GitHub Desktop.
Save speeddragon/1317e7c63d4585953cd5bd1ffdebfb07 to your computer and use it in GitHub Desktop.
description: Build Elixir source code
parameters:
cache-version:
default: v1
description: String key to store cache in
type: string
steps:
- checkout
- restore_cache:
keys:
- >-
<< parameters.cache-version >>-mix-cache-{{ .Branch }}-{{ checksum
"mix.lock" }}
- '<< parameters.cache-version >>-mix-cache-{{ .Branch }}'
- << parameters.cache-version >>-mix-cache
- restore_cache:
keys:
- >-
<< parameters.cache-version >>-build-cache-{{ .Branch }}-{{ checksum
"mix.lock" }}
- '<< parameters.cache-version >>-build-cache-{{ .Branch }}'
- << parameters.cache-version >>-build-cache
- run: mix local.hex --force
- run: mix local.rebar --force
- run: 'mix do deps.get, compile'
- save_cache:
key: >-
<< parameters.cache-version >>-mix-cache-{{ .Branch }}-{{ checksum
"mix.lock" }}
paths: deps
- save_cache:
key: '<< parameters.cache-version >>-mix-cache-{{ .Branch }}'
paths: deps
- save_cache:
key: << parameters.cache-version >>-mix-cache
paths: deps
- save_cache:
key: >-
<< parameters.cache-version >>-build-cache-{{ .Branch }}-{{ checksum
"mix.lock" }}
paths: _build
- save_cache:
key: '<< parameters.cache-version >>-build-cache-{{ .Branch }}'
paths: _build
- save_cache:
key: << parameters.cache-version >>-build-cache
paths: _build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment