Skip to content

Merge pull request #420 from XiXiaPdx/update-ecto-for-otp26 #413

Merge pull request #420 from XiXiaPdx/update-ecto-for-otp26

Merge pull request #420 from XiXiaPdx/update-ecto-for-otp26 #413

Workflow file for this run

name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
unit_test:
name: Unit Tests - Elixir ${{matrix.elixir}} / OTP ${{matrix.otp}}
runs-on: ubuntu-20.04
strategy:
matrix:
include:
- elixir: '1.14'
otp: '26'
- elixir: '1.12'
otp: '24'
- elixir: '1.11'
otp: '23'
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: ${{ matrix.elixir }}
otp-version: ${{ matrix.otp }}
- name: Restore deps cache
uses: actions/cache@v2
with:
path: deps
key: deps-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}-${{ github.sha }}
restore-keys: |
deps-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}
deps-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}
- name: Restore _build cache
uses: actions/cache@v2
with:
path: _build
key: build-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}-${{ github.sha }}
restore-keys: |
build-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}
build-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}
- name: Install deps
run: mix deps.get
- name: Check Formatting
run: mix format --check-formatted
- name: Compile application
run: mix compile
env:
MIX_ENV: test
- name: Run unit tests
run: |
set +e
mix test
set -e
mix test --trace --failed
integration_test:
name: Integration Tests - Elixir ${{matrix.elixir}} / OTP ${{matrix.otp}}
runs-on: ubuntu-20.04
strategy:
matrix:
include:
- elixir: '1.14'
otp: '26'
- elixir: '1.12'
otp: '24'
defaults:
run:
working-directory: examples
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: ${{ matrix.elixir }}
otp-version: ${{ matrix.otp }}
- name: Restore deps cache
uses: actions/cache@v3
with:
path: examples/deps
key: deps-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}-${{ github.sha }}
restore-keys: |
deps-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}
deps-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}
- name: Restore _build cache
uses: actions/cache@v3
with:
path: examples/_build
key: build-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}-${{ github.sha }}
restore-keys: |
build-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}
build-${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}
- name: Install deps
run: mix deps.get
- name: Check Formatting
run: mix format --check-formatted
- name: Compile application
run: |
mix compile
env:
MIX_ENV: test
- name: Start integration test dependencies
run: |
docker-compose up -d
until pg_isready -h localhost; do sleep 1; done;
until mysqladmin --protocol tcp ping; do sleep 1; done;
- name: Run integration tests
run: |
mix test
mix instrumented_task
mix uninstrumented_task
env:
MIX_ENV: test