Update workflows to work with OTP
Lock ubuntu version to 20.04
Steps names to make it more explicit
Fix OTP
MODIFY
.github/workflows/checks.yml
.github/workflows/checks.yml
@@ -7,52 +7,49 @@ on:
branches: [ master ]
jobs:
- setup:
- name: check / setup
- runs-on: ubuntu-latest
+ dependencies:
+ name: check | setup dependencies
+ runs-on: ubuntu-20.04
env:
MIX_ENV: dev
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
-
strategy:
matrix:
- include:
- - elixir: 1.10.2
- erlang: 22.3
+ elixir: ['1.12.3']
+ erlang: ['24.3']
+
steps:
- - uses: actions/checkout@v2
- - uses: actions/setup-elixir@v1
+ - name: Cancel previous runs
+ uses: styfle/cancel-workflow-action@0.9.0
+ with:
+ access_token: ${{ github.token }}
+ - name: Checkout Github repo
+ uses: actions/checkout@v2
+ - name: Setup elixir & erlang enviroment
+ uses: actions/setup-elixir@v1
with:
elixir-version: ${{matrix.elixir}} # Define the elixir version [required]
otp-version: ${{matrix.erlang}} # Define the OTP version [required]
-
- - name: Retrieve Mix Dependencies Cache
- uses: actions/cache@v2
- id: mix-cache # id to use in retrieve action
- with:
- path: deps
- key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
-
- - name: Retrieve Mix Dependencies Compilation Cache
+ experimental-otp: true # More info https://github.com/actions/setup-elixir/issues/31
+ - name: Retrieve cached dependencies
uses: actions/cache@v2
- id: mix-deps-compile-cache # id to use in retrieve action
+ id: mix-cache
with:
- path: _build
- key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-deps-compile-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- - name: Install Mix Dependencies
+ path: |
+ deps
+ _build
+ key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('mix.lock') }}
+ - name: Install dependencies
if: steps.mix-cache.outputs.cache-hit != 'true'
run: |
mix local.rebar --force
mix local.hex --force
mix deps.get
-
- - name: Compile Mix Dependencies
- if: steps.mix-deps-compile-cache.outputs.cache-hit != 'true'
- run: mix deps.compile
+ mix deps.compile
run-checks:
name: check
- runs-on: ubuntu-latest
+ runs-on: ubuntu-20.04
needs: [setup]
env:
MIX_ENV: dev
@@ -70,10 +67,12 @@ jobs:
steps:
- uses: actions/checkout@v2
- - uses: actions/setup-elixir@v1
+ - name: Setup elixir & erlang enviroment
+ uses: actions/setup-elixir@v1
with:
elixir-version: ${{matrix.elixir}} # Define the elixir version [required]
otp-version: ${{matrix.erlang}} # Define the OTP version [required]
+ experimental-otp: true # More info https://github.com/actions/setup-elixir/issues/31
- name: Retrieve Mix Dependencies Cache
uses: actions/cache@v2

MODIFY
.github/workflows/test.yml
.github/workflows/test.yml
@@ -8,22 +8,28 @@ on:
jobs:
setup:
- name: runner / setup
- runs-on: ubuntu-latest
+ name: test / setup
+ runs-on: ubuntu-20.04
env:
MIX_ENV: test
-
strategy:
matrix:
- include:
- - elixir: 1.10.2
- erlang: 22.3
+ elixir: ['1.12.3']
+ erlang: ['24.3']
+
steps:
- - uses: actions/checkout@v2
- - uses: actions/setup-elixir@v1
+ - name: Cancel previous runs
+ uses: styfle/cancel-workflow-action@0.9.0
+ with:
+ access_token: ${{ github.token }}
+ - name: Checkout Github repo
+ uses: actions/checkout@v2
+ - name: Setup elixir & erlang enviroment
+ uses: actions/setup-elixir@v1
with:
elixir-version: ${{matrix.elixir}} # Define the elixir version [required]
otp-version: ${{matrix.erlang}} # Define the OTP version [required]
+ experimental-otp: true # More info https://github.com/actions/setup-elixir/issues/31
- name: Retrieve Mix Dependencies Cache
uses: actions/cache@v2
@@ -53,7 +59,7 @@ jobs:
name: runner / Test
needs: [setup]
- runs-on: ubuntu-latest
+ runs-on: ubuntu-20.04
env:
MIX_ENV: test
@@ -71,18 +77,17 @@ jobs:
- mix test
include:
- - elixir: 1.10.2
- erlang: 22.3
+ - elixir: 1.12.3
+ erlang: 24.3
steps:
- uses: actions/checkout@v2
- - name: Docker-compose up
- run: ./scripts/docker_up.sh
- - name: Setup elixir
+ - name: Setup elixir & erlang enviroment
uses: actions/setup-elixir@v1
with:
elixir-version: ${{matrix.elixir}} # Define the elixir version [required]
otp-version: ${{matrix.erlang}} # Define the OTP version [required]
+ experimental-otp: true # More info https://github.com/actions/setup-elixir/issues/31
- name: Retrieve Mix Dependencies Cache
uses: actions/cache@v2
@@ -98,7 +103,9 @@ jobs:
path: _build
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-deps-compile-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
+ - name: Docker-compose up
+ run: ./scripts/docker_up.sh
- name: Docker ps
- run: docker ps
+ run: docker ps -a
- name: Run Tests
run: ${{ matrix.tests }}

Update workflows to work with OTP

- Lock ubuntu version to 20.04
- Steps names to make it more explicit
- Fix OTP