Add CI tests for sample phoenix application #553
Workflow file for this run
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
name: Elixir CI | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
jobs: | |
lint: | |
name: Lint (OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}}) | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
otp: ["26"] | |
elixir: ["1.16"] | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: erlef/setup-beam@v1 | |
id: beam | |
with: | |
otp-version: ${{matrix.otp}} | |
elixir-version: ${{matrix.elixir}} | |
- name: PLT cache | |
uses: actions/cache@v2 | |
with: | |
key: | | |
${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-plt | |
restore-keys: | | |
${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-plt | |
path: | | |
priv/plts | |
- run: mix deps.get | |
- run: mix compile --warnings-as-errors | |
- run: mix format --check-formatted | |
- run: mix credo --strict --all | |
- run: mix dialyzer | |
test_plug_examples: | |
runs-on: ubuntu-latest | |
name: Test Sample Plug Application | |
env: | |
MIX_ENV: test | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: erlef/setup-beam@v1 | |
with: | |
otp-version: 26 | |
elixir-version: 1.16 | |
- uses: actions/cache@v2 | |
with: | |
key: | | |
${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-plug-build | |
restore-keys: | | |
${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-plug-build | |
path: | | |
_build | |
- name: run Plug sample app tests | |
working-directory: ./examples/plug_app | |
run: mix do deps.get, test | |
test_phoenix_examples: | |
runs-on: ubuntu-latest | |
name: Test Sample Phoenix Application | |
env: | |
MIX_ENV: test | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: erlef/setup-beam@v1 | |
with: | |
otp-version: 26 | |
elixir-version: 1.16 | |
- uses: actions/cache@v2 | |
with: | |
key: | | |
${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-phoenix-build | |
restore-keys: | | |
${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-phoenix-build | |
path: | | |
_build | |
- name: run Phoenix sample app tests | |
working-directory: ./examples/phoenix_app | |
run: mix do deps.get, test, dialyzer | |
test: | |
runs-on: ubuntu-20.04 | |
name: Test (OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}}) | |
strategy: | |
matrix: | |
otp: ["23", "24", "25", "26"] | |
elixir: ["1.14", "1.15", "1.16"] | |
# Test each elixir version with lowest and highest compatible OTP version, exclude others | |
# See https://hexdocs.pm/elixir/compatibility-and-deprecations.html#between-elixir-and-erlang-otp | |
exclude: | |
- { otp: "24", elixir: "1.14" } | |
- { otp: "25", elixir: "1.14" } | |
- { otp: "23", elixir: "1.15" } | |
- { otp: "25", elixir: "1.15" } | |
- { otp: "23", elixir: "1.16" } | |
- { otp: "25", elixir: "1.16" } | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: erlef/setup-beam@v1 | |
with: | |
otp-version: ${{matrix.otp}} | |
elixir-version: ${{matrix.elixir}} | |
- uses: actions/cache@v2 | |
with: | |
key: | | |
${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-build | |
restore-keys: | | |
${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-build | |
path: | | |
_build | |
- run: mix deps.get | |
- run: mix test |