Feat/relatorio mensal #200
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: test | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
jobs: | |
unit_tests: | |
runs-on: ubuntu-latest | |
env: | |
MIX_ENV: test | |
DATABASE_USER: pescarte | |
DATABASE_PASSWORD: pescarte | |
strategy: | |
matrix: | |
elixir: [1.14.2] | |
otp: [25.1.2.1] | |
services: | |
db: | |
env: | |
POSTGRES_USER: pescarte | |
POSTGRES_PASSWORD: pescarte | |
POSTGRES_DB: pescarte_test | |
image: postgres:13.5 | |
ports: ['5432:5432'] | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- name: Cancel Previous Runs | |
uses: styfle/[email protected] | |
with: | |
access_token: ${{ github.token }} | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
ref: ${{ github.event.client_payload.sha }} | |
- name: Setup | |
uses: erlef/setup-beam@v1 | |
with: | |
elixir-version: ${{ matrix.elixir }} | |
otp-version: ${{ matrix.otp }} | |
- name: Retrieve Cached Dependencies | |
uses: actions/cache@v3 | |
id: mix-cache | |
env: | |
cache-name: mix-cache | |
with: | |
path: | | |
deps | |
_build | |
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('mix.lock') }} | |
restore-keys: | | |
${{ runner.os }}-mix-${{ env.cache-name }} | |
- run: mix deps.get | |
- name: Run Unit Tests | |
run: mix test --only unit | |
integration_tests: | |
runs-on: ubuntu-latest | |
env: | |
MIX_ENV: test | |
DATABASE_USER: pescarte | |
DATABASE_PASSWORD: pescarte | |
strategy: | |
matrix: | |
elixir: [1.14.2] | |
otp: [25.1.2.1] | |
services: | |
db: | |
env: | |
POSTGRES_USER: pescarte | |
POSTGRES_PASSWORD: pescarte | |
POSTGRES_DB: pescarte_test | |
image: postgres:13.5 | |
ports: ['5432:5432'] | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- name: Cancel Previous Runs | |
uses: styfle/[email protected] | |
with: | |
access_token: ${{ github.token }} | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
ref: ${{ github.event.client_payload.sha }} | |
- name: Setup | |
uses: erlef/setup-beam@v1 | |
with: | |
elixir-version: ${{ matrix.elixir }} | |
otp-version: ${{ matrix.otp }} | |
- name: Retrieve Cached Dependencies | |
uses: actions/cache@v3 | |
id: mix-cache | |
env: | |
cache-name: mix-cache | |
with: | |
path: | | |
deps | |
_build | |
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('mix.lock') }} | |
restore-keys: | | |
${{ runner.os }}-mix-${{ env.cache-name }} | |
- run: mix deps.get | |
- name: Run Integration Tests | |
run: mix test --only integration |