From 76eb15dd347689dfd30daa59ed8f91e4b1897c7e Mon Sep 17 00:00:00 2001 From: Tiago Moraes Date: Thu, 11 Jan 2024 21:55:34 -0300 Subject: [PATCH 1/3] update actions/checkout to v4 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3f32264c..f78ec3a6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,7 +40,7 @@ jobs: env: MIX_ENV: test steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: erlef/setup-beam@v1 with: otp-version: ${{matrix.otp}} From 225c2eaa3d3d6254cd6cc155a5e4b9e2293426cc Mon Sep 17 00:00:00 2001 From: Tiago Moraes Date: Thu, 11 Jan 2024 22:39:25 -0300 Subject: [PATCH 2/3] cache for dep and _build and separate deps.compile step --- .github/workflows/ci.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f78ec3a6..44b230b1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,11 +45,20 @@ jobs: with: otp-version: ${{matrix.otp}} elixir-version: ${{matrix.elixir}} + - name: Deps and _build cache + uses: actions/cache@v3 + id: deps-cache + with: + path: | + deps + _build + key: ${{ runner.os }}-${{ runner.arch }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('mix.lock') }} - name: Install Dependencies run: | mix local.hex --force mix local.rebar --force mix deps.get --only test + - run: mix deps.compile - run: mix format --check-formatted if: matrix.check_formatted - run: mix compile --warnings-as-errors From b56ff7649cbcb0555c0807fbc50a42183764d014 Mon Sep 17 00:00:00 2001 From: Tiago Moraes Date: Thu, 11 Jan 2024 22:47:14 -0300 Subject: [PATCH 3/3] only fetch and compile deps if cache not found --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 44b230b1..9182b580 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,11 +54,13 @@ jobs: _build key: ${{ runner.os }}-${{ runner.arch }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('mix.lock') }} - name: Install Dependencies + if: steps.deps-cache.outputs.cache-hit != 'true' run: | mix local.hex --force mix local.rebar --force mix deps.get --only test - run: mix deps.compile + if: steps.deps-cache.outputs.cache-hit != 'true' - run: mix format --check-formatted if: matrix.check_formatted - run: mix compile --warnings-as-errors