mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 18:18:55 +00:00
Not all tools are needed for all parts of the codebase. In order to avoid installing all tools, we create nested `.tool-versions` files that list the specific dev-tools needed for a certain part of the product.
59 lines
2.0 KiB
YAML
59 lines
2.0 KiB
YAML
name: "Setup Elixir"
|
|
description: "Sets up the correct Elixir version and installs deps"
|
|
inputs:
|
|
mix_env:
|
|
description: "Limit deps to mix env"
|
|
required: true
|
|
outputs:
|
|
otp-version:
|
|
description: "The OTP version"
|
|
value: ${{ steps.versions.outputs.erlang }}
|
|
elixir-version:
|
|
description: "The Elixir version"
|
|
value: ${{ steps.versions.outputs.elixir }}
|
|
runs:
|
|
using: "composite"
|
|
steps:
|
|
- name: Tool Versions
|
|
id: versions
|
|
uses: marocchino/tool-versions-action@18a164fa2b0db1cc1edf7305fcb17ace36d1c306 # v1.2.0
|
|
with:
|
|
path: elixir/.tool-versions
|
|
- uses: erlef/setup-beam@e6d7c94229049569db56a7ad5a540c051a010af9 # v1.20.4
|
|
id: setup-beam
|
|
with:
|
|
otp-version: ${{ steps.versions.outputs.erlang }}
|
|
elixir-version: ${{ steps.versions.outputs.elixir }}
|
|
- name: Setup Hex and Rebar
|
|
shell: bash
|
|
working-directory: ./elixir
|
|
run: |
|
|
mix local.hex --force
|
|
mix local.rebar --force
|
|
- uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
|
|
name: Restore Elixir Deps Cache
|
|
id: cache
|
|
with:
|
|
path: |
|
|
elixir/deps
|
|
elixir/_build/${{ inputs.mix_env }}
|
|
key: elixir-deps-${{ runner.os }}-${{ runner.arch }}-${{ inputs.mix_env }}-${{ steps.setup-beam.outputs.elixir-version }}-${{ hashFiles('elixir/mix.lock') }}
|
|
- name: Install Dependencies
|
|
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
|
|
shell: bash
|
|
working-directory: ./elixir
|
|
run: mix deps.get --only ${{ inputs.mix_env }}
|
|
- name: Compile Dependencies
|
|
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
|
|
shell: bash
|
|
working-directory: ./elixir
|
|
run: mix deps.compile --skip-umbrella-children
|
|
- uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
|
|
name: Save Elixir Deps Cache
|
|
if: ${{ github.ref_name == 'main' }}
|
|
with:
|
|
path: |
|
|
elixir/deps
|
|
elixir/_build/${{ inputs.mix_env }}
|
|
key: ${{ steps.cache.outputs.cache-primary-key }}
|