-
Notifications
You must be signed in to change notification settings - Fork 750
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(refactor): use composite action to avoid duplication in elixir wor…
…kflow
- Loading branch information
1 parent
953ecdf
commit 99682d7
Showing
2 changed files
with
114 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
name: "Setup Elixir and Cache Dependencies" | ||
description: "Setup Elixir, OTP and cache dependencies" | ||
inputs: | ||
elixir-version: | ||
description: "Elixir version" | ||
required: false | ||
default: "1.16.2" | ||
otp-version: | ||
description: "OTP version" | ||
required: false | ||
default: "26" | ||
cache-name-deps: | ||
description: "Cache name for dependencies" | ||
required: true | ||
cache-name-compiled: | ||
description: "Cache name for compiled build" | ||
required: true | ||
mix-env: | ||
description: "Mix environment" | ||
required: false | ||
default: "dev" | ||
ELIXIR_ASSERT_TIMEOUT: | ||
description: "Elixir assert timeout" | ||
required: false | ||
default: "1000" | ||
outputs: | ||
elixir-version: | ||
description: "The Elixir version used in the setup" | ||
value: ${{ steps.beam.outputs.elixir-version }} | ||
otp-version: | ||
description: "The OTP version used in the setup" | ||
value: ${{ steps.beam.outputs.otp-version }} | ||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||
|
||
- name: Setup Elixir and OTP | ||
id: beam | ||
uses: erlef/setup-beam@b9c58b0450cd832ccdb3c17cc156a47065d2114f # v1.18.1 | ||
with: | ||
elixir-version: ${{ inputs.elixir-version }} | ||
otp-version: ${{ inputs.otp-version }} | ||
|
||
- name: Cache deps | ||
id: cache-deps | ||
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 | ||
with: | ||
path: deps | ||
key: ${{ runner.os }}-mix-${{ inputs.cache-name-deps }}-${{ hashFiles('**/mix.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-mix-${{ inputs.cache-name-deps }}- | ||
- name: Cache compiled build | ||
id: cache-build | ||
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 | ||
with: | ||
path: | | ||
_build | ||
priv/cldr/locales | ||
key: ${{ runner.os }}-mix-${{ inputs.cache-name-compiled }}-${{ hashFiles('**/mix.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-mix-${{ inputs.cache-name-compiled }}- | ||
${{ runner.os }}-mix- | ||
- name: Clean to rule out incremental build as a source of flakiness | ||
if: github.run_attempt > 3 | ||
run: | | ||
mix deps.clean --all | ||
mix clean | ||
shell: sh | ||
|
||
- name: Install dependencies | ||
run: mix deps.get | ||
shell: sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters