Feat/google storage config #57
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: CI | |
on: pull_request | |
env: | |
MIX_ENV: test | |
jobs: | |
deps: | |
name: Dependencies | |
runs-on: ubuntu-latest | |
env: | |
MIX_ENV: test | |
strategy: | |
matrix: | |
elixir: [1.14] | |
otp: [25.0] | |
steps: | |
- name: Cancel Previous Runs | |
uses: styfle/[email protected] | |
with: | |
access_token: ${{ github.token }} | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Setup | |
uses: erlef/setup-elixir@v1 | |
with: | |
elixir-version: ${{ matrix.elixir }} | |
otp-version: ${{ matrix.otp }} | |
- name: Retrieve Cached Dependencies | |
uses: actions/cache@v2 | |
id: mix-cache | |
with: | |
path: | | |
deps | |
_build | |
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles(format('{0}{1}', github.workspace, '/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 | |
mix deps.compile | |
gen_plt_cache: | |
name: PLT_cache | |
runs-on: ubuntu-latest | |
env: | |
MIX_ENV: test | |
strategy: | |
matrix: | |
elixir: [1.14] | |
otp: [25.0] | |
needs: | |
- deps | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Setup | |
uses: erlef/setup-elixir@v1 | |
with: | |
elixir-version: ${{ matrix.elixir }} | |
otp-version: ${{ matrix.otp }} | |
- name: Retrieve Cached Dependencies | |
uses: actions/cache@v2 | |
id: plt-cache | |
with: | |
path: | | |
deps | |
_build | |
priv/plts | |
key: plt-v4-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }} | |
- name: Install Dependencies | |
if: steps.plt-cache.outputs.cache-hit != 'true' | |
run: | | |
mix deps.get | |
mix deps.compile | |
mix dialyzer --plt | |
lint: | |
runs-on: ubuntu-latest | |
env: | |
MIX_ENV: test | |
strategy: | |
matrix: | |
elixir: [1.14] | |
otp: [25.0] | |
needs: | |
- deps | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: erlef/setup-elixir@v1 | |
with: | |
elixir-version: ${{ matrix.elixir }} | |
otp-version: ${{ matrix.otp }} | |
- name: Retrieve Cached Dependencies | |
uses: actions/cache@v2 | |
id: mix-cache | |
with: | |
path: | | |
deps | |
_build | |
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }} | |
- name: Fetch dependencies | |
if: steps.mix-cache.outputs.cache-hit != 'true' | |
run: mix deps.get | |
- name: ==> 🔎 Lint | |
run: mix credo | |
dialyzer: | |
runs-on: ubuntu-latest | |
env: | |
MIX_ENV: test | |
strategy: | |
matrix: | |
elixir: [1.14] | |
otp: [25.0] | |
needs: | |
- gen_plt_cache | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: erlef/setup-elixir@v1 | |
with: | |
elixir-version: ${{ matrix.elixir }} | |
otp-version: ${{ matrix.otp }} | |
- uses: actions/cache@v2 | |
env: | |
cache-name: mix-plt-cache | |
with: | |
path: | | |
deps | |
_build | |
priv/plts | |
key: plt-v4-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }} | |
- name: Fetch dependencies | |
if: steps.mix-plt-cache.outputs.cache-hit != 'true' | |
run: mix deps.get | |
- name: ==> 🔎 Static dialyze | |
run: mix dialyzer | |
tests: | |
name: Testing and coverage | |
needs: deps | |
runs-on: ubuntu-latest | |
env: | |
MIX_ENV: test | |
TEST_DATABASE_URL: postgres://postgres:postgres@localhost:5432/go_escuela_lms_test | |
strategy: | |
matrix: | |
elixir: [1.14] | |
otp: [25.0] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Setup | |
uses: erlef/setup-elixir@v1 | |
with: | |
elixir-version: ${{ matrix.elixir }} | |
otp-version: ${{ matrix.otp }} | |
- name: Retrieve Cached Dependencies | |
uses: actions/cache@v2 | |
id: mix-cache | |
with: | |
path: | | |
deps | |
_build | |
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }} | |
- name: create databases | |
run: mix ecto.create | |
- name: prepare database | |
run: mix ecto.migrate | |
- name: Run coverage | |
run: | | |
MIX_ENV=test mix coveralls | |
services: | |
pg: | |
image: postgres:16 | |
ports: ['5432:5432'] | |
env: | |
POSTGRES_PASSWORD: postgres | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
check_format: | |
runs-on: ubuntu-latest | |
env: | |
MIX_ENV: test | |
strategy: | |
matrix: | |
elixir: [1.14] | |
otp: [25.0] | |
needs: | |
- deps | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: erlef/setup-elixir@v1 | |
with: | |
elixir-version: ${{ matrix.elixir }} | |
otp-version: ${{ matrix.otp }} | |
- name: Retrieve Cached Dependencies | |
uses: actions/cache@v2 | |
id: mix-cache | |
with: | |
path: | | |
deps | |
_build | |
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }} | |
- name: Fetch dependencies | |
if: steps.mix-cache.outputs.cache-hit != 'true' | |
run: mix deps.get | |
- name: ==> 🔎 Format check | |
run: mix format --check-formatted |