-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
129 additions
and
6 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,56 @@ | ||
name: "Setup Elixir" | ||
description: "Sets up Elixir and all the caches" | ||
|
||
inputs: | ||
elixir-version: | ||
required: true | ||
description: "Elixir version to install" | ||
default: "1.14" | ||
otp-version: | ||
required: true | ||
description: "Erlang/OTP version to install" | ||
default: "25.0" | ||
phoenix-live-view-version: | ||
required: true | ||
description: "Phoenix LiveView Version to use" | ||
default: "~> 0.18.17" | ||
phoenix-version: | ||
required: true | ||
description: "Phoenix Version to use" | ||
default: "1.7.0" | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Elixir | ||
uses: erlef/setup-beam@988e02bfe678367a02564f65ca2e37726dc0268f | ||
with: | ||
elixir-version: "${{ inputs.elixir-version }}" | ||
otp-version: "${{ inputs.otp-version }}" | ||
- name: Restore mix deps cache | ||
uses: actions/cache@v3 | ||
id: mix-cache | ||
with: | ||
path: | | ||
deps | ||
test_app/deps | ||
_build | ||
test_app/_build | ||
!_build/prod | ||
!test_app/_build/prod | ||
priv/plts | ||
key: mix-${{ runner.os }}-${{ inputs.elixir-version }}-${{ inputs.otp-version }}-${{ inputs.phoenix-version }}-${{ inputs.phoenix-live-view-version }}-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }} | ||
restore-keys: | | ||
mix-${{ runner.os }}-${{ inputs.elixir-version }}-${{ inputs.otp-version }}-${{ inputs.phoenix-version }}-${{ inputs.phoenix-live-view-version }}- | ||
- name: Install Mix Base deps | ||
shell: bash | ||
if: steps.mix-cache.outputs.cache-hit != 'true' | ||
run: | | ||
mix local.rebar --force | ||
mix local.hex --force | ||
- run: mix deps.get | ||
shell: bash | ||
- name: Phoenix Version | ||
run: mix deps | grep "phoenix " | ||
shell: bash |
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,55 @@ | ||
name: Elixir CI | ||
|
||
on: | ||
push: | ||
branches: [main, staging] | ||
pull_request: | ||
branches: [main, staging] | ||
|
||
jobs: | ||
test: | ||
name: Build and test | ||
runs-on: ubuntu-20.04 | ||
|
||
strategy: | ||
matrix: | ||
elixir: [1.14.5, 1.15.6] | ||
otp: [25.0, 26.0] | ||
phoenix-live-view-version: [0.19.0, 0.20.0] | ||
phoenix-version: [1.7.0] | ||
|
||
env: | ||
PHOENIX_VERSION: ${{matrix.phoenix-version}} | ||
PHOENIX_LIVE_VIEW_VERSION: ${{matrix.phoenix-live-view-version}} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Elixir | ||
uses: ./.github/actions/setup-elixir | ||
with: | ||
elixir-version: ${{ matrix.elixir }} | ||
otp-version: ${{ matrix.otp }} | ||
phoenix-live-view-version: ${{ matrix.phoenix-live-view-version }} | ||
phoenix-version: ${{ matrix.phoenix-version }} | ||
- run: mix format --check-formatted | ||
- run: mix test | ||
- run: mix credo --strict | ||
- run: mix compile --error-on-warnings | ||
- name: Retrieve PLT Cache | ||
uses: actions/cache@v3 | ||
id: plt-cache | ||
with: | ||
path: priv/plts | ||
key: plts-v.2-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ matrix.phoenix-version }}-${{ matrix.phoenix-live-view-version }}-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }} | ||
- name: Create PLTs | ||
if: steps.plt-cache.outputs.cache-hit != 'true' | ||
run: | | ||
mkdir -p priv/plts | ||
mix dialyzer --plt | ||
- run: mix dialyzer | ||
- name: Run test app tests | ||
run: | | ||
cd test_app | ||
mix deps.get | ||
mix deps | grep "phoenix " | ||
mix test |
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
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
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
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 |
---|---|---|
@@ -1,8 +1,4 @@ | ||
defmodule LiveViewEventsTest do | ||
use ExUnit.Case | ||
doctest LiveViewEvents | ||
|
||
test "greets the world" do | ||
assert LiveViewEvents.hello() == :world | ||
end | ||
end |