Skip to content
This repository has been archived by the owner on Nov 7, 2024. It is now read-only.

Teste Vinicius Moreira #121

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .credo.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
%{
configs: [
%{
name: "default",
files: %{
included: ~w{config lib test}
},
strict: true,
color: true,
checks: [
# https://hexdocs.pm/credo/1.4.0/config_file.html
{Credo.Check.Readability.ModuleDoc, false},
{Credo.Check.Readability.MaxLineLength, max_length: 100},
{Credo.Check.Consistency.TabsOrSpaces},
{Credo.Check.Readability.MaxLineLength, priority: :low, max_length: 100},
{Credo.Check.Design.TagTODO, exit_status: 2},
{Credo.Check.Refactor.MapInto, false},
{Credo.Check.Warning.LazyLogging, false}
]
}
]
}
5 changes: 5 additions & 0 deletions .formatter.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[
import_deps: [:ecto, :phoenix],
inputs: ["*.{ex,exs}", "priv/*/seeds.exs", "{config,lib,test}/**/*.{ex,exs}"],
subdirectories: ["priv/*/migrations"]
]
26 changes: 26 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Gigalixir CD

on:
push:
branches:
- main
jobs:
deploy:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
ref: main
fetch-depth: 0
- uses: actions/setup-python@v2
with:
python-version: 3.8.1
- uses: mhanberg/[email protected]
with:
GIGALIXIR_USERNAME: ${{ secrets.GIGALIXIR_USERNAME}}
GIGALIXIR_PASSWORD: ${{ secrets.GIGALIXIR_PASSWORD}}
GIGALIXIR_APP: ${{ secrets.GIGALIXIR_APP}}
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY}}
MIGRATIONS: false
27 changes: 27 additions & 0 deletions .github/workflows/dialyzer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Verify Dialyzer

on: pull_request

jobs:
dialyzer:
runs-on: ubuntu-latest
strategy:
matrix:
elixir: [1.13]
otp: [24]
steps:
- uses: actions/checkout@v2
- uses: erlef/setup-elixir@v1
with:
elixir-version: ${{ matrix.elixir }}
otp-version: ${{ matrix.otp }}
- uses: actions/cache@v1
id: mix-cache-dialyzer
with:
path: deps
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- name: Install Mix Dependencies
if: steps.mix-cache-dialyzer.outputs.cache.hit != 'true'
run: mix deps.get
- name: ===> Dialyzer
run: mix dialyzer
27 changes: 27 additions & 0 deletions .github/workflows/formater.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Verify Format

on: pull_request

jobs:
check_format:
runs-on: ubuntu-latest
strategy:
matrix:
elixir: [1.13]
otp: [24]
steps:
- uses: actions/checkout@v2
- uses: erlef/setup-elixir@v1
with:
elixir-version: ${{ matrix.elixir }}
otp-version: ${{ matrix.otp }}
- uses: actions/cache@v1
id: mix-cache-format
with:
path: deps
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- name: Install Mix Dependencies
if: steps.mix-cache-format.outputs.cache.hit != 'true'
run: mix deps.get
- name: ===> FORMAT
run: mix format --check-formatted
27 changes: 27 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Verify LINT

on: pull_request

jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
elixir: [1.13]
otp: [24]
steps:
- uses: actions/checkout@v2
- uses: erlef/setup-elixir@v1
with:
elixir-version: ${{ matrix.elixir }}
otp-version: ${{ matrix.otp }}
- uses: actions/cache@v1
id: mix-cache-lint
with:
path: deps
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- name: Install Mix Dependencies
if: steps.mix-cache-lint.outputs.cache.hit != 'true'
run: mix deps.get
- name: ===> Credo LINT
run: mix credo --strict
27 changes: 27 additions & 0 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Verify Security

on: pull_request

jobs:
security:
runs-on: ubuntu-latest
strategy:
matrix:
elixir: [1.13]
otp: [24]
steps:
- uses: actions/checkout@v2
- uses: erlef/setup-elixir@v1
with:
elixir-version: ${{ matrix.elixir }}
otp-version: ${{ matrix.otp }}
- uses: actions/cache@v1
id: mix-cache-security
with:
path: deps
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- name: Install Mix Dependencies
if: steps.mix-cache-security.outputs.cache.hit != 'true'
run: mix deps.get
- name: ===> Security
run: mix sobelow --config
42 changes: 42 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Verify Tests

on: pull_request

jobs:
coverage:
runs-on: ubuntu-latest
strategy:
matrix:
elixir: [1.13]
otp: [24]
steps:
- uses: actions/checkout@v2
- uses: erlef/setup-elixir@v1
with:
elixir-version: ${{ matrix.elixir }}
otp-version: ${{ matrix.otp }}
- uses: actions/cache@v1
id: mix-cache-coverage
with:
path: deps
key: ${{ runner.os }}-${{ matrix.otp }}-${{ matrix.elixir }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
- name: Install Mix Dependencies
if: steps.mix-cache-coverage.outputs.cache.hit != 'true'
run: |
mix local.rebar --force
mix local.hex --force
mix deps.get
mix ecto.create
- name: ===> Verify Coverage and Tests
run: mix coveralls.html
services:
pg:
image: postgres:13
ports: ['5432:5432']
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
34 changes: 34 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# The directory Mix will write compiled artifacts to.
/_build/

# If you run "mix test --cover", coverage assets end up here.
/cover/

# The directory Mix downloads your dependencies sources to.
/deps/

# Where 3rd-party dependencies like ExDoc output generated docs.
/doc/

# Ignore .fetch files in case you like to edit your project deps locally.
/.fetch

# If the VM crashes, it generates a dump, let's ignore it too.
erl_crash.dump

# Also ignore archive artifacts (built via "mix archive.build").
*.ez

# Ignore package tarball (built via "mix hex.build").
ateliware-*.tar

# Ignore assets that are produced by build tools.
#/priv/static/assets/

# Ignore digested assets cache.
#/priv/static/cache_manifest.json

# In case you use Node.js/npm, you want to ignore these.
npm-debug.log
/assets/node_modules/

26 changes: 9 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,14 @@
# Desafio técnico para desenvolvedores
# Teste Ateliware

Construa uma nova aplicação, utilizando o framework de sua preferência (Ruby on Rails, Elixir Phoenix, Python Django ou Flask, NodeJS Sails, Java Spring, ASP.NET ou outro), a qual deverá conectar na API do GitHub e disponibilizar as seguintes funcionalidades:
Aplicação que pesquisa repositórios no Github pelas seguintes linguagens: Elixir, Ruby, Phython, Javascript e Vue.

- Botão para buscar e armazenar os repositórios destaques de 5 linguagens à sua escolha;
- Listar os repositórios encontrados;
- Visualizar os detalhes de cada repositório.
Para executar a aplicação, siga os passos abaixo:

Alguns requisitos:
* Instale as dependências com `mix deps.get`
* Crie o banco de dados com `mix ecto.setup`
* Instale a dependências do Node.js com `cd assets && npm install`
* Inciei o Phoenix endpoint com `mix phx.server` ou dentro IEx com `iex -S mix phx.server`

- Deve ser uma aplicação totalmente nova;
- A solução deve estar em um repositório público do GitHub;
- A aplicação deve armazenar as informações encontradas;
- Utilizar PostgreSQL, MySQL ou SQL Server;
- O deploy deve ser realizado, preferencialmente, no Heroku, AWS ou no Azure;
- A aplicação precisa ter testes automatizados;
- Preferenciamente dockerizar a aplicação;
- Por favor atualizar o readme da aplicação com passo a passo com instrução para subir o ambiente.
Agora, você pode visitar o endereço [`localhost:4000`](http://localhost:4000) pelo navegador.

Quando terminar, faça um Pull Request neste repo e avise-nos por email.

**IMPORTANTE:** se você não conseguir finalizar o teste, por favor nos diga o motivo e descreva quais foram as suas dificuldades. Você pode também sugerir uma outra abordagem para avaliarmos seus skills técnicos, vender seu peixe, mostrar-nos do que é capaz.
O deploy do projeto está no Gigalixir e pode ser acessado por essa urls: [`https://ateliware-teste.gigalixirapp.com/`](https://ateliware-teste.gigalixirapp.com/)
Loading