Skip to content

Commit

Permalink
improve ci workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
yordis committed Sep 11, 2023
1 parent 979492d commit 0b9dd85
Showing 1 changed file with 18 additions and 57 deletions.
75 changes: 18 additions & 57 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,94 +1,55 @@
---

name: Continuous Integration

on:
pull_request:
types:
- opened
- reopened
- synchronize
types: [opened, reopened, synchronize]
push:
branches:
- master

- 'master'
jobs:
Test:
runs-on: ubuntu-latest

container:
image: elixir:1.11-alpine

services:
postgres:
image: postgres:11
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports: ["5432:5432"]

ports: [ "5432:5432" ]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Checkout Code
uses: actions/checkout@v1
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
persist-credentials: false

- name: Install (mix)
elixir-version: "1.14"
otp-version: "24.3"
- name: Install Dependencies
run: |
mix local.rebar --force
mix local.hex --force
- name: Install (deps)
run: mix deps.get

mix deps.get
- name: Run Tests
run: mix test
env:
DB_HOST: postgres

Format:
Linting:
runs-on: ubuntu-latest

container:
image: elixir:1.11-alpine

steps:
- name: Checkout Code
uses: actions/checkout@v2
uses: actions/checkout@v1
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
persist-credentials: false

- name: Install (mix)
elixir-version: "1.14"
otp-version: "24.3"
- name: Install Dependencies
run: |
mix local.rebar --force
mix local.hex --force
mix deps.get
- name: Run Formatter
run: mix format --check-formatted

Credo:
runs-on: ubuntu-latest

container:
image: elixir:1.11-alpine

steps:
- name: Checkout Code
uses: actions/checkout@v2
with:
persist-credentials: false

- name: Install (os)
run: apk add --no-cache gcc g++ git make musl-dev tar zstd

- name: Install (mix)
run: |
mix local.rebar --force
mix local.hex --force
- name: Install (deps)
run: mix deps.get

- name: Run Credo
run: mix credo

0 comments on commit 0b9dd85

Please sign in to comment.