From 1a5f94bc68428bd1ba5b650f1c8161ec0c737da1 Mon Sep 17 00:00:00 2001 From: Ian Young Date: Thu, 7 Nov 2019 12:34:15 -0600 Subject: [PATCH 1/4] Add caching to Elixir workflow --- ci/elixir.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/ci/elixir.yml b/ci/elixir.yml index eed27bc..643e1b6 100644 --- a/ci/elixir.yml +++ b/ci/elixir.yml @@ -12,10 +12,24 @@ jobs: steps: - uses: actions/checkout@v1 + - name: Cache Mix Dependencies + uses: actions/cache@v1 + with: + path: deps + key: ${{ runner.OS }}-mix-${{ hashFiles('**/mix.lock') }} + restore-keys: | + ${{ runner.OS }}-mix- - name: Install Dependencies run: | mix local.rebar --force mix local.hex --force mix deps.get + - name: Cache Build Files + uses: actions/cache@v1 + with: + path: _build + key: ${{ runner.OS }}-build-${{ github.sha }} + restore-keys: | + ${{ runner.OS }}-build- - name: Run Tests run: mix test From b4f1aae32fa4651fa82e7fe1d22187db4975ab97 Mon Sep 17 00:00:00 2001 From: Jonathan Clem Date: Wed, 1 Jul 2020 14:09:21 -0400 Subject: [PATCH 2/4] Use sentence casing --- ci/elixir.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ci/elixir.yml b/ci/elixir.yml index 643e1b6..ca562ca 100644 --- a/ci/elixir.yml +++ b/ci/elixir.yml @@ -12,24 +12,24 @@ jobs: steps: - uses: actions/checkout@v1 - - name: Cache Mix Dependencies + - name: Cache mix dependencies uses: actions/cache@v1 with: path: deps key: ${{ runner.OS }}-mix-${{ hashFiles('**/mix.lock') }} restore-keys: | ${{ runner.OS }}-mix- - - name: Install Dependencies + - name: Install dependencies run: | mix local.rebar --force mix local.hex --force mix deps.get - - name: Cache Build Files + - name: Cache build files uses: actions/cache@v1 with: path: _build key: ${{ runner.OS }}-build-${{ github.sha }} restore-keys: | ${{ runner.OS }}-build- - - name: Run Tests + - name: Run tests run: mix test From cb6cee5157deeeb3f3b554c900f5efd0d5b887ae Mon Sep 17 00:00:00 2001 From: Jonathan Clem Date: Wed, 1 Jul 2020 14:14:45 -0400 Subject: [PATCH 3/4] Update elixir.yml --- ci/elixir.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ci/elixir.yml b/ci/elixir.yml index 7b3d5a4..1cad8fe 100644 --- a/ci/elixir.yml +++ b/ci/elixir.yml @@ -13,6 +13,11 @@ jobs: steps: - uses: actions/checkout@v2 + - name: Set up Elixir + uses: actions/setup-elixir@v1 + with: + elixir-version: '1.10.3' # Define the elixir version [required] + otp-version: '22.3' # Define the OTP version [required] - name: Cache mix dependencies uses: actions/cache@v1 with: @@ -30,4 +35,4 @@ jobs: - name: Install dependencies run: mix deps.get - name: Run tests - run: mix test \ No newline at end of file + run: mix test From 9995e35e759c66813fdcbb5aaaea5a2a49e04f56 Mon Sep 17 00:00:00 2001 From: Jonathan Clem Date: Wed, 1 Jul 2020 17:06:09 -0400 Subject: [PATCH 4/4] Cache only Elixir dependencies, not build --- ci/elixir.yml | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/ci/elixir.yml b/ci/elixir.yml index 1cad8fe..4b3e78f 100644 --- a/ci/elixir.yml +++ b/ci/elixir.yml @@ -9,6 +9,7 @@ on: jobs: build: + name: Build and test runs-on: ubuntu-latest steps: @@ -18,20 +19,12 @@ jobs: with: elixir-version: '1.10.3' # Define the elixir version [required] otp-version: '22.3' # Define the OTP version [required] - - name: Cache mix dependencies - uses: actions/cache@v1 + - name: Restore dependencies cache + uses: actions/cache@v2 with: path: deps - key: ${{ runner.OS }}-mix-${{ hashFiles('**/mix.lock') }} - restore-keys: | - ${{ runner.OS }}-mix- - - name: Cache build files - uses: actions/cache@v1 - with: - path: _build - key: ${{ runner.OS }}-build-${{ github.sha }} - restore-keys: | - ${{ runner.OS }}-build- + key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }} + restore-keys: ${{ runner.os }}-mix- - name: Install dependencies run: mix deps.get - name: Run tests