-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI updates and matrix of Elixir/Erlang versions (#29)
This change updates the CI so: - We test different Elixir/Erlang versions - We test that there are no unused versions in the mix.lock - Credo version is updated - Development versions are updated - Update actions version to avoid deprecations - Do not run CI on guides changes
- Loading branch information
Showing
3 changed files
with
52 additions
and
98 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 |
---|---|---|
@@ -1,121 +1,75 @@ | ||
name: code-analysis | ||
on: push | ||
name: CI | ||
on: | ||
push: | ||
branches: | ||
- main | ||
paths-ignore: | ||
- 'guides/**' | ||
pull_request: | ||
paths-ignore: | ||
- 'guides/**' | ||
env: | ||
MIX_ENV: test | ||
ERLANG_VERSION: 26.0.2 | ||
ELIXIR_VERSION: 1.16.0 | ||
|
||
jobs: | ||
compile_deps: | ||
code_quality_and_tests: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- elixir: 1.15.0 | ||
erlang: 24.0.0 | ||
- elixir: 1.16.0 | ||
erlang: 24.0.0 | ||
- elixir: 1.17.0 | ||
erlang: 27.0.0 | ||
services: | ||
db: | ||
image: postgres:15 | ||
ports: ["5432:5432"] | ||
env: | ||
POSTGRES_PASSWORD: postgres | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
name: Elixir v${{ matrix.elixir }}, Erlang v${{ matrix.erlang }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: erlef/setup-beam@v1 | ||
with: | ||
otp-version: ${{ env.ERLANG_VERSION }} | ||
elixir-version: ${{ env.ELIXIR_VERSION }} | ||
otp-version: ${{ matrix.erlang }} | ||
elixir-version: ${{ matrix.elixir }} | ||
|
||
- name: Retrieve Dependencies Cache | ||
uses: actions/cache@v2 | ||
uses: actions/cache@v4 | ||
id: mix-cache | ||
with: | ||
path: | | ||
deps | ||
_build | ||
key: ${{ runner.os }}-${{ env.ERLANG_VERSION }}-${{ env.ELIXIR_VERSION }}-mix-${{ hashFiles('**/mix.lock') }} | ||
key: ${{ runner.os }}-${{ matrix.erlang }}-${{ matrix.elixir }}-mix-${{ hashFiles('**/mix.lock') }} | ||
|
||
- name: Install Mix Dependencies | ||
run: | | ||
mix local.rebar --force | ||
mix local.hex --force | ||
mix deps.get | ||
run: mix deps.get | ||
|
||
- name: Check unused dependencies | ||
run: mix deps.unlock --check-unused | ||
|
||
- name: Compile dependencies | ||
run: mix deps.compile | ||
|
||
check_format: | ||
needs: [compile_deps] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: erlef/setup-beam@v1 | ||
with: | ||
otp-version: ${{ env.ERLANG_VERSION }} | ||
elixir-version: ${{ env.ELIXIR_VERSION }} | ||
- name: Retrieve Dependencies Cache | ||
uses: actions/cache@v2 | ||
id: mix-cache | ||
with: | ||
path: | | ||
deps | ||
_build | ||
key: ${{ runner.os }}-${{ env.ERLANG_VERSION }}-${{ env.ELIXIR_VERSION }}-mix-${{ hashFiles('**/mix.lock') }} | ||
- run: mix format --check-formatted | ||
- name: Check format | ||
run: mix format --check-formatted | ||
|
||
check_warnings: | ||
needs: [compile_deps] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: erlef/setup-beam@v1 | ||
with: | ||
otp-version: ${{ env.ERLANG_VERSION }} | ||
elixir-version: ${{ env.ELIXIR_VERSION }} | ||
- name: Retrieve Mix Dependencies Cache | ||
uses: actions/cache@v2 | ||
id: mix-cache | ||
with: | ||
path: | | ||
deps | ||
_build | ||
key: ${{ runner.os }}-${{ env.ERLANG_VERSION }}-${{ env.ELIXIR_VERSION }}-mix-${{ hashFiles('**/mix.lock') }} | ||
- name: Check application compile warnings | ||
run: mix compile --force --warnings-as-errors | ||
|
||
check_credo: | ||
needs: [compile_deps] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: erlef/setup-beam@v1 | ||
with: | ||
otp-version: ${{ env.ERLANG_VERSION }} | ||
elixir-version: ${{ env.ELIXIR_VERSION }} | ||
- name: Retrieve Mix Dependencies Cache | ||
uses: actions/cache@v2 | ||
id: mix-cache | ||
with: | ||
path: | | ||
deps | ||
_build | ||
key: ${{ runner.os }}-${{ env.ERLANG_VERSION }}-${{ env.ELIXIR_VERSION }}-mix-${{ hashFiles('**/mix.lock') }} | ||
- name: Check Credo warnings | ||
run: mix credo | ||
|
||
run_tests: | ||
needs: [compile_deps] | ||
runs-on: ubuntu-latest | ||
services: | ||
db: | ||
image: postgres:11 | ||
ports: ["5432:5432"] | ||
env: | ||
POSTGRES_PASSWORD: postgres | ||
options: >- | ||
--health-cmd pg_isready | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: erlef/setup-beam@v1 | ||
with: | ||
otp-version: ${{ env.ERLANG_VERSION }} | ||
elixir-version: ${{ env.ELIXIR_VERSION }} | ||
- name: Retrieve Mix Dependencies Cache | ||
uses: actions/cache@v2 | ||
id: mix-cache | ||
with: | ||
path: | | ||
deps | ||
_build | ||
key: ${{ runner.os }}-${{ env.ERLANG_VERSION }}-${{ env.ELIXIR_VERSION }}-mix-${{ hashFiles('**/mix.lock') }} | ||
- name: Run Tests | ||
run: 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
elixir 1.16 | ||
erlang 26.0.2 | ||
elixir 1.17 | ||
erlang 27.0 |
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