Skip to content

test must exercise with loaded, even on unchanged #231

test must exercise with loaded, even on unchanged

test must exercise with loaded, even on unchanged #231

Workflow file for this run

name: CI
on: push
env:
MIX_ENV: test
OTP_VERSION_SPEC: "24.2.1"
ELIXIR_VERSION_SPEC: "1.13.3"
jobs:
compile:
name: Compile
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: erlef/setup-beam@v1
id: setup
with:
otp-version: ${{ env.OTP_VERSION_SPEC }}
elixir-version: ${{ env.ELIXIR_VERSION_SPEC }}
- uses: actions/cache@v2
id: cache-mix
with:
path: deps
key: ${{ runner.os }}-mix-v5-${{ hashFiles('mix.lock') }}
restore-keys: |
${{ runner.os }}-mix-v5-
- uses: actions/cache@v2
id: cache-build
with:
path: _build
key: ${{ runner.os }}-build-v4-${{ hashFiles('lib/**/*.ex') }}${{ hashFiles('test/**/*.ex') }}${{ hashFiles('mix.lock') }}
restore-keys: |
${{ runner.os }}-build-v3-
- name: Install dependencies
if: steps.cache-mix.outputs.cache-hit != 'true'
run: mix deps.get
- name: Compile
if: steps.cache-build.outputs.cache-hit != 'true'
run: mix compile --warnings-as-errors
format:
name: "Check Formatted"
needs: compile
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: erlef/setup-beam@v1
id: setup
with:
otp-version: ${{ env.OTP_VERSION_SPEC }}
elixir-version: ${{ env.ELIXIR_VERSION_SPEC }}
- uses: actions/cache@v2
with:
path: deps
key: ${{ runner.os }}-mix-v5-${{ hashFiles('mix.lock') }}
- name: Check formatted
run: mix format --check-formatted
test:
name: Tests
needs: compile
runs-on: ubuntu-latest
services:
postgres:
image: postgres:12-alpine
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v2
- uses: erlef/setup-beam@v1
id: setup
with:
otp-version: ${{ env.OTP_VERSION_SPEC }}
elixir-version: ${{ env.ELIXIR_VERSION_SPEC }}
- uses: actions/cache@v2
with:
path: deps
key: ${{ runner.os }}-mix-v5-${{ hashFiles('mix.lock') }}
- uses: actions/cache@v2
with:
path: _build
key: ${{ runner.os }}-build-v4-${{ hashFiles('lib/**/*.ex') }}${{ hashFiles('test/**/*.ex') }}${{ hashFiles('mix.lock') }}
- name: Run tests
run: mix coveralls.json
env:
DATABASE_URL: ecto://postgres:postgres@localhost/ecto_diff_test
- uses: codecov/codecov-action@v2
with:
token: ${{secrets.CODECOV_TOKEN}}
fail_ci_if_error: true
credo:
name: Credo
needs: compile
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: erlef/setup-beam@v1
id: setup
with:
otp-version: ${{ env.OTP_VERSION_SPEC }}
elixir-version: ${{ env.ELIXIR_VERSION_SPEC }}
- uses: actions/cache@v2
with:
path: deps
key: ${{ runner.os }}-mix-v5-${{ hashFiles('mix.lock') }}
- uses: actions/cache@v2
with:
path: _build
key: ${{ runner.os }}-build-v4-${{ hashFiles('lib/**/*.ex') }}${{ hashFiles('test/**/*.ex') }}${{ hashFiles('mix.lock') }}
- name: Run credo
run: mix credo --strict
dialyzer:
name: Dialyzer
runs-on: ubuntu-latest
env:
MIX_ENV: dev
steps:
- uses: actions/checkout@v2
- uses: erlef/setup-beam@v1
id: setup
with:
otp-version: ${{ env.OTP_VERSION_SPEC }}
elixir-version: ${{ env.ELIXIR_VERSION_SPEC }}
- uses: actions/cache@v2
id: cache-build-dev
with:
path: _build
key: ${{ runner.os }}-build-dev-v4-${{ hashFiles('lib/**/*.ex') }}${{ hashFiles('test/**/*.ex') }}${{ hashFiles('mix.lock') }}
restore-keys: |
${{ runner.os }}-build-dev-v4-
- uses: actions/cache@v2
with:
path: plts
key: ${{ runner.os }}-plts-v4-${{ hashFiles('lib/**/*.ex') }}${{ hashFiles('test/**/*.ex') }}${{ hashFiles('mix.lock') }}
restore-keys: |
${{ runner.os }}-plts-v4-
- name: Install dependencies
run: mix deps.get
- name: Compile
if: steps.cache-build-dev.outputs.cache-hit != 'true'
run: mix compile
- name: Run dialyzer
run: mix dialyzer